From 7feee6f616e56e96cccdee173abb994a6d0bf91c Mon Sep 17 00:00:00 2001 From: "SND\\MaddTheSane_cp" Date: Mon, 8 Jul 2013 07:26:30 +0000 Subject: Various updates and improvements to OS X code. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@85894 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- macosx/PcsxrMemCardArray.m | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'macosx/PcsxrMemCardArray.m') diff --git a/macosx/PcsxrMemCardArray.m b/macosx/PcsxrMemCardArray.m index b3b8ce41..3ceb8566 100644 --- a/macosx/PcsxrMemCardArray.m +++ b/macosx/PcsxrMemCardArray.m @@ -37,8 +37,10 @@ static inline char* CreateBlankHeader() unsigned char checksum; }; struct PSXMemHeader *toReturn = calloc(sizeof(struct PSXMemHeader), 1); - + + //FIXME: Which value is right? toReturn->allocState = 0x000000a0; + //toReturn->allocState = 0xa0000000; toReturn->nextBlock = 0xFFFF; unsigned char *bytePtr = (unsigned char*)toReturn; for (int i = 0; i < sizeof(struct PSXMemHeader) - sizeof(unsigned char); i++) { @@ -60,10 +62,8 @@ static inline void ClearMemcardData(char *to, int dsti, char *str) // data memset(to + (dsti + 1) * 1024 * 8, 0, 1024 * 8); SaveMcd(str, to, (dsti + 1) * 1024 * 8, 1024 * 8); - } - @interface PcsxrMemCardArray () @property (arcretain) NSArray *rawArray; @property (readonly) char* memDataPtr; @@ -72,7 +72,6 @@ static inline void ClearMemcardData(char *to, int dsti, char *str) @implementation PcsxrMemCardArray @synthesize rawArray; -//@synthesize memDataPtr; - (char*)memDataPtr { @@ -195,6 +194,7 @@ static inline void ClearMemcardData(char *to, int dsti, char *str) if (toCopy == -1) { NSLog(@"Not enough consecutive blocks. Compacting the other card."); [otherCard compactMemory]; + //Since we're accessing the mem card data directly (instead of via PcsxrMemoryObject objects) using the following calls, we don't need to reload the data. toCopy = [otherCard indexOfFreeBlocksWithSize:memSize]; NSAssert(toCopy != -1, @"Compacting the card should have made space!"); } @@ -297,9 +297,6 @@ static inline void ClearMemcardData(char *to, int dsti, char *str) } LoadMcd(cardNumber, (char*)self.memCardCPath); -#if 0 - [[NSNotificationCenter defaultCenter] postNotificationName:memChangeNotifier object:nil userInfo:[NSDictionary dictionaryWithObject:@(cardNumber) forKey:memCardChangeNumberKey]]; -#endif } - (void)deleteMemoryBlocksAtIndex:(int)slotnum -- cgit v1.2.3