Add option to dump the contents of RAM to a file

This commit is contained in:
Connor McLaughlin
2020-08-16 23:20:36 +10:00
parent 0aefdf4753
commit 4e62b32d60
8 changed files with 68 additions and 2 deletions

View File

@ -1228,6 +1228,15 @@ void UpdateMemoryCards()
}
}
bool DumpRAM(const char* filename)
{
auto fp = FileSystem::OpenManagedCFile(filename, "wb");
if (!fp)
return false;
return std::fwrite(Bus::g_ram, Bus::RAM_SIZE, 1, fp.get()) == 1;
}
bool HasMedia()
{
return g_cdrom.HasMedia();
@ -1333,7 +1342,8 @@ bool RemoveMediaPathFromPlaylist(u32 index)
if (GetMediaPlaylistIndex() == index)
{
g_host_interface->AddFormattedOSDMessage(10.0f, "Removing current media from playlist, removing media from CD-ROM.");
g_host_interface->AddFormattedOSDMessage(10.0f,
"Removing current media from playlist, removing media from CD-ROM.");
g_cdrom.RemoveMedia();
}

View File

@ -104,6 +104,9 @@ void UpdateControllerSettings();
void ResetControllers();
void UpdateMemoryCards();
/// Dumps RAM to a file.
bool DumpRAM(const char* filename);
bool HasMedia();
bool InsertMedia(const char* path);
void RemoveMedia();