Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
b7f56efccc | ||
|
7a268ef91c |
22
fscompat.cpp
22
fscompat.cpp
@ -58,20 +58,20 @@ namespace fs = std::filesystem;
|
||||
SplitPath splitpath(string str)
|
||||
{
|
||||
SplitPath output{};
|
||||
fs::path path(str);
|
||||
fs::path path(fs::u8path(str));
|
||||
|
||||
if (path.has_root_name())
|
||||
output.drive = path.root_name().string();
|
||||
output.drive = path.root_name().u8string();
|
||||
|
||||
if (path.has_filename())
|
||||
{
|
||||
output.stem = path.stem().string();
|
||||
output.ext = path.extension().string();
|
||||
output.stem = path.stem().u8string();
|
||||
output.ext = path.extension().u8string();
|
||||
path.remove_filename();
|
||||
}
|
||||
|
||||
if (!path.empty())
|
||||
output.dir = path.string();
|
||||
output.dir = path.u8string();
|
||||
|
||||
return output;
|
||||
}
|
||||
@ -82,16 +82,16 @@ string makepath(const string &drive, const string &dir, const string &stem, cons
|
||||
|
||||
if (dot_position == string::npos)
|
||||
{
|
||||
fs::path path(drive);
|
||||
path = path / dir / stem;
|
||||
fs::path path(fs::u8path(drive));
|
||||
path = path / fs::u8path(dir) / fs::u8path(stem);
|
||||
path.replace_extension(ext);
|
||||
return path.string();
|
||||
return path.u8string();
|
||||
}
|
||||
|
||||
auto filename = stem + ext;
|
||||
fs::path path(drive);
|
||||
path = path / dir / filename;
|
||||
return path.string();
|
||||
fs::path path(fs::u8path(drive));
|
||||
path = path / fs::u8path(dir) / fs::u8path(filename);
|
||||
return path.u8string();
|
||||
}
|
||||
|
||||
#else
|
||||
|
18
memmap.cpp
18
memmap.cpp
@ -2424,6 +2424,7 @@ void CMemory::InitROM (void)
|
||||
|
||||
//// Show ROM information
|
||||
ROMId[4] = 0;
|
||||
strcpy(ROMId, SafeString(ROMId).c_str());
|
||||
|
||||
sprintf(String, "\"%s\" [%s] %s, %s, %s, %s, SRAM:%s, ID:%s, CRC32:%08X",
|
||||
ROMName, isChecksumOK ? "checksum ok" : ((Multi.cartType == 4) ? "no checksum" : "bad checksum"),
|
||||
@ -3500,6 +3501,23 @@ void CMemory::ApplyROMFixes (void)
|
||||
Timings.RenderPos = 32;
|
||||
}
|
||||
|
||||
std::string CMemory::SafeString(std::string s, bool allow_jis /*=false*/)
|
||||
{
|
||||
std::string safe;
|
||||
for (int i = 0; i < s.length(); i++)
|
||||
{
|
||||
if (s[i] >= 32 && s[i] < 127) // ASCII
|
||||
safe += s[i];
|
||||
else
|
||||
if (allow_jis && ROMRegion == 0 && ((uint8)s[i] >= 0xa0 && (uint8)s[i] < 0xe0)) // JIS X 201 - Katakana
|
||||
safe += s[i];
|
||||
else
|
||||
safe += '_';
|
||||
}
|
||||
|
||||
return safe;
|
||||
}
|
||||
|
||||
// BPS % UPS % IPS
|
||||
|
||||
// number decoding used for both BPS and UPS
|
||||
|
Loading…
Reference in New Issue
Block a user