Skip to content

Commit

Permalink
Memcard: Remove support for legacy PSX card types with headers
Browse files Browse the repository at this point in the history
Supporting legacy PSX cards with headers required constant size checks, thrashing IOP performance.
  • Loading branch information
RedPanda4552 authored and lightningterror committed Jan 9, 2025
1 parent d3effdb commit 77d5a04
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions pcsx2/SIO/Memcard/MemoryCardFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,24 +360,7 @@ void FileMemoryCard::Close()
// Returns FALSE if the seek failed (is outside the bounds of the file).
bool FileMemoryCard::Seek(std::FILE* f, u32 adr)
{
const s64 size = FileSystem::FSize64(f);

// 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);
return (FileSystem::FSeek64(f, adr, SEEK_SET) == 0);
}

// returns FALSE if an error occurred (either permission denied or disk full)
Expand Down

0 comments on commit 77d5a04

Please sign in to comment.