summaryrefslogtreecommitdiff
path: root/macosx/PcsxrMemoryObject.m
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 /macosx/PcsxrMemoryObject.m
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
Diffstat (limited to 'macosx/PcsxrMemoryObject.m')
-rwxr-xr-xmacosx/PcsxrMemoryObject.m45
1 files changed, 28 insertions, 17 deletions
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];
}