diff options
Diffstat (limited to 'macosx/plugins/DFCdrom')
-rw-r--r-- | macosx/plugins/DFCdrom/DFCdrom.xcodeproj/project.pbxproj | 360 | ||||
-rw-r--r-- | macosx/plugins/DFCdrom/English.lproj/Credits.rtf | 13 | ||||
-rw-r--r-- | macosx/plugins/DFCdrom/English.lproj/DFCdromPluginConfig.nib/classes.nib | 18 | ||||
-rw-r--r-- | macosx/plugins/DFCdrom/English.lproj/DFCdromPluginConfig.nib/info.nib | 16 | ||||
-rw-r--r-- | macosx/plugins/DFCdrom/English.lproj/DFCdromPluginConfig.nib/keyedobjects.nib | bin | 0 -> 8896 bytes | |||
-rwxr-xr-x | macosx/plugins/DFCdrom/English.lproj/InfoPlist.strings | bin | 0 -> 486 bytes | |||
-rw-r--r-- | macosx/plugins/DFCdrom/Info.plist | 22 | ||||
-rw-r--r-- | macosx/plugins/DFCdrom/macsrc/PluginConfigController.h | 18 | ||||
-rw-r--r-- | macosx/plugins/DFCdrom/macsrc/PluginConfigController.m | 158 | ||||
-rw-r--r-- | macosx/plugins/DFCdrom/macsrc/cdr-macosx.c | 250 | ||||
-rw-r--r-- | macosx/plugins/DFCdrom/macsrc/cfg.c | 53 | ||||
-rw-r--r-- | macosx/plugins/DFCdrom/version.plist | 16 |
12 files changed, 924 insertions, 0 deletions
diff --git a/macosx/plugins/DFCdrom/DFCdrom.xcodeproj/project.pbxproj b/macosx/plugins/DFCdrom/DFCdrom.xcodeproj/project.pbxproj new file mode 100644 index 0000000..e5767cb --- /dev/null +++ b/macosx/plugins/DFCdrom/DFCdrom.xcodeproj/project.pbxproj @@ -0,0 +1,360 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 42; + objects = { + +/* Begin PBXBuildFile section */ + 2BD707180555997500CB5D9B /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2BD707170555997500CB5D9B /* IOKit.framework */; }; + 713DB2E811F113C30001BDD4 /* cdr.c in Sources */ = {isa = PBXBuildFile; fileRef = 713DB2E311F113C30001BDD4 /* cdr.c */; }; + 713DB2E911F113C30001BDD4 /* cdr.h in Headers */ = {isa = PBXBuildFile; fileRef = 713DB2E411F113C30001BDD4 /* cdr.h */; }; + 713DB2EB11F113C30001BDD4 /* util.c in Sources */ = {isa = PBXBuildFile; fileRef = 713DB2E611F113C30001BDD4 /* util.c */; }; + 71F3C32811F3CD0B007B9F12 /* cdr-macosx.c in Sources */ = {isa = PBXBuildFile; fileRef = 71F3C32411F3CD0B007B9F12 /* cdr-macosx.c */; }; + 71F3C32911F3CD0B007B9F12 /* cfg.c in Sources */ = {isa = PBXBuildFile; fileRef = 71F3C32511F3CD0B007B9F12 /* cfg.c */; }; + 71F3C32A11F3CD0B007B9F12 /* PluginConfigController.h in Headers */ = {isa = PBXBuildFile; fileRef = 71F3C32611F3CD0B007B9F12 /* PluginConfigController.h */; }; + 71F3C32B11F3CD0B007B9F12 /* PluginConfigController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71F3C32711F3CD0B007B9F12 /* PluginConfigController.m */; }; + 71F3C38611F3CFED007B9F12 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 71F3C38511F3CFED007B9F12 /* AppKit.framework */; }; + 71F3C38811F3CFF7007B9F12 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 71F3C38711F3CFF7007B9F12 /* Carbon.framework */; }; + 71F3C47A11F3D108007B9F12 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 71F3C47811F3D108007B9F12 /* Credits.rtf */; }; + 71F3C49D11F3D2B3007B9F12 /* DFCdromPluginConfig.nib in Resources */ = {isa = PBXBuildFile; fileRef = 71F3C49B11F3D2B3007B9F12 /* DFCdromPluginConfig.nib */; }; + 8D576314048677EA00EA77CD /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0AA1909FFE8422F4C02AAC07 /* CoreFoundation.framework */; }; + 8D5B49A804867FD3000E48DA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8D5B49A704867FD3000E48DA /* InfoPlist.strings */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 089C167EFE841241C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; }; + 0AA1909FFE8422F4C02AAC07 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; }; + 2BD707170555997500CB5D9B /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; }; + 713DB2E311F113C30001BDD4 /* cdr.c */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.c; name = cdr.c; path = ../../../plugins/dfcdrom/cdr.c; sourceTree = SOURCE_ROOT; }; + 713DB2E411F113C30001BDD4 /* cdr.h */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.h; name = cdr.h; path = ../../../plugins/dfcdrom/cdr.h; sourceTree = SOURCE_ROOT; }; + 713DB2E611F113C30001BDD4 /* util.c */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.c; name = util.c; path = ../../../plugins/dfcdrom/util.c; sourceTree = SOURCE_ROOT; }; + 71F3C32411F3CD0B007B9F12 /* cdr-macosx.c */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.c; name = "cdr-macosx.c"; path = "macsrc/cdr-macosx.c"; sourceTree = "<group>"; }; + 71F3C32511F3CD0B007B9F12 /* cfg.c */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.c; name = cfg.c; path = macsrc/cfg.c; sourceTree = "<group>"; }; + 71F3C32611F3CD0B007B9F12 /* PluginConfigController.h */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.h; name = PluginConfigController.h; path = macsrc/PluginConfigController.h; sourceTree = "<group>"; }; + 71F3C32711F3CD0B007B9F12 /* PluginConfigController.m */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.objc; name = PluginConfigController.m; path = macsrc/PluginConfigController.m; sourceTree = "<group>"; }; + 71F3C38511F3CFED007B9F12 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; }; + 71F3C38711F3CFF7007B9F12 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; }; + 71F3C47911F3D108007B9F12 /* English */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = English; path = English.lproj/Credits.rtf; sourceTree = "<group>"; }; + 71F3C49C11F3D2B3007B9F12 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/DFCdromPluginConfig.nib; sourceTree = "<group>"; }; + 8D576316048677EA00EA77CD /* DFCdrom.psxplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DFCdrom.psxplugin; sourceTree = BUILT_PRODUCTS_DIR; }; + 8D576317048677EA00EA77CD /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8D576313048677EA00EA77CD /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D576314048677EA00EA77CD /* CoreFoundation.framework in Frameworks */, + 2BD707180555997500CB5D9B /* IOKit.framework in Frameworks */, + 71F3C38611F3CFED007B9F12 /* AppKit.framework in Frameworks */, + 71F3C38811F3CFF7007B9F12 /* Carbon.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 089C166AFE841209C02AAC07 /* CdrDevMac */ = { + isa = PBXGroup; + children = ( + 08FB77AFFE84173DC02AAC07 /* Source Files */, + 089C167CFE841241C02AAC07 /* Resources */, + 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */, + 19C28FB6FE9D52B211CA2CBB /* Products */, + ); + name = CdrDevMac; + sourceTree = "<group>"; + }; + 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */ = { + isa = PBXGroup; + children = ( + 71F3C38511F3CFED007B9F12 /* AppKit.framework */, + 71F3C38711F3CFF7007B9F12 /* Carbon.framework */, + 0AA1909FFE8422F4C02AAC07 /* CoreFoundation.framework */, + 2BD707170555997500CB5D9B /* IOKit.framework */, + ); + name = "External Frameworks and Libraries"; + sourceTree = "<group>"; + }; + 089C167CFE841241C02AAC07 /* Resources */ = { + isa = PBXGroup; + children = ( + 71F3C49B11F3D2B3007B9F12 /* DFCdromPluginConfig.nib */, + 71F3C47811F3D108007B9F12 /* Credits.rtf */, + 8D576317048677EA00EA77CD /* Info.plist */, + 8D5B49A704867FD3000E48DA /* InfoPlist.strings */, + ); + name = Resources; + sourceTree = "<group>"; + }; + 08FB77AFFE84173DC02AAC07 /* Source Files */ = { + isa = PBXGroup; + children = ( + 71F3C32111F3CCEF007B9F12 /* macsrc */, + 71F3C30911F3CC22007B9F12 /* src */, + ); + name = "Source Files"; + sourceTree = "<group>"; + }; + 19C28FB6FE9D52B211CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 8D576316048677EA00EA77CD /* DFCdrom.psxplugin */, + ); + name = Products; + sourceTree = "<group>"; + }; + 71F3C30911F3CC22007B9F12 /* src */ = { + isa = PBXGroup; + children = ( + 713DB2E311F113C30001BDD4 /* cdr.c */, + 713DB2E411F113C30001BDD4 /* cdr.h */, + 713DB2E611F113C30001BDD4 /* util.c */, + ); + name = src; + sourceTree = "<group>"; + }; + 71F3C32111F3CCEF007B9F12 /* macsrc */ = { + isa = PBXGroup; + children = ( + 71F3C32411F3CD0B007B9F12 /* cdr-macosx.c */, + 71F3C32511F3CD0B007B9F12 /* cfg.c */, + 71F3C32611F3CD0B007B9F12 /* PluginConfigController.h */, + 71F3C32711F3CD0B007B9F12 /* PluginConfigController.m */, + ); + name = macsrc; + sourceTree = "<group>"; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 8D57630E048677EA00EA77CD /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 713DB2E911F113C30001BDD4 /* cdr.h in Headers */, + 71F3C32A11F3CD0B007B9F12 /* PluginConfigController.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 8D57630D048677EA00EA77CD /* DFCdrom */ = { + isa = PBXNativeTarget; + buildConfigurationList = 710735990FDEED75004AD098 /* Build configuration list for PBXNativeTarget "DFCdrom" */; + buildPhases = ( + 8D57630E048677EA00EA77CD /* Headers */, + 8D57630F048677EA00EA77CD /* Resources */, + 8D576311048677EA00EA77CD /* Sources */, + 8D576313048677EA00EA77CD /* Frameworks */, + 8D576315048677EA00EA77CD /* Rez */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = DFCdrom; + productInstallPath = "$(HOME)/Library/Bundles"; + productName = CdrDevMac; + productReference = 8D576316048677EA00EA77CD /* DFCdrom.psxplugin */; + productType = "com.apple.product-type.bundle"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 089C1669FE841209C02AAC07 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = 7107359E0FDEED75004AD098 /* Build configuration list for PBXProject "DFCdrom" */; + hasScannedForEncodings = 1; + mainGroup = 089C166AFE841209C02AAC07 /* CdrDevMac */; + projectDirPath = ""; + targets = ( + 8D57630D048677EA00EA77CD /* DFCdrom */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8D57630F048677EA00EA77CD /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D5B49A804867FD3000E48DA /* InfoPlist.strings in Resources */, + 71F3C47A11F3D108007B9F12 /* Credits.rtf in Resources */, + 71F3C49D11F3D2B3007B9F12 /* DFCdromPluginConfig.nib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXRezBuildPhase section */ + 8D576315048677EA00EA77CD /* Rez */ = { + isa = PBXRezBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXRezBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8D576311048677EA00EA77CD /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 713DB2E811F113C30001BDD4 /* cdr.c in Sources */, + 713DB2EB11F113C30001BDD4 /* util.c in Sources */, + 71F3C32811F3CD0B007B9F12 /* cdr-macosx.c in Sources */, + 71F3C32911F3CD0B007B9F12 /* cfg.c in Sources */, + 71F3C32B11F3CD0B007B9F12 /* PluginConfigController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 71F3C47811F3D108007B9F12 /* Credits.rtf */ = { + isa = PBXVariantGroup; + children = ( + 71F3C47911F3D108007B9F12 /* English */, + ); + name = Credits.rtf; + sourceTree = "<group>"; + }; + 71F3C49B11F3D2B3007B9F12 /* DFCdromPluginConfig.nib */ = { + isa = PBXVariantGroup; + children = ( + 71F3C49C11F3D2B3007B9F12 /* English */, + ); + name = DFCdromPluginConfig.nib; + sourceTree = "<group>"; + }; + 8D5B49A704867FD3000E48DA /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 089C167EFE841241C02AAC07 /* English */, + ); + name = InfoPlist.strings; + sourceTree = "<group>"; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 7107359A0FDEED75004AD098 /* Development */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_MODEL_TUNING = ""; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = NO; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; + GCC_WARN_UNKNOWN_PRAGMAS = NO; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(USER_LIBRARY_DIR)/Playstation Emulator Plugins"; + LIBRARY_STYLE = BUNDLE; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + OTHER_REZFLAGS = ""; + PRODUCT_NAME = DFCdrom; + SECTORDER_FLAGS = ""; + SYMROOT = ../../build; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + WRAPPER_EXTENSION = psxplugin; + }; + name = Development; + }; + 7107359B0FDEED75004AD098 /* Deployment */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = YES; + DEBUGGING_SYMBOLS = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_MODEL_TUNING = ""; + GCC_OPTIMIZATION_LEVEL = s; + GCC_PRECOMPILE_PREFIX_HEADER = NO; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; + GCC_WARN_UNKNOWN_PRAGMAS = NO; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(USER_LIBRARY_DIR)/Playstation Emulator Plugins"; + LIBRARY_STYLE = BUNDLE; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + OTHER_REZFLAGS = ""; + PRODUCT_NAME = DFCdrom; + SECTORDER_FLAGS = ""; + SYMROOT = ../../build; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + WRAPPER_EXTENSION = psxplugin; + ZERO_LINK = NO; + }; + name = Deployment; + }; + 7107359F0FDEED75004AD098 /* Development */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_MODEL_TUNING = ""; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = "_MACOSX=1"; + HEADER_SEARCH_PATHS = ( + ../../../libpcsxcore, + ../.., + ../../../plugins/dfcdrom, + ); + STRIP_INSTALLED_PRODUCT = NO; + }; + name = Development; + }; + 710735A00FDEED75004AD098 /* Deployment */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_MODEL_TUNING = ""; + GCC_PREPROCESSOR_DEFINITIONS = "_MACOSX=1"; + HEADER_SEARCH_PATHS = ( + ../../../libpcsxcore, + ../.., + ../../../plugins/dfcdrom, + ); + }; + name = Deployment; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 710735990FDEED75004AD098 /* Build configuration list for PBXNativeTarget "DFCdrom" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7107359A0FDEED75004AD098 /* Development */, + 7107359B0FDEED75004AD098 /* Deployment */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Development; + }; + 7107359E0FDEED75004AD098 /* Build configuration list for PBXProject "DFCdrom" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7107359F0FDEED75004AD098 /* Development */, + 710735A00FDEED75004AD098 /* Deployment */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Development; + }; +/* End XCConfigurationList section */ + }; + rootObject = 089C1669FE841209C02AAC07 /* Project object */; +} diff --git a/macosx/plugins/DFCdrom/English.lproj/Credits.rtf b/macosx/plugins/DFCdrom/English.lproj/Credits.rtf new file mode 100644 index 0000000..76fa644 --- /dev/null +++ b/macosx/plugins/DFCdrom/English.lproj/Credits.rtf @@ -0,0 +1,13 @@ +{\rtf1\mac\ansicpg10025\cocoartf824\cocoasubrtf420 +{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs24 \cf0 Original coder: +\f1\b0 \ + linuzappz\ +\ + +\f0\b Macintosh Port: +\f1\b0 \ + Wei Mingzhi}
\ No newline at end of file diff --git a/macosx/plugins/DFCdrom/English.lproj/DFCdromPluginConfig.nib/classes.nib b/macosx/plugins/DFCdrom/English.lproj/DFCdromPluginConfig.nib/classes.nib new file mode 100644 index 0000000..b1e8f6c --- /dev/null +++ b/macosx/plugins/DFCdrom/English.lproj/DFCdromPluginConfig.nib/classes.nib @@ -0,0 +1,18 @@ +{ + IBClasses = ( + { + ACTIONS = {cancel = id; ok = id; }; + CLASS = DFCdromPluginConfigController; + LANGUAGE = ObjC; + OUTLETS = {CacheSize = NSSlider; Cached = NSControl; CdSpeed = NSPopUpButton; }; + SUPERCLASS = NSWindowController; + }, + { + ACTIONS = {"" = id; }; + CLASS = FirstResponder; + LANGUAGE = ObjC; + SUPERCLASS = NSObject; + } + ); + IBVersion = 1; +}
\ No newline at end of file diff --git a/macosx/plugins/DFCdrom/English.lproj/DFCdromPluginConfig.nib/info.nib b/macosx/plugins/DFCdrom/English.lproj/DFCdromPluginConfig.nib/info.nib new file mode 100644 index 0000000..f90f50b --- /dev/null +++ b/macosx/plugins/DFCdrom/English.lproj/DFCdromPluginConfig.nib/info.nib @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>IBDocumentLocation</key> + <string>117 49 561 249 0 0 1024 746 </string> + <key>IBFramework Version</key> + <string>446.1</string> + <key>IBOpenObjects</key> + <array> + <integer>5</integer> + </array> + <key>IBSystem Version</key> + <string>8P2137</string> +</dict> +</plist> diff --git a/macosx/plugins/DFCdrom/English.lproj/DFCdromPluginConfig.nib/keyedobjects.nib b/macosx/plugins/DFCdrom/English.lproj/DFCdromPluginConfig.nib/keyedobjects.nib Binary files differnew file mode 100644 index 0000000..64a5021 --- /dev/null +++ b/macosx/plugins/DFCdrom/English.lproj/DFCdromPluginConfig.nib/keyedobjects.nib diff --git a/macosx/plugins/DFCdrom/English.lproj/InfoPlist.strings b/macosx/plugins/DFCdrom/English.lproj/InfoPlist.strings Binary files differnew file mode 100755 index 0000000..ea885a5 --- /dev/null +++ b/macosx/plugins/DFCdrom/English.lproj/InfoPlist.strings diff --git a/macosx/plugins/DFCdrom/Info.plist b/macosx/plugins/DFCdrom/Info.plist new file mode 100644 index 0000000..ee25402 --- /dev/null +++ b/macosx/plugins/DFCdrom/Info.plist @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//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>CFBundleExecutable</key> + <string>DFCdrom</string> + <key>CFBundleIconFile</key> + <string></string> + <key>CFBundleIdentifier</key> + <string>net.pcsx.DFCdrom</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundlePackageType</key> + <string>PsxP</string> + <key>CFBundleSignature</key> + <string>CdDI</string> + <key>CFBundleVersion</key> + <string>1.0</string> +</dict> +</plist> diff --git a/macosx/plugins/DFCdrom/macsrc/PluginConfigController.h b/macosx/plugins/DFCdrom/macsrc/PluginConfigController.h new file mode 100644 index 0000000..b7f6faf --- /dev/null +++ b/macosx/plugins/DFCdrom/macsrc/PluginConfigController.h @@ -0,0 +1,18 @@ +#define PluginConfigController DFCdromPluginConfigController + +#import <Cocoa/Cocoa.h> + +@interface PluginConfigController : NSWindowController +{ + IBOutlet NSControl *Cached; + IBOutlet NSSlider *CacheSize; + IBOutlet NSPopUpButton *CdSpeed; + + NSMutableDictionary *keyValues; +} +- (IBAction)cancel:(id)sender; +- (IBAction)ok:(id)sender; + +- (void)loadValues; + +@end diff --git a/macosx/plugins/DFCdrom/macsrc/PluginConfigController.m b/macosx/plugins/DFCdrom/macsrc/PluginConfigController.m new file mode 100644 index 0000000..02b3a76 --- /dev/null +++ b/macosx/plugins/DFCdrom/macsrc/PluginConfigController.m @@ -0,0 +1,158 @@ +/* + * Copyright (c) 2010, Wei Mingzhi <whistler@openoffice.org>. + * All Rights Reserved. + * + * Based on: Cdrom for Psemu Pro like Emulators + * By: linuzappz <linuzappz@hotmail.com> + * + * This program 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 program 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 this program; if not, see <http://www.gnu.org/licenses>. + */ + +#import "PluginConfigController.h" +#include "cdr.h" + +#define APP_ID @"net.pcsx.DFCdrom" +#define PrefsKey APP_ID @" Settings" + +static PluginConfigController *windowController; + +void AboutDlgProc() +{ + // Get parent application instance + NSApplication *app = [NSApplication sharedApplication]; + NSBundle *bundle = [NSBundle bundleWithIdentifier:APP_ID]; + + // Get Credits.rtf + NSString *path = [bundle pathForResource:@"Credits" ofType:@"rtf"]; + NSAttributedString *credits; + if (path) { + credits = [[[NSAttributedString alloc] initWithPath: path + documentAttributes:NULL] autorelease]; + } else { + credits = [[[NSAttributedString alloc] initWithString:@""] autorelease]; + } + + // Get Application Icon + NSImage *icon = [[NSWorkspace sharedWorkspace] iconForFile:[bundle bundlePath]]; + NSSize size = NSMakeSize(64, 64); + [icon setSize:size]; + + [app orderFrontStandardAboutPanelWithOptions:[NSDictionary dictionaryWithObjectsAndKeys: + [bundle objectForInfoDictionaryKey:@"CFBundleName"], @"ApplicationName", + icon, @"ApplicationIcon", + [bundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"], @"ApplicationVersion", + [bundle objectForInfoDictionaryKey:@"CFBundleVersion"], @"Version", + [bundle objectForInfoDictionaryKey:@"NSHumanReadableCopyright"], @"Copyright", + credits, @"Credits", + nil]]; +} + +void ConfDlgProc() +{ + NSWindow *window; + + if (windowController == nil) { + windowController = [[PluginConfigController alloc] initWithWindowNibName:@"DFCdromPluginConfig"]; + } + window = [windowController window]; + + [windowController loadValues]; + + [window center]; + [window makeKeyAndOrderFront:nil]; +} + +void ReadConfig() +{ + NSDictionary *keyValues; + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + [defaults registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys: + [[NSMutableDictionary alloc] initWithObjectsAndKeys: + [NSNumber numberWithBool:YES], @"Threaded", + [NSNumber numberWithInt:64], @"Cache Size", + [NSNumber numberWithInt:0], @"Speed", + nil], PrefsKey, nil]]; + + keyValues = [defaults dictionaryForKey:PrefsKey]; + + ReadMode = ([[keyValues objectForKey:@"Threaded"] boolValue] ? THREADED : NORMAL); + CacheSize = [[keyValues objectForKey:@"Cache Size"] intValue]; + CdrSpeed = [[keyValues objectForKey:@"Speed"] intValue]; +} + +@implementation PluginConfigController + +- (IBAction)cancel:(id)sender +{ + [self close]; +} + +- (IBAction)ok:(id)sender +{ + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + + NSMutableDictionary *writeDic = [NSMutableDictionary dictionaryWithDictionary:keyValues]; + + [writeDic setObject:[NSNumber numberWithInt:[Cached intValue]] forKey:@"Threaded"]; + [writeDic setObject:[NSNumber numberWithInt:[CacheSize intValue]] forKey:@"Cache Size"]; + + switch ([CdSpeed indexOfSelectedItem]) { + case 1: [writeDic setObject:[NSNumber numberWithInt:1] forKey:@"Speed"]; break; + case 2: [writeDic setObject:[NSNumber numberWithInt:2] forKey:@"Speed"]; break; + case 3: [writeDic setObject:[NSNumber numberWithInt:4] forKey:@"Speed"]; break; + case 4: [writeDic setObject:[NSNumber numberWithInt:8] forKey:@"Speed"]; break; + case 5: [writeDic setObject:[NSNumber numberWithInt:16] forKey:@"Speed"]; break; + case 6: [writeDic setObject:[NSNumber numberWithInt:32] forKey:@"Speed"]; break; + default: [writeDic setObject:[NSNumber numberWithInt:0] forKey:@"Speed"]; break; + } + + // write to defaults + [defaults setObject:writeDic forKey:PrefsKey]; + [defaults synchronize]; + + // and set global values accordingly + ReadConfig(); + + [self close]; +} + +- (void)loadValues +{ + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + + ReadConfig(); + + // load from preferences + [keyValues release]; + keyValues = [[defaults dictionaryForKey:PrefsKey] retain]; + + [Cached setIntValue:[[keyValues objectForKey:@"Threaded"] intValue]]; + [CacheSize setIntValue:[[keyValues objectForKey:@"Cache Size"] intValue]]; + + switch ([[keyValues objectForKey:@"Speed"] intValue]) { + case 1: [CdSpeed selectItemAtIndex:1]; break; + case 2: [CdSpeed selectItemAtIndex:2]; break; + case 4: [CdSpeed selectItemAtIndex:3]; break; + case 8: [CdSpeed selectItemAtIndex:4]; break; + case 16: [CdSpeed selectItemAtIndex:5]; break; + case 32: [CdSpeed selectItemAtIndex:6]; break; + default: [CdSpeed selectItemAtIndex:0]; break; + } +} + +- (void)awakeFromNib +{ +} + +@end diff --git a/macosx/plugins/DFCdrom/macsrc/cdr-macosx.c b/macosx/plugins/DFCdrom/macsrc/cdr-macosx.c new file mode 100644 index 0000000..806b659 --- /dev/null +++ b/macosx/plugins/DFCdrom/macsrc/cdr-macosx.c @@ -0,0 +1,250 @@ +/* + * Copyright (c) 2010, Wei Mingzhi <whistler@openoffice.org>. + * All Rights Reserved. + * + * Based on: Cdrom for Psemu Pro like Emulators + * By: linuzappz <linuzappz@hotmail.com> + * + * This program 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 program 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 this program; if not, see <http://www.gnu.org/licenses>. + */ + +#include "cdr.h" + +#ifdef _MACOSX + +#include <IOKit/IOKitLib.h> +#include <IOKit/IOBSD.h> +#include <IOKit/storage/IOCDMedia.h> +#include <IOKit/storage/IODVDMedia.h> +#include <IOKit/storage/IOMedia.h> +#include <IOKit/storage/IOCDMediaBSDClient.h> +#include <CoreFoundation/CoreFoundation.h> + +int cdHandle = -1; +char cdDevice[4096] = ""; + +static int IsPsxDisc(const char *dev) { + int fd; + char buf[CD_FRAMESIZE_RAW]; + dk_cd_read_t r; + + fd = open(dev, O_RDONLY, 0); + if (fd < 0) return 0; + + memset(&r, 0, sizeof(r)); + + r.offset = msf_to_lba(0, 2, 4) * CD_FRAMESIZE_RAW; + r.sectorArea = 0xF8; + r.sectorType = kCDSectorTypeUnknown; + r.bufferLength = CD_FRAMESIZE_RAW; + r.buffer = buf; + + if (ioctl(fd, DKIOCCDREAD, &r) != kIOReturnSuccess) { + close(fd); + return 0; + } + + close(fd); + + if (strncmp(buf + 56, "Sony Computer Entertainment", 27) == 0) { + return 1; + } + + return 0; +} + +static void FindCdDevice(char *dev) { + io_object_t next_media; + kern_return_t kern_result; + io_iterator_t media_iterator; + CFMutableDictionaryRef classes_to_match; + const char *name, *cd = kIOCDMediaClass, *dvd = kIODVDMediaClass; + + dev[0] = '\0'; + name = cd; + +start: + classes_to_match = IOServiceMatching(name); + if (classes_to_match == NULL) goto end; + + CFDictionarySetValue(classes_to_match, CFSTR(kIOMediaEjectableKey), + kCFBooleanTrue); + + kern_result = IOServiceGetMatchingServices(kIOMasterPortDefault, + classes_to_match, &media_iterator); + + if (kern_result != KERN_SUCCESS) goto end; + + next_media = IOIteratorNext(media_iterator); + if (next_media != 0) { + char psz_buf[0x32]; + size_t dev_path_length; + CFTypeRef str_bsd_path; + + do { + str_bsd_path = IORegistryEntryCreateCFProperty(next_media, + CFSTR(kIOBSDNameKey), kCFAllocatorDefault, 0); + + if (str_bsd_path == NULL) { + IOObjectRelease(next_media); + continue; + } + + strcpy(psz_buf, "/dev/r"); + dev_path_length = strlen(psz_buf); + + if (CFStringGetCString(str_bsd_path, (char *)&psz_buf + dev_path_length, + sizeof(psz_buf) - dev_path_length, kCFStringEncodingASCII)) + { + strcpy(dev, psz_buf); + + if (IsPsxDisc(dev)) { + CFRelease(str_bsd_path); + IOObjectRelease(next_media); + IOObjectRelease(media_iterator); + return; + } + } + + CFRelease(str_bsd_path); + IOObjectRelease(next_media); + } while ((next_media = IOIteratorNext(media_iterator)) != 0); + } + + IOObjectRelease(media_iterator); + +end: + if (dev[0] == '\0') { + if (name == cd) { + name = dvd; // Is this really necessary or correct? Dunno... + goto start; + } + } +} + +int OpenCdHandle(const char *dev) { + if (dev != NULL && dev[0] != '\0') strcpy(cdDevice, dev); + else if (cdDevice[0] == '\0') FindCdDevice(cdDevice); + + cdHandle = open(cdDevice, O_RDONLY, 0); + if (cdHandle < 0) return -1; + + if (CdrSpeed > 0) { + u_int16_t speed = kCDSpeedMin * CdrSpeed; + ioctl(cdHandle, DKIOCCDSETSPEED, &speed); + } + + return 0; +} + +void CloseCdHandle() { + if (cdHandle != -1) close(cdHandle); + cdHandle = -1; +} + +int IsCdHandleOpen() { + return 1; +} + +long GetTN(unsigned char *buffer) { + if (cdHandle < 0) return -1; + + // TODO + buffer[0] = 1; + buffer[1] = 1; + + return 0; +} + +long GetTD(unsigned char track, unsigned char *buffer) { + if (cdHandle < 0) return -1; + + // TODO + memset(buffer + 1, 0, 3); + return 0; +} + +long GetTE(unsigned char track, unsigned char *m, unsigned char *s, unsigned char *f) { + return -1; // TODO +} + +long ReadSector(crdata *cr) { + int lba; + dk_cd_read_t r; + + if (cdHandle < 0) return -1; + + lba = msf_to_lba(cr->msf.cdmsf_min0, cr->msf.cdmsf_sec0, cr->msf.cdmsf_frame0); + + memset(&r, 0, sizeof(r)); + + r.offset = lba * CD_FRAMESIZE_RAW; + r.sectorArea = 0xF8; + r.sectorType = kCDSectorTypeUnknown; + r.bufferLength = CD_FRAMESIZE_RAW; + r.buffer = cr->buf; + + if (ioctl(cdHandle, DKIOCCDREAD, &r) != kIOReturnSuccess) { + return -1; + } + + return 0; +} + +long PlayCDDA(unsigned char *sector) { + return 0; // TODO +} + +long StopCDDA() { + return 0; // TODO +} + +long GetStatus(int playing, struct CdrStat *stat) { + memset(stat, 0, sizeof(struct CdrStat)); + stat->Type = 0x01; + + // Close and reopen the CD handle. If opening failed, + // then there is no CD in drive. + // Note that this WILL be screwed if user inserted another + // removable device such as USB stick when tray is open. + // There may be a better way, but this should do the job. + if (cdHandle >= 0) { + close(cdHandle); + cdHandle = -1; + } + + cdHandle = open(cdDevice, O_RDONLY, 0); + if (cdHandle < 0) { + // No CD in drive + stat->Type = 0xff; + stat->Status |= 0x10; + } else { + if (CdrSpeed > 0) { + u_int16_t speed = kCDSpeedMin * CdrSpeed; + ioctl(cdHandle, DKIOCCDSETSPEED, &speed); + } + } + + return 0; +} + +unsigned char *ReadSub(const unsigned char *time) { + return NULL; // TODO +} + +char *CDRgetDriveLetter(void) { + return cdDevice; +} + +#endif diff --git a/macosx/plugins/DFCdrom/macsrc/cfg.c b/macosx/plugins/DFCdrom/macsrc/cfg.c new file mode 100644 index 0000000..6b5c151 --- /dev/null +++ b/macosx/plugins/DFCdrom/macsrc/cfg.c @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2010, Wei Mingzhi <whistler@openoffice.org>. + * All Rights Reserved. + * + * Based on: Cdrom for Psemu Pro like Emulators + * By: linuzappz <linuzappz@hotmail.com> + * + * This program 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 program 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 this program; if not, see <http://www.gnu.org/licenses>. + */ + +#include "cdr.h" + +void AboutDlgProc(); +void ConfDlgProc(); +void ReadConfig(); + +char CdromDev[256]; +long ReadMode; +long UseSubQ; +long CacheSize; +long CdrSpeed; +long SpinDown; + +void LoadConf() { + strcpy(CdromDev, ""); + ReadMode = THREADED; + UseSubQ = 0; + CacheSize = 64; + CdrSpeed = 0; + SpinDown = SPINDOWN_VENDOR_SPECIFIC; + + ReadConfig(); +} + +long CDRconfigure() { + ConfDlgProc(); + return 0; +} + +void CDRabout() { + AboutDlgProc(); +}
\ No newline at end of file diff --git a/macosx/plugins/DFCdrom/version.plist b/macosx/plugins/DFCdrom/version.plist new file mode 100644 index 0000000..a9c51a6 --- /dev/null +++ b/macosx/plugins/DFCdrom/version.plist @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>BuildVersion</key> + <string>38</string> + <key>CFBundleShortVersionString</key> + <string>1.0</string> + <key>CFBundleVersion</key> + <string>1.0</string> + <key>ProjectName</key> + <string>DFCdrom</string> + <key>SourceVersion</key> + <string>2350000</string> +</dict> +</plist> |