diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2014-07-20 22:56:13 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2014-07-20 22:56:13 +0000 |
| commit | 994de0b66c8885d30ece648aa4342301e630d27a (patch) | |
| tree | 930fc28fda760214c2718d67ccabc05bd0aff4db /macosx/Psx-Memcard/GetMetadataForFile.m | |
| parent | d6942932d64a02aa92b1e04e91f6126f33fdb05e (diff) | |
| download | pcsxr-994de0b66c8885d30ece648aa4342301e630d27a.tar.gz | |
OS X: put back the code that condenses the Shift-JIS Roman characters into their ASCII values.
Can't figure out how to set the metadata language variants properly. Just use the Japanese strings instead.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@91005 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/Psx-Memcard/GetMetadataForFile.m')
| -rw-r--r-- | macosx/Psx-Memcard/GetMetadataForFile.m | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/macosx/Psx-Memcard/GetMetadataForFile.m b/macosx/Psx-Memcard/GetMetadataForFile.m index 9a0e2961..ac0722a7 100644 --- a/macosx/Psx-Memcard/GetMetadataForFile.m +++ b/macosx/Psx-Memcard/GetMetadataForFile.m @@ -40,9 +40,9 @@ static void GetSoloBlockInfo(unsigned char *data, int block, McdBlock *Info) { unsigned char *ptr = data + block * 8192 + 2; unsigned char *str = Info->Title; + unsigned char * sstr = Info->sTitle; unsigned short c; - unsigned short jisTitle[48] = {0}; - int i; + int i, x = 0; memset(Info, 0, sizeof(McdBlock)); Info->IconCount = *ptr & 0x3; @@ -53,7 +53,7 @@ static void GetSoloBlockInfo(unsigned char *data, int block, McdBlock *Info) c |= *(ptr + 1); if (!c) break; - jisTitle[i] = CFSwapInt16BigToHost(c); + // Convert ASCII characters to half-width if (c >= 0x8281 && c <= 0x829A) { c = (c - 0x8281) + 'a'; @@ -89,15 +89,17 @@ static void GetSoloBlockInfo(unsigned char *data, int block, McdBlock *Info) c = '-'; } else { str[i] = ' '; + sstr[x++] = *ptr++; + sstr[x++] = *ptr++; continue; } - str[i] = c; + str[i] = sstr[x++] = c; ptr += 2; } - memcpy(Info->sTitle, jisTitle, sizeof(jisTitle)); ptr = data + block * 128; + Info->Flags = *ptr; ptr += 0xa; @@ -136,7 +138,7 @@ Boolean GetMetadataForFile(void *thisInterface, CFMutableDictionaryRef attribute NSCharacterSet *theCharSet = [NSCharacterSet whitespaceAndNewlineCharacterSet]; short freeBlocks = MAX_MEMCARD_BLOCKS; short memCount = 0; - NSMutableArray *enNames = [[NSMutableArray alloc] initWithCapacity:MAX_MEMCARD_BLOCKS]; + //NSMutableArray *enNames = [[NSMutableArray alloc] initWithCapacity:MAX_MEMCARD_BLOCKS]; NSMutableArray *jpNames = [[NSMutableArray alloc] initWithCapacity:MAX_MEMCARD_BLOCKS]; NSMutableArray *memNames = [[NSMutableArray alloc] initWithCapacity:MAX_MEMCARD_BLOCKS]; NSMutableArray *memIDs = [[NSMutableArray alloc] initWithCapacity:MAX_MEMCARD_BLOCKS]; @@ -158,7 +160,7 @@ Boolean GetMetadataForFile(void *thisInterface, CFMutableDictionaryRef attribute while (i < MAX_MEMCARD_BLOCKS) { x = 1; McdBlock memBlock; - NSString *enName; + //NSString *enName; NSString *jpName; NSString *memName; NSString *memID; @@ -189,20 +191,19 @@ Boolean GetMetadataForFile(void *thisInterface, CFMutableDictionaryRef attribute } memCount++; freeBlocks -= x; - enName = [@(memBlock.Title) stringByTrimmingCharactersInSet:theCharSet]; + //enName = [@(memBlock.Title) stringByTrimmingCharactersInSet:theCharSet]; jpName = [[NSString alloc] initWithCString:memBlock.sTitle encoding:NSShiftJISStringEncoding]; jpName = [jpName stringByTrimmingCharactersInSet:theCharSet]; memName = @(memBlock.Name); memID = @(memBlock.ID); - [enNames addObject:enName]; + //[enNames addObject:enName]; [jpNames addObject:jpName]; [memNames addObject:memName]; [memIDs addObject:memID]; } - attr[kPCSXRSaveNames] = @{@"en": enNames, - @"ja": jpNames}; + attr[kPCSXRSaveNames] = jpNames; attr[kPCSXRMemCount] = @(memCount); attr[kPCSXRFreeBlocks] = @(freeBlocks); attr[kPCSXRMemNames] = memNames; |
