mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-27 00:00:07 -06:00
BAHAHAHAHAAHAHAHhh
This commit is contained in:
@ -56,7 +56,8 @@ FATStorage::FATStorage()
|
|||||||
|
|
||||||
FATStorage::~FATStorage()
|
FATStorage::~FATStorage()
|
||||||
{
|
{
|
||||||
//
|
printf("SAVING DLDI SHIT\n");
|
||||||
|
Save("dldi");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -298,7 +299,7 @@ void FATStorage::ExportDirectory(std::string path, std::string outbase, int leve
|
|||||||
fDIR dir;
|
fDIR dir;
|
||||||
FILINFO info;
|
FILINFO info;
|
||||||
FRESULT res;
|
FRESULT res;
|
||||||
|
printf("EXPORTING DIRECTORY %s (base %s level %d)\n", path.c_str(), outbase.c_str(), level);
|
||||||
std::string fullpath = "0:/" + path;
|
std::string fullpath = "0:/" + path;
|
||||||
res = f_opendir(&dir, fullpath.c_str());
|
res = f_opendir(&dir, fullpath.c_str());
|
||||||
if (res != FR_OK) return;
|
if (res != FR_OK) return;
|
||||||
@ -332,7 +333,7 @@ void FATStorage::ExportDirectory(std::string path, std::string outbase, int leve
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
bool doexport = false;
|
bool doexport = false;
|
||||||
|
printf("- FILE %s\n", fullpath.c_str());
|
||||||
if (FileIndex.count(fullpath) < 1)
|
if (FileIndex.count(fullpath) < 1)
|
||||||
{
|
{
|
||||||
doexport = true;
|
doexport = true;
|
||||||
@ -866,3 +867,39 @@ bool FATStorage::Build(const char* sourcedir, u64 size, const char* filename)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool FATStorage::Save(std::string sourcedir)
|
||||||
|
{
|
||||||
|
FF_File = Platform::OpenLocalFile(FilePath.c_str(), "r+b");
|
||||||
|
if (!FF_File)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
FF_FileSize = FileSize;
|
||||||
|
ff_disk_open(FF_ReadStorage, FF_WriteStorage, (LBA_t)(FileSize>>9));
|
||||||
|
|
||||||
|
FRESULT res;
|
||||||
|
FATFS fs;
|
||||||
|
|
||||||
|
res = f_mount(&fs, "0:", 1);
|
||||||
|
if (res != FR_OK)
|
||||||
|
{
|
||||||
|
ff_disk_close();
|
||||||
|
fclose(FF_File);
|
||||||
|
FF_File = nullptr;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
ExportChanges("dldi");
|
||||||
|
|
||||||
|
SaveIndex();
|
||||||
|
|
||||||
|
f_unmount("0:");
|
||||||
|
|
||||||
|
ff_disk_close();
|
||||||
|
fclose(FF_File);
|
||||||
|
FF_File = nullptr;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
@ -58,7 +58,9 @@ private:
|
|||||||
void CleanupDirectory(std::string path, int level);
|
void CleanupDirectory(std::string path, int level);
|
||||||
bool ImportFile(std::string path, std::string in);
|
bool ImportFile(std::string path, std::string in);
|
||||||
bool BuildSubdirectory(const char* sourcedir, const char* path, int level);
|
bool BuildSubdirectory(const char* sourcedir, const char* path, int level);
|
||||||
|
|
||||||
bool Build(const char* sourcedir, u64 size, const char* filename);
|
bool Build(const char* sourcedir, u64 size, const char* filename);
|
||||||
|
bool Save(std::string sourcedir);
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
@ -1178,7 +1178,10 @@ CartHomebrew::CartHomebrew(u8* rom, u32 len, u32 chipid) : CartCommon(rom, len,
|
|||||||
CartHomebrew::~CartHomebrew()
|
CartHomebrew::~CartHomebrew()
|
||||||
{
|
{
|
||||||
if (SDFile) fclose(SDFile);
|
if (SDFile) fclose(SDFile);
|
||||||
if (test) delete test;
|
if (test)
|
||||||
|
{
|
||||||
|
delete test;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CartHomebrew::Reset()
|
void CartHomebrew::Reset()
|
||||||
|
Reference in New Issue
Block a user