Remove incorrect usage of "ASCII" and "ANSI"
Windows-1252 was sometimes being referred to as ASCII or ANSI in Dolphin, which is incorrect. ASCII is only a subset of Windows-1252, and ANSI is (rather improperly) used in Windows to refer to the current code page (which often is 1252 on Western systems, but can also be something entirely different). The commit also replaces "SJIS" with "Shift JIS". "SJIS" isn't misleading, but "Shift JIS" is more commonly used.
This commit is contained in:
parent
4ebd369218
commit
0f1ce0e1f4
|
@ -1,4 +1,4 @@
|
|||
The two fonts in this directory (font_ansi.bin and font_sjis.bin) were
|
||||
The two fonts in this directory (font_western.bin and font_japanese.bin) were
|
||||
generated using gc-font-tool which can be found in the docs/ directory in the
|
||||
dolphin source code.
|
||||
|
||||
|
|
|
@ -144,8 +144,8 @@ is intended for debugging purposes only.
|
|||
## Sys Files
|
||||
|
||||
* `totaldb.dsy`: Database of symbols (for devs only)
|
||||
* `GC/font_ansi.bin`: font dumps
|
||||
* `GC/font_sjis.bin`: font dumps
|
||||
* `GC/font_western.bin`: font dumps
|
||||
* `GC/font_japanese.bin`: font dumps
|
||||
* `GC/dsp_coef.bin`: DSP dumps
|
||||
* `GC/dsp_rom.bin`: DSP dumps
|
||||
* `Wii/clientca.pem`: Wii network certificate
|
||||
|
|
|
@ -106,8 +106,8 @@
|
|||
// Sys files
|
||||
#define TOTALDB "totaldb.dsy"
|
||||
|
||||
#define FONT_ANSI "font_ansi.bin"
|
||||
#define FONT_SJIS "font_sjis.bin"
|
||||
#define FONT_WINDOWS_1252 "font_western.bin"
|
||||
#define FONT_SHIFT_JIS "font_japanese.bin"
|
||||
|
||||
#define DSP_IROM "dsp_rom.bin"
|
||||
#define DSP_COEF "dsp_coef.bin"
|
||||
|
|
|
@ -101,8 +101,8 @@ CEXIIPL::CEXIIPL() : m_uPosition(0), m_uAddress(0), m_uRWOffset(0), m_FontsLoade
|
|||
m_bNTSC ? sizeof(iplverNTSC) : sizeof(iplverPAL));
|
||||
|
||||
// Load fonts
|
||||
LoadFontFile((File::GetSysDirectory() + GC_SYS_DIR + DIR_SEP + FONT_SJIS), 0x1aff00);
|
||||
LoadFontFile((File::GetSysDirectory() + GC_SYS_DIR + DIR_SEP + FONT_ANSI), 0x1fcf00);
|
||||
LoadFontFile((File::GetSysDirectory() + GC_SYS_DIR + DIR_SEP + FONT_SHIFT_JIS), 0x1aff00);
|
||||
LoadFontFile((File::GetSysDirectory() + GC_SYS_DIR + DIR_SEP + FONT_WINDOWS_1252), 0x1fcf00);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -199,12 +199,12 @@ void CEXIIPL::LoadFontFile(const std::string& filename, u32 offset)
|
|||
if (!stream)
|
||||
return;
|
||||
|
||||
// Official Windows-1252 and SJIS fonts present on the IPL dumps are 0x2575 and 0x4a24d bytes
|
||||
// long respectively, so, determine the size of the font being loaded based on the offset
|
||||
// Official Windows-1252 and Shift JIS fonts present on the IPL dumps are 0x2575 and 0x4a24d
|
||||
// bytes long respectively, so, determine the size of the font being loaded based on the offset
|
||||
u64 fontsize = (offset == 0x1aff00) ? 0x4a24d : 0x2575;
|
||||
|
||||
INFO_LOG(BOOT, "Found IPL dump, loading %s font from %s",
|
||||
((offset == 0x1aff00) ? "SJIS" : "Windows-1252"), (ipl_rom_path).c_str());
|
||||
((offset == 0x1aff00) ? "Shift JIS" : "Windows-1252"), (ipl_rom_path).c_str());
|
||||
|
||||
stream.Seek(offset, 0);
|
||||
stream.ReadBytes(m_pIPL + offset, fontsize);
|
||||
|
@ -374,9 +374,16 @@ void CEXIIPL::TransferByte(u8& _uByte)
|
|||
|
||||
if ((position >= 0x001AFF00) && (position <= 0x001FF474) && !m_FontsLoaded)
|
||||
{
|
||||
PanicAlertT("Error: Trying to access %s fonts but they are not loaded. "
|
||||
"Games may not show fonts correctly, or crash.",
|
||||
(position >= 0x001FCF00) ? "ANSI" : "SJIS");
|
||||
if (position >= 0x001FCF00)
|
||||
{
|
||||
PanicAlertT("Error: Trying to access Windows-1252 fonts but they are not loaded. "
|
||||
"Games may not show fonts correctly, or crash.");
|
||||
}
|
||||
else
|
||||
{
|
||||
PanicAlertT("Error: Trying to access Shift JIS fonts but they are not loaded. "
|
||||
"Games may not show fonts correctly, or crash.");
|
||||
}
|
||||
m_FontsLoaded = true; // Don't be a nag :p
|
||||
}
|
||||
}
|
||||
|
|
|
@ -171,12 +171,12 @@ void CEXIMemoryCard::SetupGciFolder(u16 sizeMb)
|
|||
country_code = DiscIO::CountrySwitch(game_id.at(3));
|
||||
CurrentGameId = BE32((u8*)game_id.c_str());
|
||||
}
|
||||
bool ascii = true;
|
||||
bool shift_jis = false;
|
||||
std::string strDirectoryName = File::GetUserPath(D_GCUSER_IDX);
|
||||
switch (country_code)
|
||||
{
|
||||
case DiscIO::Country::COUNTRY_JAPAN:
|
||||
ascii = false;
|
||||
shift_jis = true;
|
||||
strDirectoryName += JAP_DIR DIR_SEP;
|
||||
break;
|
||||
case DiscIO::Country::COUNTRY_USA:
|
||||
|
@ -203,7 +203,7 @@ void CEXIMemoryCard::SetupGciFolder(u16 sizeMb)
|
|||
if (region == JAP_DIR)
|
||||
{
|
||||
country_code = DiscIO::Country::COUNTRY_JAPAN;
|
||||
ascii = false;
|
||||
shift_jis = true;
|
||||
strDirectoryName += JAP_DIR DIR_SEP;
|
||||
break;
|
||||
}
|
||||
|
@ -243,7 +243,7 @@ void CEXIMemoryCard::SetupGciFolder(u16 sizeMb)
|
|||
}
|
||||
|
||||
memorycard = std::make_unique<GCMemcardDirectory>(strDirectoryName + DIR_SEP, card_index, sizeMb,
|
||||
ascii, country_code, CurrentGameId);
|
||||
shift_jis, country_code, CurrentGameId);
|
||||
}
|
||||
|
||||
void CEXIMemoryCard::SetupRawMemcard(u16 sizeMb)
|
||||
|
|
|
@ -22,7 +22,7 @@ static void ByteSwap(u8* valueA, u8* valueB)
|
|||
*valueB = tmp;
|
||||
}
|
||||
|
||||
GCMemcard::GCMemcard(const std::string& filename, bool forceCreation, bool ascii)
|
||||
GCMemcard::GCMemcard(const std::string& filename, bool forceCreation, bool shift_jis)
|
||||
: m_valid(false), m_fileName(filename)
|
||||
{
|
||||
// Currently there is a string freeze. instead of adding a new message about needing r/w
|
||||
|
@ -34,9 +34,10 @@ GCMemcard::GCMemcard(const std::string& filename, bool forceCreation, bool ascii
|
|||
{
|
||||
if (!AskYesNoT("\"%s\" does not exist.\n Create a new 16MB Memcard?", filename.c_str()))
|
||||
return;
|
||||
ascii = AskYesNoT("Format as ASCII (NTSC\\PAL)?\nChoose no for Shift JIS (NTSC-J)");
|
||||
shift_jis =
|
||||
AskYesNoT("Format as Shift JIS (Japanese)?\nChoose no for Windows-1252 (Western)");
|
||||
}
|
||||
Format(ascii);
|
||||
Format(shift_jis);
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
@ -226,9 +227,9 @@ void GCMemcard::InitDirBatPointers()
|
|||
}
|
||||
}
|
||||
|
||||
bool GCMemcard::IsAsciiEncoding() const
|
||||
bool GCMemcard::IsShiftJIS() const
|
||||
{
|
||||
return hdr.Encoding == 0;
|
||||
return hdr.Encoding == 1;
|
||||
}
|
||||
|
||||
bool GCMemcard::Save()
|
||||
|
@ -1223,14 +1224,14 @@ u32 GCMemcard::ReadAnimRGBA8(u8 index, u32* buffer, u8* delays) const
|
|||
return frames;
|
||||
}
|
||||
|
||||
bool GCMemcard::Format(u8* card_data, bool ascii, u16 SizeMb)
|
||||
bool GCMemcard::Format(u8* card_data, bool shift_jis, u16 SizeMb)
|
||||
{
|
||||
if (!card_data)
|
||||
return false;
|
||||
memset(card_data, 0xFF, BLOCK_SIZE * 3);
|
||||
memset(card_data + BLOCK_SIZE * 3, 0, BLOCK_SIZE * 2);
|
||||
|
||||
*((Header*)card_data) = Header(SLOT_A, SizeMb, ascii);
|
||||
*((Header*)card_data) = Header(SLOT_A, SizeMb, shift_jis);
|
||||
|
||||
*((Directory*)(card_data + BLOCK_SIZE)) = Directory();
|
||||
*((Directory*)(card_data + BLOCK_SIZE * 2)) = Directory();
|
||||
|
@ -1239,7 +1240,7 @@ bool GCMemcard::Format(u8* card_data, bool ascii, u16 SizeMb)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool GCMemcard::Format(bool ascii, u16 SizeMb)
|
||||
bool GCMemcard::Format(bool shift_jis, u16 SizeMb)
|
||||
{
|
||||
memset(&hdr, 0xFF, BLOCK_SIZE);
|
||||
memset(&dir, 0xFF, BLOCK_SIZE);
|
||||
|
@ -1247,7 +1248,7 @@ bool GCMemcard::Format(bool ascii, u16 SizeMb)
|
|||
memset(&bat, 0, BLOCK_SIZE);
|
||||
memset(&bat_backup, 0, BLOCK_SIZE);
|
||||
|
||||
hdr = Header(SLOT_A, SizeMb, ascii);
|
||||
hdr = Header(SLOT_A, SizeMb, shift_jis);
|
||||
dir = dir_backup = Directory();
|
||||
bat = bat_backup = BlockAlloc(SizeMb);
|
||||
|
||||
|
|
|
@ -126,11 +126,11 @@ struct Header // Offset Size Description
|
|||
// Nintendo format algorithm.
|
||||
// Constants are fixed by the GC SDK
|
||||
// Changing the constants will break memory card support
|
||||
Header(int slot = 0, u16 sizeMb = MemCard2043Mb, bool ascii = true)
|
||||
Header(int slot = 0, u16 sizeMb = MemCard2043Mb, bool shift_jis = false)
|
||||
{
|
||||
memset(this, 0xFF, BLOCK_SIZE);
|
||||
*(u16*)SizeMb = BE16(sizeMb);
|
||||
Encoding = BE16(ascii ? 0 : 1);
|
||||
Encoding = BE16(shift_jis ? 1 : 0);
|
||||
u64 rand = CEXIIPL::GetEmulatedTime(CEXIIPL::GC_EPOCH);
|
||||
formatTime = Common::swap64(rand);
|
||||
for (int i = 0; i < 12; i++)
|
||||
|
@ -308,12 +308,12 @@ private:
|
|||
void InitDirBatPointers();
|
||||
|
||||
public:
|
||||
GCMemcard(const std::string& fileName, bool forceCreation = false, bool sjis = false);
|
||||
GCMemcard(const std::string& fileName, bool forceCreation = false, bool shift_jis = false);
|
||||
bool IsValid() const { return m_valid; }
|
||||
bool IsAsciiEncoding() const;
|
||||
bool IsShiftJIS() const;
|
||||
bool Save();
|
||||
bool Format(bool ascii = true, u16 SizeMb = MemCard2043Mb);
|
||||
static bool Format(u8* card_data, bool ascii = true, u16 SizeMb = MemCard2043Mb);
|
||||
bool Format(bool shift_jis = false, u16 SizeMb = MemCard2043Mb);
|
||||
static bool Format(u8* card_data, bool shift_jis = false, u16 SizeMb = MemCard2043Mb);
|
||||
static s32 FZEROGX_MakeSaveGameValid(Header& cardheader, DEntry& direntry,
|
||||
std::vector<GCMBlock>& FileBuffer);
|
||||
static s32 PSO_MakeSaveGameValid(Header& cardheader, DEntry& direntry,
|
||||
|
|
|
@ -146,9 +146,10 @@ int GCMemcardDirectory::LoadGCI(const std::string& fileName, DiscIO::Country car
|
|||
}
|
||||
|
||||
GCMemcardDirectory::GCMemcardDirectory(const std::string& directory, int slot, u16 sizeMb,
|
||||
bool ascii, DiscIO::Country card_region, int gameId)
|
||||
: MemoryCardBase(slot, sizeMb), m_GameId(gameId), m_LastBlock(-1), m_hdr(slot, sizeMb, ascii),
|
||||
m_bat1(sizeMb), m_saves(0), m_SaveDirectory(directory), m_exiting(false)
|
||||
bool shift_jis, DiscIO::Country card_region, int gameId)
|
||||
: MemoryCardBase(slot, sizeMb), m_GameId(gameId), m_LastBlock(-1),
|
||||
m_hdr(slot, sizeMb, shift_jis), m_bat1(sizeMb), m_saves(0), m_SaveDirectory(directory),
|
||||
m_exiting(false)
|
||||
{
|
||||
// Use existing header data if available
|
||||
if (File::Exists(m_SaveDirectory + MC_HDR))
|
||||
|
|
|
@ -23,7 +23,7 @@ class GCMemcardDirectory : public MemoryCardBase, NonCopyable
|
|||
{
|
||||
public:
|
||||
GCMemcardDirectory(const std::string& directory, int slot = 0, u16 sizeMb = MemCard2043Mb,
|
||||
bool ascii = true,
|
||||
bool shift_jis = false,
|
||||
DiscIO::Country card_region = DiscIO::Country::COUNTRY_EUROPE, int gameId = 0);
|
||||
~GCMemcardDirectory();
|
||||
void FlushToFile();
|
||||
|
|
|
@ -735,7 +735,7 @@ bool CMemcardManager::ReloadMemcard(const std::string& fileName, int card)
|
|||
std::string title = memoryCard[card]->GetSaveComment1(fileIndex);
|
||||
std::string comment = memoryCard[card]->GetSaveComment2(fileIndex);
|
||||
|
||||
auto const string_decoder = memoryCard[card]->IsAsciiEncoding() ? CP1252ToUTF8 : SHIFTJISToUTF8;
|
||||
auto const string_decoder = memoryCard[card]->IsShiftJIS() ? SHIFTJISToUTF8 : CP1252ToUTF8;
|
||||
|
||||
wxTitle = StrToWxStr(string_decoder(title));
|
||||
wxComment = StrToWxStr(string_decoder(comment));
|
||||
|
|
|
@ -100,8 +100,8 @@ const int FNT_PIXMAP_WIDTH = 512; // Must be >= CELL_SIZE * CELLS_PER_ROW
|
|||
// The two types of font which can be generated
|
||||
enum class font_type
|
||||
{
|
||||
ansi,
|
||||
sjis,
|
||||
windows_1252,
|
||||
shift_jis,
|
||||
};
|
||||
|
||||
#define SEQUENCE_4(x) (x), (x)+1, (x)+2, (x)+3
|
||||
|
@ -110,8 +110,8 @@ enum class font_type
|
|||
#define SEQUENCE_32(x) SEQUENCE_16(x), SEQUENCE_16((x)+16)
|
||||
#define SEQUENCE_64(x) SEQUENCE_32(x), SEQUENCE_32((x)+32)
|
||||
|
||||
// List of unicode codepoints appearing in the ANSI font
|
||||
const uint16_t ansi_font_table[] =
|
||||
// List of unicode codepoints appearing in the Windows-1252 font
|
||||
const uint16_t windows_1252_font_table[] =
|
||||
{
|
||||
SEQUENCE_32(0x20),
|
||||
SEQUENCE_64(0x40),
|
||||
|
@ -124,10 +124,10 @@ const uint16_t ansi_font_table[] =
|
|||
SEQUENCE_64(0xC0),
|
||||
};
|
||||
|
||||
// List of unicode codepoints appearing in the SJIS font
|
||||
const uint16_t sjis_font_table[] =
|
||||
// List of unicode codepoints appearing in the Shift JIS font
|
||||
const uint16_t shift_jis_font_table[] =
|
||||
{
|
||||
// Starts at SJIS 0x8740. Any holes are skipped over.
|
||||
// Starts at Shift JIS 0x8740. Any holes are skipped over.
|
||||
0x3000, 0x3001, 0x3002, 0xFF0C, 0xFF0E, 0x30FB, 0xFF1A, 0xFF1B,
|
||||
0xFF1F, 0xFF01, 0x309B, 0x309C, 0x00B4, 0xFF40, 0x00A8, 0xFF3E,
|
||||
0xFFE3, 0xFF3F, 0x30FD, 0x30FE, 0x309D, 0x309E, 0x3003, 0x4EDD,
|
||||
|
@ -1117,9 +1117,9 @@ static std::vector<uint8_t> generate_fnt(
|
|||
{
|
||||
std::vector<uint8_t> out;
|
||||
|
||||
write_be16(out, type == font_type::ansi ? 0 : 2);
|
||||
write_be16(out, type == font_type::ansi ? 0x0020 : 0x8140);
|
||||
write_be16(out, type == font_type::ansi ? 0x00FF : 0x9872);
|
||||
write_be16(out, type == font_type::windows_1252 ? 0 : 2);
|
||||
write_be16(out, type == font_type::windows_1252 ? 0x0020 : 0x8140);
|
||||
write_be16(out, type == font_type::windows_1252 ? 0x00FF : 0x9872);
|
||||
write_be16(out, 0x20);
|
||||
write_be16(out, FNT_CELL_SIZE);
|
||||
write_be16(out, 0x00);
|
||||
|
@ -1237,15 +1237,15 @@ static std::vector<uint8_t> freetype_to_fnt(const std::vector<uint8_t>& font_buf
|
|||
const uint16_t* font_table;
|
||||
unsigned font_table_size;
|
||||
|
||||
if (type == font_type::ansi)
|
||||
if (type == font_type::windows_1252)
|
||||
{
|
||||
font_table = ansi_font_table;
|
||||
font_table_size = sizeof(ansi_font_table) / 2;
|
||||
font_table = windows_1252_font_table;
|
||||
font_table_size = sizeof(windows_1252_font_table) / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
font_table = sjis_font_table;
|
||||
font_table_size = sizeof(sjis_font_table) / 2;
|
||||
font_table = shift_jis_font_table;
|
||||
font_table_size = sizeof(shift_jis_font_table) / 2;
|
||||
}
|
||||
|
||||
// Generate pixmap
|
||||
|
@ -1268,8 +1268,8 @@ static void usage()
|
|||
std::cerr << "gc-font-tool <mode> <input> <output>" << std::endl;
|
||||
std::cerr << " c = compress using yay0" << std::endl;
|
||||
std::cerr << " d = decompress a yay0 file" << std::endl;
|
||||
std::cerr << " a = generate an ansi gamecube font file from a true type font" << std::endl;
|
||||
std::cerr << " s = generate a sjis gamecube font file from a true type font" << std::endl;
|
||||
std::cerr << " a = generate a windows-1252 gamecube font file from a true type font" << std::endl;
|
||||
std::cerr << " s = generate a shift jis gamecube font file from a true type font" << std::endl;
|
||||
std::cerr << " b = like a, but do not dither the final image" << std::endl;
|
||||
std::cerr << " t = like s, but do not dither the final image" << std::endl;
|
||||
std::cerr << " v = generate a bitmap showing the contents of a gamecube font file" << std::endl;
|
||||
|
@ -1350,10 +1350,10 @@ int main(int argc, char* argv[])
|
|||
{
|
||||
case 'c': result = yay0_compress(input); break;
|
||||
case 'd': result = yay0_decompress(input); break;
|
||||
case 'a': result = freetype_to_fnt(input, font_type::ansi, true); break;
|
||||
case 's': result = freetype_to_fnt(input, font_type::sjis, true); break;
|
||||
case 'b': result = freetype_to_fnt(input, font_type::ansi, false); break;
|
||||
case 't': result = freetype_to_fnt(input, font_type::sjis, false); break;
|
||||
case 'a': result = freetype_to_fnt(input, font_type::windows_1252, true); break;
|
||||
case 's': result = freetype_to_fnt(input, font_type::shift_jis, true); break;
|
||||
case 'b': result = freetype_to_fnt(input, font_type::windows_1252, false); break;
|
||||
case 't': result = freetype_to_fnt(input, font_type::shift_jis, false); break;
|
||||
case 'v': result = fnt_to_bmp(input); break;
|
||||
default:
|
||||
usage();
|
||||
|
|
Loading…
Reference in New Issue