mirror of https://github.com/PCSX2/pcsx2.git
Memcard: Remove support for legacy PSX card types with headers
Supporting legacy PSX cards with headers required constant size checks, thrashing IOP performance.
This commit is contained in:
parent
d3effdb176
commit
77d5a04aa4
|
@ -360,24 +360,7 @@ void FileMemoryCard::Close()
|
||||||
// Returns FALSE if the seek failed (is outside the bounds of the file).
|
// Returns FALSE if the seek failed (is outside the bounds of the file).
|
||||||
bool FileMemoryCard::Seek(std::FILE* f, u32 adr)
|
bool FileMemoryCard::Seek(std::FILE* f, u32 adr)
|
||||||
{
|
{
|
||||||
const s64 size = FileSystem::FSize64(f);
|
return (FileSystem::FSeek64(f, adr, SEEK_SET) == 0);
|
||||||
|
|
||||||
// If anyone knows why this filesize logic is here (it appears to be related to legacy PSX
|
|
||||||
// cards, perhaps hacked support for some special emulator-specific memcard formats that
|
|
||||||
// had header info?), then please replace this comment with something useful. Thanks! -- air
|
|
||||||
|
|
||||||
u32 offset = 0;
|
|
||||||
|
|
||||||
if (size == MCD_SIZE + 64)
|
|
||||||
offset = 64;
|
|
||||||
else if (size == MCD_SIZE + 3904)
|
|
||||||
offset = 3904;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// perform sanity checks here?
|
|
||||||
}
|
|
||||||
|
|
||||||
return (FileSystem::FSeek64(f, adr + offset, SEEK_SET) == 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns FALSE if an error occurred (either permission denied or disk full)
|
// returns FALSE if an error occurred (either permission denied or disk full)
|
||||||
|
|
Loading…
Reference in New Issue