From 5b664c684367676c028adf91c1b64acaf8d434ab Mon Sep 17 00:00:00 2001 From: "SND\\MaddTheSane_cp" Date: Sat, 26 Nov 2011 04:11:09 +0000 Subject: 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 --- macosx/PcsxrMemCardController.m | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'macosx/PcsxrMemCardController.m') 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]; } -- cgit v1.2.3