mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-18 05:05:46 -04:00
Add option to dump the contents of RAM to a file
This commit is contained in:
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
|
Reference in New Issue
Block a user