MemoryCardImage: Handle 128KB GME files

This commit is contained in:
Stenzek 2024-04-07 17:06:42 +10:00
parent 1ee5f737ed
commit 8bdeb8bdac
No known key found for this signature in database

View file

@ -516,6 +516,10 @@ bool MemoryCardImage::ImportCardGME(DataArray* data, const char* filename, std::
static_assert(sizeof(GMEHeader) == 0xF40); static_assert(sizeof(GMEHeader) == 0xF40);
#pragma pack(pop) #pragma pack(pop)
// some gme files are raw files in disguise...
if (file_data.size() == DATA_SIZE)
return ImportCardMCD(data, filename, std::move(file_data), error);
constexpr u32 MIN_SIZE = sizeof(GMEHeader) + BLOCK_SIZE; constexpr u32 MIN_SIZE = sizeof(GMEHeader) + BLOCK_SIZE;
if (file_data.size() < MIN_SIZE) if (file_data.size() < MIN_SIZE)