From e542a8ec7278272ae06117cc09f9352dcff49de9 Mon Sep 17 00:00:00 2001 From: "SND\\MaddTheSane_cp" Date: Thu, 24 Nov 2011 05:17:27 +0000 Subject: First steps to make a memory card manager for Mac. Currently it only allows to to wipe a memory card and see what's saved on it. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@72586 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- macosx/ConfigurationController.h | 5 + macosx/ConfigurationController.m | 12 + macosx/English.lproj/Configuration.xib | 156 +++- macosx/English.lproj/MemCardManager.xib | 1297 +++++++++++++++++++++++++++++++ macosx/Pcsxr.xcodeproj/project.pbxproj | 24 + macosx/PcsxrMemCardController.h | 27 + macosx/PcsxrMemCardController.m | 185 +++++ macosx/PcsxrMemoryObject.h | 25 + macosx/PcsxrMemoryObject.m | 25 + 9 files changed, 1727 insertions(+), 29 deletions(-) create mode 100644 macosx/English.lproj/MemCardManager.xib create mode 100644 macosx/PcsxrMemCardController.h create mode 100644 macosx/PcsxrMemCardController.m create mode 100644 macosx/PcsxrMemoryObject.h create mode 100644 macosx/PcsxrMemoryObject.m diff --git a/macosx/ConfigurationController.h b/macosx/ConfigurationController.h index ef8e4447..068941e7 100644 --- a/macosx/ConfigurationController.h +++ b/macosx/ConfigurationController.h @@ -4,6 +4,8 @@ #import "PluginController.h" #import "PluginList.h" +@class PcsxrMemCardController; + @interface ConfigurationController : NSWindowController { IBOutlet PluginController *cdromPlugin; @@ -30,6 +32,8 @@ IBOutlet NSTextField *mcd1Label; IBOutlet NSTextField *mcd2Label; + PcsxrMemCardController *memCardEdit; + NSMutableDictionary *checkBoxDefaults; } - (IBAction)setCheckbox:(id)sender; @@ -37,6 +41,7 @@ - (IBAction)setVideoType:(id)sender; - (IBAction)mcdChangeClicked:(id)sender; - (IBAction)mcdNewClicked:(id)sender; +- (IBAction)mcdEditClicked:(id)sender; - (NSString *)keyForSender:(id)sender; diff --git a/macosx/ConfigurationController.m b/macosx/ConfigurationController.m index 7b0782e0..d7f4cc76 100644 --- a/macosx/ConfigurationController.m +++ b/macosx/ConfigurationController.m @@ -2,6 +2,7 @@ #import "PcsxrController.h" #import "PluginList.h" #import "PcsxrPlugin.h" +#import "PcsxrMemCardController.h" #include "psxcommon.h" #include "plugins.h" @@ -195,6 +196,9 @@ - (void)dealloc { [checkBoxDefaults release]; + if (memCardEdit) { + [memCardEdit release]; + } [super dealloc]; } @@ -211,4 +215,12 @@ return nil; } +- (IBAction)mcdEditClicked:(id)sender +{ + if (!memCardEdit) { + memCardEdit = [[PcsxrMemCardController alloc] init]; + } + [memCardEdit showWindow:nil]; +} + @end diff --git a/macosx/English.lproj/Configuration.xib b/macosx/English.lproj/Configuration.xib index 9a3022ff..3b3afa29 100644 --- a/macosx/English.lproj/Configuration.xib +++ b/macosx/English.lproj/Configuration.xib @@ -67,14 +67,13 @@ {{13, 10}, {526, 344}} - 1 - + 256 @@ -90,7 +89,6 @@ 274 {{18, 51}, {135, 106}} - YES 5 @@ -295,7 +293,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 256 {{17, 16}, {137, 26}} - YES @@ -404,13 +401,11 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{2, 2}, {175, 167}} - {{17, 108}, {179, 184}} - {0, 0} @@ -455,7 +450,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 306 {{18, 16}, {238, 40}} - YES 2 @@ -522,13 +516,11 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{2, 2}, {273, 74}} - {{212, 201}, {277, 91}} - {0, 0} @@ -561,8 +553,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 256 {{18, 16}, {232, 40}} - - YES 2 1 @@ -663,13 +653,11 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{2, 2}, {273, 74}} - {{212, 108}, {277, 91}} - {0, 0} @@ -691,8 +679,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{10, 33}, {506, 298}} - - Emulation @@ -1430,7 +1416,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 3 - + 256 @@ -1446,6 +1432,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 256 {{13, 50}, {454, 17}} + 1 YES @@ -1473,6 +1460,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 256 {{123, 2}, {100, 32}} + 1 YES @@ -1499,6 +1487,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 256 {{231, 2}, {125, 32}} + 1 YES @@ -1523,11 +1512,13 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{2, 2}, {480, 82}} + {{8, 199}, {484, 99}} + {0, 0} @@ -1560,6 +1551,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 256 {{13, 47}, {454, 17}} + 2 YES @@ -1579,6 +1571,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 256 {{123, 3}, {100, 32}} + 2 YES @@ -1605,7 +1598,8 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 256 {{232, 3}, {125, 32}} - + + 2 YES @@ -1629,11 +1623,13 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{2, 2}, {480, 79}} + {{8, 99}, {484, 96}} + {0, 0} @@ -1653,8 +1649,33 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 2 NO + + + 268 + {{191, 55}, {118, 32}} + + + _NS:687 + YES + + 67239424 + 134217728 + Edit Cards… + + _NS:687 + + -2038284033 + 129 + + + 200 + 25 + + {{10, 33}, {506, 298}} + + Memory Cards @@ -1662,13 +1683,13 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA - + 0 YES YES - + @@ -1932,6 +1953,14 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 641 + + + mcdEditClicked: + + + + 644 + delegate @@ -2313,6 +2342,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA + @@ -2921,6 +2951,19 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA + + 642 + + + + + + + + 643 + + + @@ -3075,12 +3118,14 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin - 641 + 644 @@ -3089,6 +3134,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA NSWindowController id + id id id id @@ -3099,6 +3145,10 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA mcdChangeClicked: id + + mcdEditClicked: + id + mcdNewClicked: id @@ -3230,32 +3280,48 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA ./Classes/ConfigurationController.h + + NetSfPeopsSPUPluginNamedSlider + NSSlider + + IBProjectSource + ./Classes/NetSfPeopsSPUPluginNamedSlider.h + + PluginController NSObject - id - id - id + id + id + id - - doAbout: + + cancel: id - - doConfigure: + + ok: id - - selectPlugin: + + reset: id NSButton NSButton + NSControl + NetSfPeopsSPUPluginNamedSlider + NSControl + NSControl NSPopUpButton + NetSfPeopsSPUPluginNamedSlider + NetSfPeopsSPUPluginNamedSlider + NSControl + NSControl @@ -3266,10 +3332,42 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA configureButton NSButton + + hiCompBox + NSControl + + + interpolValue + NetSfPeopsSPUPluginNamedSlider + + + irqWaitBox + NSControl + + + monoSoundBox + NSControl + pluginMenu NSPopUpButton + + reverbValue + NetSfPeopsSPUPluginNamedSlider + + + volumeValue + NetSfPeopsSPUPluginNamedSlider + + + xaEnableBox + NSControl + + + xaSpeedBox + NSControl + IBProjectSource diff --git a/macosx/English.lproj/MemCardManager.xib b/macosx/English.lproj/MemCardManager.xib new file mode 100644 index 00000000..7693b376 --- /dev/null +++ b/macosx/English.lproj/MemCardManager.xib @@ -0,0 +1,1297 @@ + + + + 1060 + 11C74 + 1938 + 1138.23 + 567.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 1938 + + + YES + NSScroller + NSArrayController + NSButton + NSScrollView + NSButtonCell + NSImageView + NSBox + NSImageCell + NSCollectionViewItem + NSTextFieldCell + NSCustomObject + NSCollectionView + NSView + NSWindowTemplate + NSTextField + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + YES + + PcsxrMemCardController + + + FirstResponder + + + NSApplication + + + 15 + 2 + {{196, 240}, {469, 329}} + 544735232 + Memory Card Manager + NSWindow + + + {469, 329} + + + 256 + + YES + + + 268 + {{203, 228}, {63, 32}} + + + + _NS:687 + YES + + 67239424 + 134217728 + <- + + LucidaGrande + 13 + 1044 + + _NS:687 + + -2038284033 + 129 + + + 200 + 25 + + + + + 268 + {{203, 94}, {63, 32}} + + + + _NS:687 + YES + + 67239424 + 134217728 + -> + + _NS:687 + + -2038284033 + 129 + + + 200 + 25 + + + + + 268 + + YES + + + 2304 + + YES + + + 274 + {179, 246} + + + + _NS:3367 + {0, 0} + {0, 0} + 0 + 0 + + YES + + 6 + System + controlBackgroundColor + + 3 + MC42NjY2NjY2NjY3AA + + + + YES + -1 + 0 + + + {{1, 1}, {179, 246}} + + + + _NS:3365 + + + 6 + System + controlColor + + + 4 + + + + -2147483392 + {{234, 1}, {15, 143}} + + + + _NS:3372 + + _doScroller: + 1 + 0.89655172824859619 + + + + -2147483392 + {{1, 144}, {233, 15}} + + + + _NS:3374 + 1 + + _doScroller: + 0.63157892227172852 + + + {{268, 61}, {181, 248}} + + + + _NS:3363 + 133682 + + + + + + + 268 + + YES + + + 2304 + + YES + + + 274 + {179, 246} + + + + _NS:3367 + {0, 0} + {0, 0} + 0 + 0 + + YES + + + YES + -1 + 0 + + + {{1, 1}, {179, 246}} + + + + _NS:3365 + + + 4 + + + + -2147483392 + {{234, 1}, {15, 143}} + + + + _NS:3372 + + _doScroller: + 1 + 0.89655172824859619 + + + + -2147483392 + {{1, 144}, {233, 15}} + + + + _NS:3374 + 1 + + _doScroller: + 0.63157892227172852 + + + {{20, 61}, {181, 248}} + + + + _NS:3363 + 133682 + + + + + + + 268 + {{261, 25}, {85, 32}} + + + + _NS:687 + 2 + YES + + 67239424 + 134217728 + Format + + _NS:687 + + -2038284033 + 129 + + + 200 + 25 + + + + + 268 + {{13, 25}, {85, 32}} + + + + _NS:687 + 1 + YES + + 67239424 + 134217728 + Format + + _NS:687 + + -2038284033 + 129 + + + 200 + 25 + + + + + 268 + {{127, 25}, {80, 32}} + + + + _NS:687 + 1 + YES + + 67239424 + 134217728 + Delete + + _NS:687 + + -2038284033 + 129 + + + 200 + 25 + + + + + 268 + {{374, 25}, {80, 32}} + + + _NS:687 + 2 + YES + + 67239424 + 134217728 + Delete + + _NS:687 + + -2038284033 + 129 + + + 200 + 25 + + + + {469, 329} + + + + + {{0, 0}, {1680, 1028}} + {469, 351} + {10000000000000, 10000000000000} + YES + + + + + 256 + + YES + + + 36 + + YES + + + 274 + + YES + + + 269 + + YES + + YES + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + NSFilenamesPboardType + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT TIFF v4.0 pasteboard type + + + {{55, 63}, {32, 32}} + + + + _NS:2141 + YES + + 130560 + 33554432 + _NS:2141 + 0 + 0 + 0 + NO + + YES + + + + 266 + {{15, 38}, {115, 17}} + + + + _NS:3944 + YES + + 68288064 + 138413056 + English name + + _NS:3944 + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + + 266 + {{15, 16}, {115, 17}} + + + _NS:3944 + YES + + 68288064 + 138413056 + SJIS name + + _NS:3944 + + + + + + + {143, 108} + + + + _NS:11 + + + {{1, 0}, {143, 108}} + + + + _NS:9 + {0, 0} + + 67239424 + 0 + Box + + LucidaGrande + 11 + 3100 + + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 3 + MCAwLjgwMDAwMDAxMTkAA + + + + 0 + 4 + 2 + NO + + 6 + System + selectedControlColor + + + + + {144, 108} + + + + + + + YES + englishName + sjisName + memImage + + PcsxrMemoryObject + YES + + YES + YES + YES + YES + YES + + + + YES + englishName + sjisName + memImage + + PcsxrMemoryObject + YES + + YES + YES + YES + YES + YES + + + + + YES + + + moveToLeft: + + + + 11 + + + + moveToRight: + + + + 12 + + + + leftMove + + + + 13 + + + + rightMove + + + + 14 + + + + memCard1view + + + + 39 + + + + memCard2view + + + + 40 + + + + window + + + + 41 + + + + formatCard: + + + + 70 + + + + formatCard: + + + + 71 + + + + deleteMemoryObject: + + + + 72 + + + + deleteMemoryObject: + + + + 73 + + + + itemPrototype + + + + 21 + + + + content: arrangedObjects + + + + + + content: arrangedObjects + content + arrangedObjects + 2 + + + 51 + + + + view + + + + 22 + + + + itemPrototype + + + + 27 + + + + content: arrangedObjects + + + + + + content: arrangedObjects + content + arrangedObjects + 2 + + + 49 + + + + value: representedObject.memImage + + + + + + value: representedObject.memImage + value + representedObject.memImage + 2 + + + 60 + + + + value: representedObject.englishName + + + + + + value: representedObject.englishName + value + representedObject.englishName + 2 + + + 57 + + + + value: representedObject.sjisName + + + + + + value: representedObject.sjisName + value + representedObject.sjisName + 2 + + + 59 + + + + contentArray: memCard1Array + + + + + + contentArray: memCard1Array + contentArray + memCard1Array + 2 + + + 47 + + + + contentArray: memCard2Array + + + + + + contentArray: memCard2Array + contentArray + memCard2Array + 2 + + + 45 + + + + + YES + + 0 + + YES + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + YES + + + + + + 2 + + + YES + + + + + + + + + + + + + 7 + + + YES + + + + + + 8 + + + + + 9 + + + YES + + + + + + 10 + + + + + 15 + + + YES + + + + + + + + 16 + + + + + 17 + + + + + 18 + + + + + 19 + + + + + 20 + + + YES + + + + + + 23 + + + YES + + + + + + + + 24 + + + + + 25 + + + + + 26 + + + + + 36 + + + MemCard1 + + + 37 + + + MemCard2 + + + 61 + + + YES + + + + + + + + 30 + + + YES + + + + + + 31 + + + + + 32 + + + YES + + + + + + 33 + + + + + 34 + + + YES + + + + + + 35 + + + + + 62 + + + YES + + + + + + 63 + + + + + 64 + + + YES + + + + + + 65 + + + + + 66 + + + YES + + + + + + 67 + + + + + 68 + + + YES + + + + + + 69 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 1.IBPluginDependency + 1.IBWindowTemplateEditedContentRect + 1.NSWindowTemplate.visibleAtLaunch + 10.IBPluginDependency + 15.IBPluginDependency + 16.IBPluginDependency + 17.IBPluginDependency + 18.IBPluginDependency + 19.IBPluginDependency + 2.IBPluginDependency + 20.IBPluginDependency + 23.IBPluginDependency + 24.IBPluginDependency + 25.IBPluginDependency + 26.IBPluginDependency + 30.IBPluginDependency + 31.IBPluginDependency + 32.IBPluginDependency + 33.IBPluginDependency + 34.IBPluginDependency + 35.IBPluginDependency + 36.IBPluginDependency + 37.IBPluginDependency + 61.IBPluginDependency + 62.IBPluginDependency + 63.IBPluginDependency + 64.IBPluginDependency + 65.IBPluginDependency + 66.IBPluginDependency + 67.IBPluginDependency + 68.IBPluginDependency + 69.IBPluginDependency + 7.IBPluginDependency + 8.IBPluginDependency + 9.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{357, 418}, {480, 270}} + + 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 + + + + YES + + + + + + YES + + + + + 73 + + + + YES + + PcsxrMemCardController + NSWindowController + + YES + + YES + deleteMemoryObject: + formatCard: + moveToLeft: + moveToRight: + + + YES + id + id + id + id + + + + YES + + YES + deleteMemoryObject: + formatCard: + moveToLeft: + moveToRight: + + + YES + + deleteMemoryObject: + id + + + formatCard: + id + + + moveToLeft: + id + + + moveToRight: + id + + + + + YES + + YES + leftMove + memCard1view + memCard2view + rightMove + + + YES + NSButton + NSCollectionView + NSCollectionView + NSButton + + + + YES + + YES + leftMove + memCard1view + memCard2view + rightMove + + + YES + + leftMove + NSButton + + + memCard1view + NSCollectionView + + + memCard2view + NSCollectionView + + + rightMove + NSButton + + + + + IBProjectSource + ./Classes/PcsxrMemCardController.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + diff --git a/macosx/Pcsxr.xcodeproj/project.pbxproj b/macosx/Pcsxr.xcodeproj/project.pbxproj index affd7768..e46858a5 100644 --- a/macosx/Pcsxr.xcodeproj/project.pbxproj +++ b/macosx/Pcsxr.xcodeproj/project.pbxproj @@ -43,6 +43,9 @@ 559DAC47146BA61F00C5DF71 /* PeopsAL.psxplugin in Copy PlugIns */ = {isa = PBXBuildFile; fileRef = 28B467F11463D0020083F129 /* PeopsAL.psxplugin */; }; 559DACBB146C68C500C5DF71 /* DFNet.psxplugin in Copy PlugIns */ = {isa = PBXBuildFile; fileRef = 559DACAE146C647E00C5DF71 /* DFNet.psxplugin */; }; 559DACEE146C72FF00C5DF71 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 559DACEC146C72FF00C5DF71 /* Localizable.strings */; }; + 55A90220147D7C380037E18F /* PcsxrMemCardController.m in Sources */ = {isa = PBXBuildFile; fileRef = 55A9021F147D7C380037E18F /* PcsxrMemCardController.m */; }; + 55A90223147D7C7A0037E18F /* MemCardManager.xib in Resources */ = {isa = PBXBuildFile; fileRef = 55A90221147D7C7A0037E18F /* MemCardManager.xib */; }; + 55A90229147D89380037E18F /* PcsxrMemoryObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 55A90228147D89380037E18F /* PcsxrMemoryObject.m */; }; 712FD1E81093096F00575A92 /* debug.c in Sources */ = {isa = PBXBuildFile; fileRef = 712FD1E51093096F00575A92 /* debug.c */; }; 712FD1E91093096F00575A92 /* socket.c in Sources */ = {isa = PBXBuildFile; fileRef = 712FD1E61093096F00575A92 /* socket.c */; }; 713B530E110B75650002F164 /* ppf.c in Sources */ = {isa = PBXBuildFile; fileRef = 713B530C110B75650002F164 /* ppf.c */; }; @@ -274,6 +277,11 @@ 559366C812B694DF004ACC1E /* ix86_sse.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ix86_sse.c; sourceTree = ""; }; 559DACA3146C647E00C5DF71 /* DFNet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = DFNet.xcodeproj; path = plugins/DFNet/DFNet.xcodeproj; sourceTree = ""; }; 559DACED146C72FF00C5DF71 /* English */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = English; path = Localizable.strings; sourceTree = ""; }; + 55A9021E147D7C380037E18F /* PcsxrMemCardController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PcsxrMemCardController.h; sourceTree = ""; }; + 55A9021F147D7C380037E18F /* PcsxrMemCardController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PcsxrMemCardController.m; sourceTree = ""; }; + 55A90222147D7C7A0037E18F /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = MemCardManager.xib; sourceTree = ""; }; + 55A90227147D89380037E18F /* PcsxrMemoryObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PcsxrMemoryObject.h; sourceTree = ""; }; + 55A90228147D89380037E18F /* PcsxrMemoryObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PcsxrMemoryObject.m; sourceTree = ""; }; 712FD1E51093096F00575A92 /* debug.c */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.c; path = debug.c; sourceTree = ""; }; 712FD1E61093096F00575A92 /* socket.c */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.c; path = socket.c; sourceTree = ""; }; 712FD1E71093096F00575A92 /* socket.h */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.h; path = socket.h; sourceTree = ""; }; @@ -417,6 +425,7 @@ 559DACEC146C72FF00C5DF71 /* Localizable.strings */, 28F0C3C7146521B000A90285 /* PCSXR.xib */, 28F0C3CA146521B700A90285 /* AddPluginSheet.xib */, + 55A90221147D7C7A0037E18F /* MemCardManager.xib */, ); name = Resources; path = English.lproj; @@ -458,6 +467,10 @@ 2BA44361052DB2EA00E21DDD /* PcsxrPlugin.m */, 2B3E356A06937D1C00763C7D /* PcsxrPluginDocument.h */, 2B3E356B06937D1C00763C7D /* PcsxrPluginDocument.m */, + 55A9021E147D7C380037E18F /* PcsxrMemCardController.h */, + 55A9021F147D7C380037E18F /* PcsxrMemCardController.m */, + 55A90227147D89380037E18F /* PcsxrMemoryObject.h */, + 55A90228147D89380037E18F /* PcsxrMemoryObject.m */, ); name = MacOSX; sourceTree = ""; @@ -767,6 +780,7 @@ 28F0C3C9146521B000A90285 /* PCSXR.xib in Resources */, 28F0C3CC146521B700A90285 /* AddPluginSheet.xib in Resources */, 559DACEE146C72FF00C5DF71 /* Localizable.strings in Resources */, + 55A90223147D7C7A0037E18F /* MemCardManager.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -822,6 +836,8 @@ 556A148412B6DE1A007DE998 /* ppc.c in Sources */, 556A148512B6DE1A007DE998 /* pR3000A.c in Sources */, 556A148612B6DE1A007DE998 /* reguse.c in Sources */, + 55A90220147D7C380037E18F /* PcsxrMemCardController.m in Sources */, + 55A90229147D89380037E18F /* PcsxrMemoryObject.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -914,6 +930,14 @@ name = Localizable.strings; sourceTree = ""; }; + 55A90221147D7C7A0037E18F /* MemCardManager.xib */ = { + isa = PBXVariantGroup; + children = ( + 55A90222147D7C7A0037E18F /* English */, + ); + name = MemCardManager.xib; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ diff --git a/macosx/PcsxrMemCardController.h b/macosx/PcsxrMemCardController.h new file mode 100644 index 00000000..61019d82 --- /dev/null +++ b/macosx/PcsxrMemCardController.h @@ -0,0 +1,27 @@ +// +// PcsxrMemCardManager.h +// Pcsxr +// +// Created by Charles Betts on 11/23/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + + +@interface PcsxrMemCardController : NSWindowController +{ + IBOutlet NSCollectionView *memCard1view; + IBOutlet NSCollectionView *memCard2view; + IBOutlet NSButton *leftMove; + IBOutlet NSButton *rightMove; + NSMutableArray *memCard1Array; + NSMutableArray *memCard2Array; +} + +- (IBAction)moveToLeft:(id)sender; +- (IBAction)moveToRight:(id)sender; +- (IBAction)formatCard:(id)sender; +- (IBAction)deleteMemoryObject:(id)sender; +- (void)loadMemoryCardInfoForCard:(int)theCard; +@end diff --git a/macosx/PcsxrMemCardController.m b/macosx/PcsxrMemCardController.m new file mode 100644 index 00000000..454da1d3 --- /dev/null +++ b/macosx/PcsxrMemCardController.m @@ -0,0 +1,185 @@ +// +// PcsxrMemCardManager.m +// Pcsxr +// +// Created by Charles Betts on 11/23/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "PcsxrMemCardController.h" +#import "PcsxrMemoryObject.h" +#include "sio.h" + +#define MAX_MEMCARD_BLOCKS 15 + +static inline NSImage *imageFromMcd(short * icon) +{ + NSBitmapImageRep *imageRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL pixelsWide:16 pixelsHigh:16 bitsPerSample:8 samplesPerPixel:3 hasAlpha:NO isPlanar:NO colorSpaceName:NSCalibratedRGBColorSpace bytesPerRow:0 bitsPerPixel:0]; + //[imageRep setSize:NSMakeSize(32, 32)]; + //[imageRep setBitsPerSample:32]; + +#if 0 + int x, y, c; + for (y = 0; y < 32; y++) { + for (x = 0; x < 32; x++) { + c = icon[(y>>1) * 16 + (x>>1)]; + c = ((c & 0x001f) << 10) | ((c & 0x7c00) >> 10) | (c & 0x03e0); + c = ((c & 0x001f) << 3) | ((c & 0x03e0) << 6) | ((c & 0x7c00) << 9); + + NSUInteger NSc = c; + + [imageRep setPixel:&NSc atX:x y:y]; + } + } +#else + int x, y, c, i, r, g, b; + for (i = 0; i < 256; i++) { + x = (i % 16); + y = (i / 16); + c = icon[i]; + r = (c & 0x001f) << 3; + g = ((c & 0x03e0) >> 5) << 3; + b = ((c & 0x7c00) >> 10) << 3; + [imageRep setColor:[NSColor colorWithCalibratedRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1.0] atX:x y:y]; + } +#endif + NSImage *theImage = [[NSImage alloc] init]; + [theImage addRepresentation:imageRep]; + [imageRep release]; + return [theImage autorelease]; +} + +@implementation PcsxrMemCardController + +//memCard1Array KVO functions + +-(void)insertObject:(PcsxrMemoryObject *)p inMemCard1ArrayAtIndex:(NSUInteger)index { + [memCard1Array insertObject:p atIndex:index]; +} + +-(void)removeObjectFromMemCard1ArrayAtIndex:(NSUInteger)index { + [memCard1Array removeObjectAtIndex:index]; +} + +- (void)setMemCard1Array:(NSMutableArray *)a +{ + if (memCard1Array != a) { + [memCard1Array release]; + memCard1Array = [[NSMutableArray alloc] initWithArray:a]; + } +} + +- (NSArray *)memCard1Array +{ + return memCard1Array; +} + +//memCard2Array KVO functions + +-(void)insertObject:(PcsxrMemoryObject *)p inMemCard2ArrayAtIndex:(NSUInteger)index { + [memCard2Array insertObject:p atIndex:index]; +} + +-(void)removeObjectFromMemCard2ArrayAtIndex:(NSUInteger)index { + [memCard2Array removeObjectAtIndex:index]; +} + +- (void)setMemCard2Array:(NSMutableArray *)a +{ + if (memCard2Array != a) { + [memCard2Array release]; + memCard2Array = [[NSMutableArray alloc] initWithArray:a]; + } +} + +- (NSArray *)memCard2Array +{ + return memCard2Array; +} + + +- (id)init +{ + self = [self initWithWindowNibName:@"MemCardManager"]; + return self; +} + +- (id)initWithWindow:(NSWindow *)window +{ + self = [super initWithWindow:window]; + if (self) { + LoadMcds(Config.Mcd1, Config.Mcd2); + [self setMemCard1Array:[[NSMutableArray alloc] initWithCapacity:MAX_MEMCARD_BLOCKS]]; + [self setMemCard2Array:[[NSMutableArray alloc] initWithCapacity:MAX_MEMCARD_BLOCKS]]; + } + + return self; +} + +- (void)loadMemoryCardInfoForCard:(int)theCard +{ + NSInteger i; + McdBlock info; + NSMutableArray *newArray = [[NSMutableArray alloc] initWithCapacity:MAX_MEMCARD_BLOCKS]; + + for (i = 0; i < MAX_MEMCARD_BLOCKS; i++) { + GetMcdBlockInfo(theCard, i, &info); + PcsxrMemoryObject *ob = [[PcsxrMemoryObject alloc] init]; + NSString *engDes = nil, *japDes = nil; + ob.englishName = [NSString stringWithCString:info.Title encoding:NSASCIIStringEncoding]; + ob.sjisName = [NSString stringWithCString:info.sTitle encoding:NSShiftJISStringEncoding]; + ob.memImage = imageFromMcd(info.Icon); + ob.memNumber = i; + [newArray insertObject:ob atIndex:i]; + [ob release]; + } + if (theCard == 1) { + [self setMemCard1Array:newArray]; + } else { + [self setMemCard2Array:newArray]; + } + [newArray release]; +} + +- (void)windowDidLoad +{ + [super windowDidLoad]; + + // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file. + [self loadMemoryCardInfoForCard:1]; + [self loadMemoryCardInfoForCard:2]; +} + +- (IBAction)moveToLeft:(id)sender +{ + +} + +- (IBAction)moveToRight:(id)sender +{ + +} + +- (IBAction)formatCard:(id)sender +{ + NSInteger memCardSelect = [sender tag]; + if (memCardSelect == 1) { + CreateMcd(Config.Mcd1); + [self loadMemoryCardInfoForCard:1]; + } else { + CreateMcd(Config.Mcd2); + [self loadMemoryCardInfoForCard:2]; + } +} + +- (IBAction)deleteMemoryObject:(id)sender { + NSInteger memCardSelect = [sender tag]; + if (memCardSelect == 1) { + + [self loadMemoryCardInfoForCard:1]; + } else { + + [self loadMemoryCardInfoForCard:2]; + } +} +@end diff --git a/macosx/PcsxrMemoryObject.h b/macosx/PcsxrMemoryObject.h new file mode 100644 index 00000000..6db851ae --- /dev/null +++ b/macosx/PcsxrMemoryObject.h @@ -0,0 +1,25 @@ +// +// PcsxrMemoryObject.h +// Pcsxr +// +// Created by Charles Betts on 11/23/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +@interface PcsxrMemoryObject : NSObject +{ + NSString *englishName; + NSString *sjisName; + NSImage *memImage; + short memNumber; +} + +@property(copy, readwrite) NSString * englishName; +@property(copy, readwrite) NSString * sjisName; +@property(retain, readwrite) NSImage * memImage; +@property(readwrite) short memNumber; + + +@end diff --git a/macosx/PcsxrMemoryObject.m b/macosx/PcsxrMemoryObject.m new file mode 100644 index 00000000..6d7263c1 --- /dev/null +++ b/macosx/PcsxrMemoryObject.m @@ -0,0 +1,25 @@ +// +// PcsxrMemoryObject.m +// Pcsxr +// +// Created by Charles Betts on 11/23/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "PcsxrMemoryObject.h" + +@implementation PcsxrMemoryObject + +@synthesize englishName; +@synthesize sjisName; +@synthesize memImage; +@synthesize memNumber; + +- (void)dealloc +{ + [englishName release]; + [sjisName release]; + [memImage release]; +} + +@end -- cgit v1.2.3