From 98d7380ec7887a091c62d9d860815c70b0edffe8 Mon Sep 17 00:00:00 2001 From: "SND\\MaddTheSane_cp" Date: Fri, 5 Jul 2013 01:04:08 +0000 Subject: Making the SIO plug-ins work on OS X. Setting the deployment target on the SIO plug-in be set to 10.7, since we don't we have a 10.6 version of PCSXR that can use it. Adding Xcode config files. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@85826 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- .../Bladesio1/Bladesio1.xcodeproj/project.pbxproj | 6 +- .../English.lproj/Bladesio1PluginConfig.xib | 940 ++++++++++++++++++++- macosx/plugins/Bladesio1/English.lproj/Credits.rtf | 15 +- .../Bladesio1/English.lproj/Localizable.strings | 2 +- .../Bladesio1/macsrc/PluginConfigController.m | 41 +- 5 files changed, 951 insertions(+), 53 deletions(-) (limited to 'macosx/plugins') diff --git a/macosx/plugins/Bladesio1/Bladesio1.xcodeproj/project.pbxproj b/macosx/plugins/Bladesio1/Bladesio1.xcodeproj/project.pbxproj index a4b46c3a..956daf4e 100644 --- a/macosx/plugins/Bladesio1/Bladesio1.xcodeproj/project.pbxproj +++ b/macosx/plugins/Bladesio1/Bladesio1.xcodeproj/project.pbxproj @@ -34,7 +34,6 @@ 28586CC514651E870082B8EC /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/Bladesio1PluginConfig.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 = ""; }; - 55858D0A178609A80068B8FC /* cfg.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cfg.c; sourceTree = ""; }; 55858D0B178609A80068B8FC /* connection.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = connection.c; sourceTree = ""; }; 55858D0C178609A80068B8FC /* connection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = connection.h; sourceTree = ""; }; 55858D0D178609A80068B8FC /* fifo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = fifo.c; sourceTree = ""; }; @@ -122,7 +121,6 @@ 71F3C30911F3CC22007B9F12 /* src */ = { isa = PBXGroup; children = ( - 55858D0A178609A80068B8FC /* cfg.c */, 55858D0B178609A80068B8FC /* connection.c */, 55858D0C178609A80068B8FC /* connection.h */, 55858D0D178609A80068B8FC /* fifo.c */, @@ -359,7 +357,7 @@ ../.., ../../../plugins/dfcdrom, ); - MACOSX_DEPLOYMENT_TARGET = 10.6; + MACOSX_DEPLOYMENT_TARGET = 10.7; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; STRIP_INSTALLED_PRODUCT = NO; @@ -391,7 +389,7 @@ ../.., ../../../plugins/dfcdrom, ); - MACOSX_DEPLOYMENT_TARGET = 10.6; + MACOSX_DEPLOYMENT_TARGET = 10.7; SDKROOT = macosx; VALID_ARCHS = "i386 x86_64"; }; diff --git a/macosx/plugins/Bladesio1/English.lproj/Bladesio1PluginConfig.xib b/macosx/plugins/Bladesio1/English.lproj/Bladesio1PluginConfig.xib index b77e5264..26b3fd66 100644 --- a/macosx/plugins/Bladesio1/English.lproj/Bladesio1PluginConfig.xib +++ b/macosx/plugins/Bladesio1/English.lproj/Bladesio1PluginConfig.xib @@ -1,7 +1,7 @@ - 1060 + 1070 12E55 3084 1187.39 @@ -11,6 +11,7 @@ 3084 + IBNSLayoutConstraint NSBox NSButton NSButtonCell @@ -45,7 +46,7 @@ 1 2 - {{131, 362}, {255, 197}} + {{131, 362}, {315, 203}} 1886912512 BladeSIO1 Configuration NSWindow @@ -53,7 +54,7 @@ View - {283.34100000000001, 107} + {315, 203} 256 @@ -61,8 +62,9 @@ 256 - {{14, 13}, {82, 32}} + {{154, 13}, {82, 32}} + YES @@ -88,8 +90,10 @@ 256 - {{176, 13}, {65, 32}} + {{236, 13}, {65, 32}} + + YES 67108864 @@ -118,8 +122,9 @@ 268 - {{15, 73}, {85, 17}} + {{15, 79}, {85, 17}} + _NS:1535 YES @@ -154,8 +159,9 @@ 268 - {{15, 42}, {85, 17}} + {{15, 48}, {85, 17}} + _NS:1535 YES @@ -174,8 +180,9 @@ 268 - {{15, 14}, {85, 17}} + {{15, 20}, {85, 17}} + _NS:1535 YES @@ -194,8 +201,9 @@ 268 - {{105, 71}, {96, 22}} + {{105, 77}, {156, 22}} + _NS:9 YES @@ -228,9 +236,10 @@ 268 - {{105, 12}, {96, 22}} + {{105, 18}, {156, 22}} - + + _NS:9 YES @@ -288,8 +297,9 @@ 268 - {{103, 39}, {101, 26}} + {{103, 45}, {161, 26}} + _NS:9 YES @@ -311,6 +321,7 @@ 1048576 2147483647 + 1 NSImage NSMenuCheckmark @@ -360,14 +371,16 @@ NO - {{1, 1}, {219, 102}} + {{1, 1}, {279, 108}} + _NS:11 - {{17, 57}, {221, 104}} + {{17, 57}, {281, 110}} + _NS:9 {0, 0} @@ -395,8 +408,9 @@ 268 - {{16, 164}, {61, 18}} + {{16, 170}, {61, 18}} + _NS:9 YES @@ -427,13 +441,39 @@ NO + + + 268 + {{14, 13}, {75, 32}} + + + + _NS:9 + YES + + 67108864 + 134217728 + Reset + + _NS:9 + + -2038284288 + 129 + + + 200 + 25 + + NO + - {255, 197} + {315, 203} + - {{0, 0}, {1920, 1080}} - {283.34100000000001, 129} + {{0, 0}, {1920, 1058}} + {315, 225} {10000000000000, 10000000000000} YES @@ -512,6 +552,14 @@ 219 + + + resetPreferences: + + + + 223 + delegate @@ -562,10 +610,203 @@ 6 - - + + + + + 4 + 0 + + 4 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 6 + 0 + + 6 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 5 + 0 + + 6 + 1 + + 12 + + 1000 + + 6 + 24 + 3 + + + + 4 + 0 + + 4 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 5 + 0 + + 5 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 4 + 0 + + 4 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 3 + 0 + + 4 + 1 + + 20 + + 1000 + + 6 + 24 + 3 + + + + 5 + 0 + + 5 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 6 + 0 + + 6 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 3 + 0 + + 4 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 3 + 0 + + 3 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 5 + 0 + + 5 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + @@ -582,6 +823,22 @@ + + + 7 + 0 + + 0 + 1 + + 53 + + 1000 + + 3 + 9 + 1 + @@ -609,6 +866,278 @@ + + + 3 + 0 + + 3 + 1 + + 67 + + 1000 + + 3 + 9 + 3 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 6 + 0 + + 6 + 1 + + 16 + + 1000 + + 8 + 29 + 3 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 5 + 0 + + 5 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 6 + 0 + + 6 + 1 + + 16 + + 1000 + + 8 + 29 + 3 + + + + 3 + 0 + + 4 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 5 + 0 + + 5 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 4 + 0 + + 4 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 6 + 0 + + 6 + 1 + + 16 + + 1000 + + 8 + 29 + 3 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 3 + 0 + + 3 + 1 + + 8 + + 1000 + + 3 + 9 + 3 + + + + 11 + 0 + + 11 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 5 + 1 + + 16 + + 1000 + + 8 + 29 + 3 + + + + 5 + 0 + + 5 + 1 + + 16 + + 1000 + + 8 + 29 + 3 + + + + 11 + 0 + + 11 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 5 + 1 + + 16 + + 1000 + + 8 + 29 + 3 + @@ -619,6 +1148,22 @@ + + + 7 + 0 + + 0 + 1 + + 55 + + 1000 + + 3 + 9 + 1 + @@ -632,6 +1177,22 @@ + + + 7 + 0 + + 0 + 1 + + 79 + + 1000 + + 3 + 9 + 1 + @@ -741,6 +1302,179 @@ + + 221 + + + + + + + + 222 + + + + + 224 + + + + + 225 + + + + + 226 + + + + + 227 + + + + + 228 + + + + + 229 + + + + + 230 + + + + + 232 + + + + + 233 + + + + + 234 + + + + + 235 + + + + + 236 + + + + + 237 + + + + + 238 + + + + + 239 + + + + + 240 + + + + + 241 + + + + + 242 + + + + + 243 + + + + + 244 + + + + + 245 + + + + + 247 + + + + + 250 + + + + + 251 + + + + + 252 + + + + + 253 + + + + + 254 + + + + + 255 + + + + + 256 + + + + + 246 + + + + + 249 + + + + + 248 + + + @@ -749,19 +1483,52 @@ 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 @@ -771,23 +1538,149 @@ 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 + 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 - 220 + 259 + + + + + Bladesio1PluginConfigController + NSWindowController + + id + id + id + id + + + + cancel: + id + + + ok: + id + + + resetPreferences: + id + + + toggleEnabled: + id + + + + NSBox + NSButton + NSTextField + NSPopUpButton + NSTextField + + + + configBox + NSBox + + + enabledButton + NSButton + + + ipAddressField + NSTextField + + + playerMenu + NSPopUpButton + + + portField + NSTextField + + + + IBProjectSource + ./Classes/Bladesio1PluginConfigController.h + + + + NSLayoutConstraint + NSObject + + IBProjectSource + ./Classes/NSLayoutConstraint.h + + + - 0 IBCocoaFramework com.apple.InterfaceBuilder.CocoaPlugin.macosx - + YES 3 @@ -796,5 +1689,6 @@ {10, 3} {15, 15} + YES diff --git a/macosx/plugins/Bladesio1/English.lproj/Credits.rtf b/macosx/plugins/Bladesio1/English.lproj/Credits.rtf index 76fa6442..948de054 100644 --- a/macosx/plugins/Bladesio1/English.lproj/Credits.rtf +++ b/macosx/plugins/Bladesio1/English.lproj/Credits.rtf @@ -1,13 +1,14 @@ -{\rtf1\mac\ansicpg10025\cocoartf824\cocoasubrtf420 -{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;} +{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf390 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} {\colortbl;\red255\green255\blue255;} -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural +\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 \f0\b\fs24 \cf0 Original coder: -\f1\b0 \ +\b0 \ linuzappz\ \ -\f0\b Macintosh Port: -\f1\b0 \ - Wei Mingzhi} \ No newline at end of file +\b Macintosh Port: +\b0 \ + Charles "Madd the Sane" Betts} \ No newline at end of file diff --git a/macosx/plugins/Bladesio1/English.lproj/Localizable.strings b/macosx/plugins/Bladesio1/English.lproj/Localizable.strings index 2faf6e07..2c2be831 100644 --- a/macosx/plugins/Bladesio1/English.lproj/Localizable.strings +++ b/macosx/plugins/Bladesio1/English.lproj/Localizable.strings @@ -6,4 +6,4 @@ Copyright 2011 __MyCompanyName__. All rights reserved. */ -"CD-ROM Drive Reader" = "CD-ROM Drive Reader"; +"sio1Blade" = "Blade sio1"; diff --git a/macosx/plugins/Bladesio1/macsrc/PluginConfigController.m b/macosx/plugins/Bladesio1/macsrc/PluginConfigController.m index 13d9ef6e..00af2192 100755 --- a/macosx/plugins/Bladesio1/macsrc/PluginConfigController.m +++ b/macosx/plugins/Bladesio1/macsrc/PluginConfigController.m @@ -23,6 +23,7 @@ #include "typedefs.h" #include "sio1.h" #import "ARCBridge.h" +#include "macsrc.h" #define APP_ID @"net.pcsxr.Bladesio1" #define PrefsKey APP_ID @" Settings" @@ -89,7 +90,7 @@ void ReadConfig() [defaults registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys: [NSDictionary dictionaryWithObjectsAndKeys: @NO, kSioEnabled, - @((unsigned short)33307), kSioPort, + @((u16)33307), kSioPort, @"127.0.0.1", kSioIPAddress, @(PLAYER_DISABLED), kSioPlayer, nil], PrefsKey, nil]]; @@ -115,25 +116,25 @@ void ReadConfig() NSMutableDictionary *writeDic = [NSMutableDictionary dictionaryWithDictionary:keyValues]; - NSString *theAddress = [ipAddressField stringValue]; - { - unsigned char a, b, c, d; - if (sscanf([theAddress cStringUsingEncoding:NSASCIIStringEncoding], "%s.%s.%s.%s", &a, &b, &c, &d) != 4) { - NSBeginAlertSheet(@"Invalid IP address", nil, nil, nil, [self window], nil, NULL, NULL, NULL, @"The IP address cannot be a hostname,"); - } + if ([theAddress lengthOfBytesUsingEncoding:NSASCIIStringEncoding] > (sizeof(settings.ip) - 1)) { + NSBeginAlertSheet(@"Address too long", nil, nil, nil, [self window], nil, NULL, NULL, NULL, @"The address is too long. Try to use only the IP address and not a host name."); + return; } [writeDic setObject:(([enabledButton state] == NSOnState) ? @YES : @NO) forKey:kSioEnabled]; - [writeDic setObject:[ipAddressField stringValue] forKey:kSioIPAddress]; + [writeDic setObject:theAddress forKey:kSioIPAddress]; [writeDic setObject:@((unsigned short)[portField intValue]) forKey:kSioPort]; - - switch ([playerMenu indexOfSelectedItem]) { - default: - case 0: [writeDic setObject:@(PLAYER_DISABLED) forKey:kSioPlayer]; break; - case 1: [writeDic setObject:@(PLAYER_MASTER) forKey:kSioPlayer]; break; - case 2: [writeDic setObject:@(PLAYER_SLAVE) forKey:kSioPlayer]; break; + { + int player; + switch ([playerMenu indexOfSelectedItem]) { + default: + case 0: player = PLAYER_DISABLED; break; + case 1: player = PLAYER_MASTER; break; + case 2: player = PLAYER_SLAVE; break; + } + [writeDic setObject:@(player) forKey:kSioPlayer]; } // write to defaults @@ -150,11 +151,13 @@ void ReadConfig() { BOOL isEnabled = [enabledButton state] == NSOnState ? YES : NO; - for (NSView *subView in [configBox subviews]) { + for (NSView *subView in [[configBox subviews][0] subviews]) { if ([subView isKindOfClass:[NSTextField class]] && ![(NSTextField*)subView isEditable]) { [(NSTextField*)subView setTextColor:isEnabled ? [NSColor controlTextColor] : [NSColor disabledControlTextColor]]; } else { - [(NSControl*)subView setEnabled:isEnabled]; + if ([subView respondsToSelector:@selector(setEnabled:)]) { + [(NSControl*)subView setEnabled:isEnabled]; + } } } } @@ -177,14 +180,16 @@ void ReadConfig() [enabledButton setState: [[keyValues objectForKey:kSioEnabled] boolValue] ? NSOnState : NSOffState]; [ipAddressField setTitleWithMnemonic:[keyValues objectForKey:kSioIPAddress]]; - [portField setValue:[keyValues objectForKey:kSioPort]]; + [portField setIntValue:[[keyValues objectForKey:kSioPort] intValue]]; - switch ([[keyValues objectForKey:kSioPlayer] intValue]) { + switch ([[keyValues objectForKey:kSioPlayer] integerValue]) { default: case PLAYER_DISABLED: [playerMenu selectItemAtIndex:0]; break; case PLAYER_MASTER: [playerMenu selectItemAtIndex:1]; break; case PLAYER_SLAVE: [playerMenu selectItemAtIndex:2]; break; } + + [self toggleEnabled:nil]; } - (void)awakeFromNib -- cgit v1.2.3