summaryrefslogtreecommitdiff
path: root/macosx/PcsxrMemCardController.m
diff options
context:
space:
mode:
authorSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2011-11-26 04:11:09 +0000
committerSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2011-11-26 04:11:09 +0000
commit5b664c684367676c028adf91c1b64acaf8d434ab (patch)
treee4c1055a45fd8d68bbe2f841a4eaa85e04e129ed /macosx/PcsxrMemCardController.m
parent27e74d5981c2b963587c96c958b47b2f8ad16e48 (diff)
downloadpcsxr-5b664c684367676c028adf91c1b64acaf8d434ab.tar.gz
Fixed off-by-one bug.
Show if a block is deleted or not. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@72646 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/PcsxrMemCardController.m')
-rw-r--r--macosx/PcsxrMemCardController.m13
1 files changed, 12 insertions, 1 deletions
diff --git a/macosx/PcsxrMemCardController.m b/macosx/PcsxrMemCardController.m
index 785393aa..0aef7ee6 100644
--- a/macosx/PcsxrMemCardController.m
+++ b/macosx/PcsxrMemCardController.m
@@ -130,13 +130,24 @@ static inline void CopyMemcardData(char *from, char *to, int *i, char *str, int
NSMutableArray *newArray = [[NSMutableArray alloc] initWithCapacity:MAX_MEMCARD_BLOCKS];
for (i = 0; i < MAX_MEMCARD_BLOCKS; i++) {
- GetMcdBlockInfo(theCard, i, &info);
+ GetMcdBlockInfo(theCard, i + 1, &info);
PcsxrMemoryObject *ob = [[PcsxrMemoryObject alloc] init];
ob.englishName = [NSString stringWithCString:info.Title encoding:NSASCIIStringEncoding];
ob.sjisName = [NSString stringWithCString:info.sTitle encoding:NSShiftJISStringEncoding];
ob.memImage = imageFromMcd(info.Icon);
ob.memNumber = i;
ob.memFlags = info.Flags;
+ if ((info.Flags & 0xF0) == 0xA0) {
+ if ((info.Flags & 0xF) >= 1 &&
+ (info.Flags & 0xF) <= 3) {
+ ob.deleted = YES;
+ } else
+ ob.deleted = YES;
+ } else if ((info.Flags & 0xF0) == 0x50)
+ ob.deleted = NO;
+ else
+ ob.deleted = YES;
+
[newArray insertObject:ob atIndex:i];
[ob release];
}