summaryrefslogtreecommitdiff
path: root/libpcsxcore/sio.c
diff options
context:
space:
mode:
authorSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-05-23 02:46:22 +0000
committerSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-05-23 02:46:22 +0000
commit7c4427cb435c50b2772d69521b34c4979a950ea8 (patch)
tree52c0e0fc9623660319910d224cdd5fccbea519b4 /libpcsxcore/sio.c
parente5644f52a124e136027a0bc4c2359579b3ded432 (diff)
downloadpcsxr-7c4427cb435c50b2772d69521b34c4979a950ea8.tar.gz
show japanese titles properly in memcard manager
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@48556 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'libpcsxcore/sio.c')
-rw-r--r--libpcsxcore/sio.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/libpcsxcore/sio.c b/libpcsxcore/sio.c
index 3b2c3d6f..f0655cd9 100644
--- a/libpcsxcore/sio.c
+++ b/libpcsxcore/sio.c
@@ -670,15 +670,13 @@ void ConvertMcd(char *mcd, char *data) {
}
void GetMcdBlockInfo(int mcd, int block, McdBlock *Info) {
- unsigned char *data = NULL, *ptr, *str;
+ unsigned char *data = NULL, *ptr, *str, *sstr;
unsigned short clut[16];
unsigned short c;
int i, x;
memset(Info, 0, sizeof(McdBlock));
- str = Info->Title;
-
if (mcd == 1) data = Mcd1Data;
if (mcd == 2) data = Mcd2Data;
@@ -688,34 +686,42 @@ void GetMcdBlockInfo(int mcd, int block, McdBlock *Info) {
ptr += 2;
- i = 0;
- memcpy(Info->sTitle, ptr, 48*2);
+ x = 0;
+
+ str = Info->Title;
+ sstr = Info->sTitle;
for (i = 0; i < 48; i++) {
c = *(ptr) << 8;
- c|= *(ptr + 1);
+ c |= *(ptr + 1);
if (!c) break;
+ // Convert ASCII characters to half-width
if (c >= 0x8281 && c <= 0x8298)
c = (c - 0x8281) + 'a';
else if (c >= 0x824F && c <= 0x827A)
c = (c - 0x824F) + '0';
+ else if (c == 0x8140) c = ' ';
else if (c == 0x8144) c = '.';
else if (c == 0x8146) c = ':';
+ else if (c == 0x815E) c = '/';
else if (c == 0x8168) c = '"';
else if (c == 0x8169) c = '(';
else if (c == 0x816A) c = ')';
else if (c == 0x816D) c = '[';
else if (c == 0x816E) c = ']';
else if (c == 0x817C) c = '-';
- else c = ' ';
+ else {
+ str[i] = ' ';
+ sstr[x++] = *ptr++; sstr[x++] = *ptr++;
+ continue;
+ }
- str[i] = c;
+ str[i] = sstr[x++] = c;
ptr += 2;
}
- str[i] = 0;
- ptr = data + block * 8192 + 0x60; // icon palete data
+ ptr = data + block * 8192 + 0x60; // icon palette data
for (i = 0; i < 16; i++) {
clut[i] = *((unsigned short *)ptr);
@@ -740,7 +746,6 @@ void GetMcdBlockInfo(int mcd, int block, McdBlock *Info) {
ptr += 0xa;
strncpy(Info->ID, ptr, 12);
- Info->ID[12] = 0;
ptr += 12;
strncpy(Info->Name, ptr, 16);
}