summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-06-22 22:59:56 +0000
committerSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-06-22 22:59:56 +0000
commit5a29c04f291e9eb2f93fafb90ee2d7368b5627b9 (patch)
tree8aa1e9d275778ed43d435749e91e7030e84bae4e
parent32f0cfc0e047e2f5762357327d45bc7c823f29aa (diff)
downloadpcsxr-5a29c04f291e9eb2f93fafb90ee2d7368b5627b9.tar.gz
Modify the Memory Object class a little bit. Some minor changes.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@85493 e17a0e51-4ae3-4d35-97c3-1a29b211df97
-rwxr-xr-xmacosx/ConfigurationController.h22
-rwxr-xr-xmacosx/PcsxrMemoryObject.h10
-rwxr-xr-xmacosx/PcsxrMemoryObject.m45
-rwxr-xr-xmacosx/PcsxrPlugin.h12
-rwxr-xr-xmacosx/PluginController.h14
-rwxr-xr-xmacosx/plugins/DFXVideo/macsrc/PluginGLView.m2
6 files changed, 58 insertions, 47 deletions
diff --git a/macosx/ConfigurationController.h b/macosx/ConfigurationController.h
index 2e88f445..e55cfb0a 100755
--- a/macosx/ConfigurationController.h
+++ b/macosx/ConfigurationController.h
@@ -11,12 +11,12 @@ extern NSString *memChangeNotifier;
@interface ConfigurationController : NSWindowController
{
- IBOutlet PluginController *cdromPlugin;
- IBOutlet PluginController *graphicsPlugin;
- IBOutlet PluginController *padPlugin;
- IBOutlet PluginController *soundPlugin;
+ IBOutlet PluginController *cdromPlugin;
+ IBOutlet PluginController *graphicsPlugin;
+ IBOutlet PluginController *padPlugin;
+ IBOutlet PluginController *soundPlugin;
IBOutlet PluginController *netPlugin;
-
+
IBOutlet id noXaAudioCell;
IBOutlet id sioIrqAlwaysCell;
IBOutlet id bwMdecCell;
@@ -32,14 +32,14 @@ extern NSString *memChangeNotifier;
IBOutlet id noFastBootCell;
IBOutlet id enableNetPlayCell;
IBOutlet id widescreen;
-
- // Hotkeys
- IBOutlet HotkeyController *hkController;
- IBOutlet NSTabViewItem *hkTab;
-
+
+ // Hotkeys
+ IBOutlet HotkeyController *hkController;
+ IBOutlet NSTabViewItem *hkTab;
+
IBOutlet NSTextField *mcd1Label;
IBOutlet NSTextField *mcd2Label;
-
+
PcsxrMemCardController *memCardEdit;
NSMutableDictionary *checkBoxDefaults;
diff --git a/macosx/PcsxrMemoryObject.h b/macosx/PcsxrMemoryObject.h
index 413500ab..556d2acd 100755
--- a/macosx/PcsxrMemoryObject.h
+++ b/macosx/PcsxrMemoryObject.h
@@ -27,11 +27,11 @@
- (id)initWithMcdBlock:(McdBlock *)infoBlock;
-@property(readonly) NSString *englishName;
-@property(readonly) NSString *sjisName;
-@property(readonly) NSString *memName;
-@property(readonly) NSString *memID;
-@property(readonly) NSImage *memImage;
+@property(readonly, retain) NSString *englishName;
+@property(readonly, retain) NSString *sjisName;
+@property(readonly, retain) NSString *memName;
+@property(readonly, retain) NSString *memID;
+@property(readonly, retain) NSImage *memImage;
@property(readonly) int memIconCount;
@property(readonly, getter = isNotDeleted) BOOL notDeleted;
@property(readonly) unsigned char memFlags;
diff --git a/macosx/PcsxrMemoryObject.m b/macosx/PcsxrMemoryObject.m
index e8e20589..1a13c879 100755
--- a/macosx/PcsxrMemoryObject.m
+++ b/macosx/PcsxrMemoryObject.m
@@ -12,6 +12,18 @@
#import <AppKit/NSImage.h>
#import "ARCBridge.h"
+@interface PcsxrMemoryObject ()
+//Mangle the setters' names so that if someone tries to use them, they won't work
+@property(readwrite, retain, setter = setEngName:) NSString *englishName;
+@property(readwrite, retain, setter = setJapaneseName:) NSString *sjisName;
+@property(readwrite, retain, setter = setTheMemName:) NSString *memName;
+@property(readwrite, retain, setter = setTheMemId:) NSString *memID;
+@property(readwrite, retain, setter = setTheMemImage:) NSImage *memImage;
+@property(readwrite, setter = setIconCount:) int memIconCount;
+@property(readwrite, getter = isNotDeleted, setter = setIsNotDeleted:) BOOL notDeleted;
+@property(readwrite, setter = setTheMemFlags:) unsigned char memFlags;
+@end
+
@implementation PcsxrMemoryObject
+ (NSImage *)imageFromMcd:(short *)icon
@@ -54,24 +66,23 @@
- (id)initWithMcdBlock:(McdBlock *)infoBlock
{
if (self = [super init]) {
- englishName = [[NSString alloc] initWithCString:infoBlock->Title encoding:NSASCIIStringEncoding];
- sjisName = [[NSString alloc] initWithCString:infoBlock->sTitle encoding:NSShiftJISStringEncoding];
- memImage = RETAINOBJ([PcsxrMemoryObject imageFromMcd:infoBlock->Icon]);
- memName = [[NSString alloc] initWithCString:infoBlock->Name encoding:NSASCIIStringEncoding];
- memID = [[NSString alloc] initWithCString:infoBlock->ID encoding:NSASCIIStringEncoding];
- memIconCount = infoBlock->IconCount;
- memFlags = infoBlock->Flags;
+ self.englishName = [NSString stringWithCString:infoBlock->Title encoding:NSASCIIStringEncoding];
+ self.sjisName = [NSString stringWithCString:infoBlock->sTitle encoding:NSShiftJISStringEncoding];
+ self.memImage = [PcsxrMemoryObject imageFromMcd:infoBlock->Icon];
+ self.memName = [NSString stringWithCString:infoBlock->Name encoding:NSASCIIStringEncoding];
+ self.memID = [NSString stringWithCString:infoBlock->ID encoding:NSASCIIStringEncoding];
+ self.memIconCount = infoBlock->IconCount;
+ self.memFlags = infoBlock->Flags;
if ((infoBlock->Flags & 0xF0) == 0xA0) {
if ((infoBlock->Flags & 0xF) >= 1 &&
(infoBlock->Flags & 0xF) <= 3) {
- notDeleted = NO;
+ self.notDeleted = NO;
} else
- notDeleted = NO;
+ self.notDeleted = NO;
} else if ((infoBlock->Flags & 0xF0) == 0x50)
- notDeleted = YES;
+ self.notDeleted = YES;
else
- notDeleted = NO;
-
+ self.notDeleted = NO;
}
return self;
}
@@ -88,11 +99,11 @@
#if !__has_feature(objc_arc)
- (void)dealloc
{
- [englishName release];
- [sjisName release];
- [memName release];
- [memID release];
- [memImage release];
+ self.englishName = nil;
+ self.sjisName = nil;
+ self.memName = nil;
+ self.memID = nil;
+ self.memImage = nil;
[super dealloc];
}
diff --git a/macosx/PcsxrPlugin.h b/macosx/PcsxrPlugin.h
index bd70854a..01927a51 100755
--- a/macosx/PcsxrPlugin.h
+++ b/macosx/PcsxrPlugin.h
@@ -10,14 +10,14 @@
@interface PcsxrPlugin : NSObject {
- void *pluginRef;
-
- NSString *path;
+ void *pluginRef;
+
+ NSString *path;
NSDate *modDate;
- NSString *name;
+ NSString *name;
NSString *fullPlugPath;
- long version;
- int type;
+ long version;
+ int type;
int active;
}
diff --git a/macosx/PluginController.h b/macosx/PluginController.h
index e04f1525..cd455237 100755
--- a/macosx/PluginController.h
+++ b/macosx/PluginController.h
@@ -5,13 +5,13 @@
@interface PluginController : NSObject
{
- IBOutlet NSButton *aboutButton;
- IBOutlet NSButton *configureButton;
- IBOutlet NSPopUpButton *pluginMenu;
-
- int pluginType;
- NSArray *plugins;
- NSString *defaultKey;
+ IBOutlet NSButton *aboutButton;
+ IBOutlet NSButton *configureButton;
+ IBOutlet NSPopUpButton *pluginMenu;
+
+ int pluginType;
+ NSArray *plugins;
+ NSString *defaultKey;
}
- (IBAction)doAbout:(id)sender;
- (IBAction)doConfigure:(id)sender;
diff --git a/macosx/plugins/DFXVideo/macsrc/PluginGLView.m b/macosx/plugins/DFXVideo/macsrc/PluginGLView.m
index e5899d38..e287c803 100755
--- a/macosx/plugins/DFXVideo/macsrc/PluginGLView.m
+++ b/macosx/plugins/DFXVideo/macsrc/PluginGLView.m
@@ -194,7 +194,7 @@ void BlitScreen16NS(unsigned char * surf,long x,long y)
// Call for a redisplay
noDisplay = YES;
PSXDisplay.Disabled = 1;
- [self setNeedsDisplay:true];
+ [self setNeedsDisplay:YES];
return self;
}