summaryrefslogtreecommitdiff
path: root/macosx/PcsxrMemCardArray.m
diff options
context:
space:
mode:
authorSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-07-08 07:26:30 +0000
committerSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-07-08 07:26:30 +0000
commit7feee6f616e56e96cccdee173abb994a6d0bf91c (patch)
treec7c4e0c243b93eae9ecd0a23e011aac412ab1fec /macosx/PcsxrMemCardArray.m
parent673809f1f115c90558b87df1529f9e3c9acc1270 (diff)
downloadpcsxr-7feee6f616e56e96cccdee173abb994a6d0bf91c.tar.gz
Various updates and improvements to OS X code.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@85894 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/PcsxrMemCardArray.m')
-rw-r--r--macosx/PcsxrMemCardArray.m11
1 files changed, 4 insertions, 7 deletions
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