From e8799fe621a86267ea50ae45ec03b5fb05c66905 Mon Sep 17 00:00:00 2001 From: "SND\\MaddTheSane_cp" Date: Thu, 4 Jul 2013 19:16:29 +0000 Subject: Copy over DFCdrom to bladesio1 on OS X. to begin the process for the OS X plug-in. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@85814 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- macosx/plugins/Bladesio1/ARCBridge.h | 36 + .../Bladesio1/DFCdrom.xcodeproj/project.pbxproj | 409 +++++++++++ macosx/plugins/Bladesio1/English.lproj/Credits.rtf | 13 + .../English.lproj/DFCdromPluginConfig.xib | 785 +++++++++++++++++++++ .../Bladesio1/English.lproj/InfoPlist.strings | Bin 0 -> 486 bytes .../Bladesio1/English.lproj/Localizable.strings | 9 + macosx/plugins/Bladesio1/Info.plist | 24 + .../Bladesio1/macsrc/PluginConfigController.h | 18 + .../Bladesio1/macsrc/PluginConfigController.m | 171 +++++ macosx/plugins/Bladesio1/macsrc/cdr-macosx.c | 252 +++++++ macosx/plugins/Bladesio1/macsrc/cfg.c | 53 ++ macosx/plugins/Bladesio1/version.plist | 16 + 12 files changed, 1786 insertions(+) create mode 100644 macosx/plugins/Bladesio1/ARCBridge.h create mode 100644 macosx/plugins/Bladesio1/DFCdrom.xcodeproj/project.pbxproj create mode 100644 macosx/plugins/Bladesio1/English.lproj/Credits.rtf create mode 100644 macosx/plugins/Bladesio1/English.lproj/DFCdromPluginConfig.xib create mode 100755 macosx/plugins/Bladesio1/English.lproj/InfoPlist.strings create mode 100644 macosx/plugins/Bladesio1/English.lproj/Localizable.strings create mode 100644 macosx/plugins/Bladesio1/Info.plist create mode 100755 macosx/plugins/Bladesio1/macsrc/PluginConfigController.h create mode 100755 macosx/plugins/Bladesio1/macsrc/PluginConfigController.m create mode 100755 macosx/plugins/Bladesio1/macsrc/cdr-macosx.c create mode 100755 macosx/plugins/Bladesio1/macsrc/cfg.c create mode 100644 macosx/plugins/Bladesio1/version.plist (limited to 'macosx/plugins') diff --git a/macosx/plugins/Bladesio1/ARCBridge.h b/macosx/plugins/Bladesio1/ARCBridge.h new file mode 100644 index 00000000..ea274b84 --- /dev/null +++ b/macosx/plugins/Bladesio1/ARCBridge.h @@ -0,0 +1,36 @@ +// +// ARCBridge.h +// PPMacho +// +// Created by C.W. Betts on 12/23/12. +// +// + +#ifndef PPMacho_ARCBridge_h +#define PPMacho_ARCBridge_h + +#if __has_feature(objc_arc) + +#define SUPERDEALLOC +#define RELEASEOBJ(obj) +#define RETAINOBJ(obj) obj +#define RETAINOBJNORETURN(obj) +#define AUTORELEASEOBJ(obj) obj +#define AUTORELEASEOBJNORETURN(obj) +#define BRIDGE(toType, obj) (__bridge toType)(obj) +#define __arcweak __weak + +#else + +#define SUPERDEALLOC [super dealloc] +#define RELEASEOBJ(obj) [obj release] +#define RETAINOBJ(obj) [obj retain] +#define RETAINOBJNORETURN(obj) [obj retain] +#define AUTORELEASEOBJ(obj) [obj autorelease] +#define AUTORELEASEOBJNORETURN(obj) [obj autorelease] +#define BRIDGE(toType, obj) (toType)obj +#define __arcweak + +#endif + +#endif diff --git a/macosx/plugins/Bladesio1/DFCdrom.xcodeproj/project.pbxproj b/macosx/plugins/Bladesio1/DFCdrom.xcodeproj/project.pbxproj new file mode 100644 index 00000000..8a48676b --- /dev/null +++ b/macosx/plugins/Bladesio1/DFCdrom.xcodeproj/project.pbxproj @@ -0,0 +1,409 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 28586CC614651E870082B8EC /* DFCdromPluginConfig.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28586CC414651E870082B8EC /* DFCdromPluginConfig.xib */; }; + 2BD707180555997500CB5D9B /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2BD707170555997500CB5D9B /* IOKit.framework */; }; + 552E4CBA1474737A00FB231F /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 552E4CBC1474737A00FB231F /* Localizable.strings */; }; + 5586006E1785137C00CB3D85 /* ARCBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 5586006D1785137C00CB3D85 /* ARCBridge.h */; }; + 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 */; }; + 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 = ""; }; + 0AA1909FFE8422F4C02AAC07 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = ""; }; + 28586CC514651E870082B8EC /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/DFCdromPluginConfig.xib; sourceTree = ""; }; + 2BD707170555997500CB5D9B /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; }; + 552E4CBB1474737A00FB231F /* English */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/Localizable.strings; sourceTree = ""; }; + 5586006D1785137C00CB3D85 /* ARCBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARCBridge.h; sourceTree = ""; }; + 713DB2E311F113C30001BDD4 /* cdr.c */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = cdr.c; path = ../../../plugins/dfcdrom/cdr.c; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.c; }; + 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; lineEnding = 0; name = util.c; path = ../../../plugins/dfcdrom/util.c; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.c; }; + 71F3C32411F3CD0B007B9F12 /* cdr-macosx.c */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.c; lineEnding = 0; name = "cdr-macosx.c"; path = "macsrc/cdr-macosx.c"; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.c; }; + 71F3C32511F3CD0B007B9F12 /* cfg.c */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.c; name = cfg.c; path = macsrc/cfg.c; sourceTree = ""; }; + 71F3C32611F3CD0B007B9F12 /* PluginConfigController.h */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.h; name = PluginConfigController.h; path = macsrc/PluginConfigController.h; sourceTree = ""; }; + 71F3C32711F3CD0B007B9F12 /* PluginConfigController.m */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.objc; name = PluginConfigController.m; path = macsrc/PluginConfigController.m; sourceTree = ""; }; + 71F3C38511F3CFED007B9F12 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; + 71F3C38711F3CFF7007B9F12 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; + 71F3C47911F3D108007B9F12 /* English */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = English; path = English.lproj/Credits.rtf; sourceTree = ""; }; + 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 = ""; }; +/* 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 = ""; + }; + 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 = ""; + }; + 089C167CFE841241C02AAC07 /* Resources */ = { + isa = PBXGroup; + children = ( + 28586CC414651E870082B8EC /* DFCdromPluginConfig.xib */, + 71F3C47811F3D108007B9F12 /* Credits.rtf */, + 8D576317048677EA00EA77CD /* Info.plist */, + 8D5B49A704867FD3000E48DA /* InfoPlist.strings */, + 552E4CBC1474737A00FB231F /* Localizable.strings */, + ); + name = Resources; + sourceTree = ""; + }; + 08FB77AFFE84173DC02AAC07 /* Source Files */ = { + isa = PBXGroup; + children = ( + 71F3C32111F3CCEF007B9F12 /* macsrc */, + 71F3C30911F3CC22007B9F12 /* src */, + ); + name = "Source Files"; + sourceTree = ""; + }; + 19C28FB6FE9D52B211CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 8D576316048677EA00EA77CD /* DFCdrom.psxplugin */, + ); + name = Products; + sourceTree = ""; + }; + 71F3C30911F3CC22007B9F12 /* src */ = { + isa = PBXGroup; + children = ( + 713DB2E311F113C30001BDD4 /* cdr.c */, + 713DB2E411F113C30001BDD4 /* cdr.h */, + 713DB2E611F113C30001BDD4 /* util.c */, + ); + name = src; + sourceTree = ""; + }; + 71F3C32111F3CCEF007B9F12 /* macsrc */ = { + isa = PBXGroup; + children = ( + 5586006D1785137C00CB3D85 /* ARCBridge.h */, + 71F3C32411F3CD0B007B9F12 /* cdr-macosx.c */, + 71F3C32511F3CD0B007B9F12 /* cfg.c */, + 71F3C32611F3CD0B007B9F12 /* PluginConfigController.h */, + 71F3C32711F3CD0B007B9F12 /* PluginConfigController.m */, + ); + name = macsrc; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 8D57630E048677EA00EA77CD /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 713DB2E911F113C30001BDD4 /* cdr.h in Headers */, + 71F3C32A11F3CD0B007B9F12 /* PluginConfigController.h in Headers */, + 5586006E1785137C00CB3D85 /* ARCBridge.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; + attributes = { + LastUpgradeCheck = 0460; + }; + buildConfigurationList = 7107359E0FDEED75004AD098 /* Build configuration list for PBXProject "DFCdrom" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + ); + mainGroup = 089C166AFE841209C02AAC07 /* CdrDevMac */; + projectDirPath = ""; + projectRoot = ""; + 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 */, + 28586CC614651E870082B8EC /* DFCdromPluginConfig.xib in Resources */, + 552E4CBA1474737A00FB231F /* Localizable.strings 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 */ + 28586CC414651E870082B8EC /* DFCdromPluginConfig.xib */ = { + isa = PBXVariantGroup; + children = ( + 28586CC514651E870082B8EC /* English */, + ); + name = DFCdromPluginConfig.xib; + sourceTree = ""; + }; + 552E4CBC1474737A00FB231F /* Localizable.strings */ = { + isa = PBXVariantGroup; + children = ( + 552E4CBB1474737A00FB231F /* English */, + ); + name = Localizable.strings; + sourceTree = ""; + }; + 71F3C47811F3D108007B9F12 /* Credits.rtf */ = { + isa = PBXVariantGroup; + children = ( + 71F3C47911F3D108007B9F12 /* English */, + ); + name = Credits.rtf; + sourceTree = ""; + }; + 8D5B49A704867FD3000E48DA /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 089C167EFE841241C02AAC07 /* English */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 7107359A0FDEED75004AD098 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + "CLANG_ENABLE_OBJC_ARC[arch=x86_64]" = YES; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "PCSXRPLUG=DFCdrom", + "$(inherited)", + ); + GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; + GCC_WARN_UNKNOWN_PRAGMAS = NO; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(USER_LIBRARY_DIR)/Playstation Emulator Plugins"; + OTHER_LDFLAGS = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + SECTORDER_FLAGS = ""; + WRAPPER_EXTENSION = psxplugin; + }; + name = Debug; + }; + 7107359B0FDEED75004AD098 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + "CLANG_ENABLE_OBJC_ARC[arch=x86_64]" = YES; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = YES; + GCC_DYNAMIC_NO_PIC = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_OPTIMIZATION_LEVEL = s; + GCC_PREPROCESSOR_DEFINITIONS = ( + "PCSXRPLUG=DFCdrom", + "$(inherited)", + ); + GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; + GCC_WARN_UNKNOWN_PRAGMAS = NO; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(USER_LIBRARY_DIR)/Playstation Emulator Plugins"; + OTHER_LDFLAGS = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + SECTORDER_FLAGS = ""; + WRAPPER_EXTENSION = psxplugin; + }; + name = Release; + }; + 7107359F0FDEED75004AD098 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_PREPROCESSOR_DEFINITIONS = "DEBUG=1"; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "_MACOSX=1", + "$(DEBUG_PREPROCESSOR_DEFINITIONS)", + ); + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + ../../../libpcsxcore, + ../.., + ../../../plugins/dfcdrom, + ); + MACOSX_DEPLOYMENT_TARGET = 10.6; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + STRIP_INSTALLED_PRODUCT = NO; + VALID_ARCHS = "i386 x86_64"; + }; + name = Debug; + }; + 710735A00FDEED75004AD098 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_PREPROCESSOR_DEFINITIONS = ""; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_PREPROCESSOR_DEFINITIONS = ( + "_MACOSX=1", + "$(DEBUG_PREPROCESSOR_DEFINITIONS)", + ); + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + ../../../libpcsxcore, + ../.., + ../../../plugins/dfcdrom, + ); + MACOSX_DEPLOYMENT_TARGET = 10.6; + SDKROOT = macosx; + VALID_ARCHS = "i386 x86_64"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 710735990FDEED75004AD098 /* Build configuration list for PBXNativeTarget "DFCdrom" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7107359A0FDEED75004AD098 /* Debug */, + 7107359B0FDEED75004AD098 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 7107359E0FDEED75004AD098 /* Build configuration list for PBXProject "DFCdrom" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7107359F0FDEED75004AD098 /* Debug */, + 710735A00FDEED75004AD098 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 089C1669FE841209C02AAC07 /* Project object */; +} diff --git a/macosx/plugins/Bladesio1/English.lproj/Credits.rtf b/macosx/plugins/Bladesio1/English.lproj/Credits.rtf new file mode 100644 index 00000000..76fa6442 --- /dev/null +++ b/macosx/plugins/Bladesio1/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/Bladesio1/English.lproj/DFCdromPluginConfig.xib b/macosx/plugins/Bladesio1/English.lproj/DFCdromPluginConfig.xib new file mode 100644 index 00000000..43710512 --- /dev/null +++ b/macosx/plugins/Bladesio1/English.lproj/DFCdromPluginConfig.xib @@ -0,0 +1,785 @@ + + + + 1060 + 11C74 + 1938 + 1138.23 + 567.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 1938 + + + NSPopUpButton + NSButton + NSMenu + NSTextFieldCell + NSButtonCell + NSMenuItem + NSBox + NSSlider + NSSliderCell + NSCustomObject + NSView + NSWindowTemplate + NSTextField + NSPopUpButtonCell + + + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + + DFCdromPluginConfigController + + + FirstResponder + + + NSApplication + + + 1 + 2 + {{131, 362}, {377, 238}} + 1886912512 + CDR Configuration + NSWindow + + View + + + {283.34100000000001, 107} + + + 256 + + + + 256 + {{119, 9}, {122, 32}} + + + YES + + 67239424 + 134217728 + Cancel + + LucidaGrande + 13 + 1044 + + + -2038284033 + 1 + + + Gw + 200 + 25 + + + + + 256 + {{241, 9}, {122, 32}} + + + YES + + 67239424 + 134217728 + OK + + + -2038284033 + 1 + + + DQ + 200 + 25 + + + + + 256 + + + + 274 + + + + 256 + {{13, 43}, {114, 17}} + + + YES + + 67239424 + 272629760 + Q0QtUk9NIFNwZWVkOgo + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + + 256 + {{26, 13}, {151, 18}} + + + YES + + 67239424 + 0 + Use Cached Reading + + + 1211912703 + 2 + + NSImage + NSSwitch + + + NSSwitch + + + + 200 + 25 + + + + + 256 + {{129, 38}, {197, 26}} + + + YES + + -2076049856 + 2048 + + + 109199615 + 1 + + LucidaGrande + 13 + 16 + + + + + + 400 + 75 + + + Default + + 1048576 + 2147483647 + 1 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + _popUpItemAction: + + + YES + + + OtherViews + + + + + + 1 X + + 1048576 + 2147483647 + + + _popUpItemAction: + 1 + + + + + 2 X + + 1048576 + 2147483647 + + + _popUpItemAction: + 2 + + + + + 4 X + + 1048576 + 2147483647 + + + _popUpItemAction: + 4 + + + + + 8 X + + 1048576 + 2147483647 + + + _popUpItemAction: + 8 + + + + + 16 X + + 1048576 + 2147483647 + + + _popUpItemAction: + 16 + + + + + 32 X + + 1048576 + 2147483647 + + + _popUpItemAction: + 32 + + + + + -1 + 3 + YES + YES + 1 + + + + {{2, 2}, {339, 73}} + + + + + {{17, 128}, {343, 90}} + + + {0, 0} + + 67239424 + 0 + General Settings + + LucidaGrande + 11 + 3100 + + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 3 + MCAwLjgwMDAwMDAxAA + + + + 3 + 0 + 2 + NO + + + + 256 + + + + 274 + + + + 256 + {{13, 19}, {114, 17}} + + + YES + + 67239424 + 272629760 + Q2FjaGUgU2l6ZToKA + + + + + + + + + 256 + {{130, 15}, {195, 25}} + + + YES + + 67239424 + 0 + + + + + Helvetica + 12 + 16 + + + 512 + 32 + 64 + 0.0 + 16 + 0 + YES + NO + + + + {{2, 2}, {339, 51}} + + + + + {{17, 49}, {343, 68}} + + + {0, 0} + + 67239424 + 0 + Misc + + + + 3 + MCAwLjgwMDAwMDAxAA + + + + 3 + 0 + 2 + NO + + + {377, 238} + + + + {{0, 0}, {1024, 746}} + {283.34100000000001, 129} + {10000000000000, 10000000000000} + YES + + + + + + + ok: + + + + 133 + + + + cancel: + + + + 134 + + + + window + + + + 141 + + + + Cached + + + + 183 + + + + CdSpeed + + + + 182 + + + + CacheSize + + + + 184 + + + + delegate + + + + 158 + + + + nextKeyView + + + + 9 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + 5 + + + + + + Window + + + 6 + + + + + + + + + + + 7 + + + + + + + + 8 + + + + + + + + 162 + + + + + + + + + + 164 + + + + + + + + + 186 + + + + + 187 + + + + + -3 + + + Application + + + 168 + + + + + + + + 188 + + + + + 169 + + + + + + + + 189 + + + + + 173 + + + + + + + + 190 + + + + + + + + 174 + + + + + + + + + + + + + + 175 + + + + + 176 + + + + + 177 + + + + + 178 + + + + + 179 + + + + + 180 + + + + + 181 + + + + + 171 + + + + + + + + 191 + + + + + 172 + + + + + + + + 192 + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + 192 + + + + + DFCdromPluginConfigController + NSWindowController + + IBProjectSource + ./Classes/DFCdromPluginConfigController.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + YES + 3 + + {9, 8} + {7, 2} + {15, 15} + + + diff --git a/macosx/plugins/Bladesio1/English.lproj/InfoPlist.strings b/macosx/plugins/Bladesio1/English.lproj/InfoPlist.strings new file mode 100755 index 00000000..ea885a5d Binary files /dev/null and b/macosx/plugins/Bladesio1/English.lproj/InfoPlist.strings differ diff --git a/macosx/plugins/Bladesio1/English.lproj/Localizable.strings b/macosx/plugins/Bladesio1/English.lproj/Localizable.strings new file mode 100644 index 00000000..2faf6e07 --- /dev/null +++ b/macosx/plugins/Bladesio1/English.lproj/Localizable.strings @@ -0,0 +1,9 @@ +/* + Localizable.strings + DFCdrom + + Created by C.W. Betts on 11/16/11. + Copyright 2011 __MyCompanyName__. All rights reserved. + */ + +"CD-ROM Drive Reader" = "CD-ROM Drive Reader"; diff --git a/macosx/plugins/Bladesio1/Info.plist b/macosx/plugins/Bladesio1/Info.plist new file mode 100644 index 00000000..34e2144e --- /dev/null +++ b/macosx/plugins/Bladesio1/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + net.pcsxr.DFCdrom + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + PsxP + CFBundleSignature + CdDI + CFBundleVersion + 1.0 + NSPrincipalClass + DFCdromPluginConfigController + + diff --git a/macosx/plugins/Bladesio1/macsrc/PluginConfigController.h b/macosx/plugins/Bladesio1/macsrc/PluginConfigController.h new file mode 100755 index 00000000..b7f6fafb --- /dev/null +++ b/macosx/plugins/Bladesio1/macsrc/PluginConfigController.h @@ -0,0 +1,18 @@ +#define PluginConfigController DFCdromPluginConfigController + +#import + +@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/Bladesio1/macsrc/PluginConfigController.m b/macosx/plugins/Bladesio1/macsrc/PluginConfigController.m new file mode 100755 index 00000000..801a47f2 --- /dev/null +++ b/macosx/plugins/Bladesio1/macsrc/PluginConfigController.m @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2010, Wei Mingzhi . + * All Rights Reserved. + * + * Based on: Cdrom for Psemu Pro like Emulators + * By: linuzappz + * + * 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 . + */ + +#import "PluginConfigController.h" +#include "cdr.h" +#import "ARCBridge.h" + +#define APP_ID @"net.pcsxr.DFCdrom" +#define PrefsKey APP_ID @" Settings" + +static PluginConfigController *windowController = nil; + +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]; + AUTORELEASEOBJNORETURN(credits); + + } else { + credits = AUTORELEASEOBJ([[NSAttributedString alloc] initWithString:@""]); + } + + // 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: + [NSDictionary dictionaryWithObjectsAndKeys: + @YES, @"Threaded", + @64, @"Cache Size", + @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:@((BOOL)[Cached intValue]) forKey:@"Threaded"]; + [writeDic setObject:@([CacheSize intValue]) forKey:@"Cache Size"]; + + switch ([CdSpeed indexOfSelectedItem]) { + case 1: [writeDic setObject:@1 forKey:@"Speed"]; break; + case 2: [writeDic setObject:@2 forKey:@"Speed"]; break; + case 3: [writeDic setObject:@4 forKey:@"Speed"]; break; + case 4: [writeDic setObject:@8 forKey:@"Speed"]; break; + case 5: [writeDic setObject:@16 forKey:@"Speed"]; break; + case 6: [writeDic setObject:@32 forKey:@"Speed"]; break; + default: [writeDic setObject:@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 + RELEASEOBJ(keyValues); + keyValues = [[defaults dictionaryForKey:PrefsKey] mutableCopy]; + + [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 + +char* PLUGLOC(char *toloc) +{ + NSBundle *mainBundle = [NSBundle bundleForClass:[PluginConfigController class]]; + NSString *origString = nil, *transString = nil; + origString = [NSString stringWithCString:toloc encoding:NSUTF8StringEncoding]; + transString = [mainBundle localizedStringForKey:origString value:nil table:nil]; + return (char*)[transString cStringUsingEncoding:NSUTF8StringEncoding]; +} + diff --git a/macosx/plugins/Bladesio1/macsrc/cdr-macosx.c b/macosx/plugins/Bladesio1/macsrc/cdr-macosx.c new file mode 100755 index 00000000..94cf8996 --- /dev/null +++ b/macosx/plugins/Bladesio1/macsrc/cdr-macosx.c @@ -0,0 +1,252 @@ +/* + * Copyright (c) 2010, Wei Mingzhi . + * All Rights Reserved. + * + * Based on: Cdrom for Psemu Pro like Emulators + * By: linuzappz + * + * 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 . + */ + +#include "cdr.h" + +#ifdef _MACOSX + +#include +#include +#include +#include +#include +#include +#include + +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 (cdHandle != -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; + char buf[CD_FRAMESIZE_RAW]; + + 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 = buf; // ??? Why using cr->buf directly does not work in threaded mode? + + if (ioctl(cdHandle, DKIOCCDREAD, &r) != kIOReturnSuccess) { + return -1; + } + + memcpy(cr->buf, buf, CD_FRAMESIZE_RAW); + 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/Bladesio1/macsrc/cfg.c b/macosx/plugins/Bladesio1/macsrc/cfg.c new file mode 100755 index 00000000..6b5c1513 --- /dev/null +++ b/macosx/plugins/Bladesio1/macsrc/cfg.c @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2010, Wei Mingzhi . + * All Rights Reserved. + * + * Based on: Cdrom for Psemu Pro like Emulators + * By: linuzappz + * + * 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 . + */ + +#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/Bladesio1/version.plist b/macosx/plugins/Bladesio1/version.plist new file mode 100644 index 00000000..a9c51a62 --- /dev/null +++ b/macosx/plugins/Bladesio1/version.plist @@ -0,0 +1,16 @@ + + + + + BuildVersion + 38 + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1.0 + ProjectName + DFCdrom + SourceVersion + 2350000 + + -- cgit v1.2.3