Merge pull request #181 from cxd4/can_haz_ANSI_much_char_very_legit

(Glide64) Try to maintain handling the ROM header ANSI text as ASCII data.
This commit is contained in:
zilmar 2015-03-02 20:11:40 +11:00
commit eb20e30f2e
1 changed files with 15 additions and 3 deletions

View File

@ -1732,14 +1732,26 @@ void CALL RomOpen (void)
// get the name of the ROM
for (int i=0; i<20; i++)
name[i] = gfx.HEADER[(32+i)^3];
name[20] = 0;
{
char ch;
const char invalid_ch = '?'; /* Some Japanese games use wide chars. */
ch = (char)gfx.HEADER[(32 + i) ^ 3];
if (ch == '\0')
ch = ' ';
if (ch < ' ')
ch = invalid_ch;
if (ch > '~')
ch = invalid_ch;
name[i] = ch;
}
name[20] = '\0';
// remove all trailing spaces
while (name[strlen(name)-1] == ' ')
name[strlen(name)-1] = 0;
wxString strRomName = wxString::FromUTF8(name);
wxString strRomName = wxString::FromAscii(name);
if (settings.ghq_use && strRomName != rdp.RomName)
{
ext_ghq_shutdown();