MemoryCardImage: Implement save file importing and exporting

This commit is contained in:
Albert Liu
2021-03-04 20:50:20 -08:00
parent e939507f42
commit 50a78489f2
4 changed files with 146 additions and 5 deletions

View File

@ -7,8 +7,7 @@
#include <string_view>
#include <vector>
namespace MemoryCardImage
{
namespace MemoryCardImage {
enum : u32
{
DATA_SIZE = 128 * 1024, // 1mbit
@ -17,7 +16,7 @@ enum : u32
FRAMES_PER_BLOCK = BLOCK_SIZE / FRAME_SIZE,
NUM_BLOCKS = DATA_SIZE / BLOCK_SIZE,
NUM_FRAMES = DATA_SIZE / FRAME_SIZE,
ICON_WIDTH =16,
ICON_WIDTH = 16,
ICON_HEIGHT = 16
};
@ -50,4 +49,6 @@ bool ReadFile(const DataArray& data, const FileInfo& fi, std::vector<u8>* buffer
bool WriteFile(DataArray* data, const std::string_view& filename, const std::vector<u8>& buffer);
bool DeleteFile(DataArray* data, const FileInfo& fi);
bool ImportCard(DataArray* data, const char* filename);
}
bool ExportSave(DataArray* data, const FileInfo& fi, const char* filename);
bool ImportSave(DataArray* data, const char* filename);
} // namespace MemoryCardImage