diff options
Diffstat (limited to 'sky/disk.cpp')
-rw-r--r-- | sky/disk.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sky/disk.cpp b/sky/disk.cpp index 876afb2194..cabc6155a4 100644 --- a/sky/disk.cpp +++ b/sky/disk.cpp @@ -203,3 +203,21 @@ uint16 *SkyState::getFileInfo(uint16 fileNr) { return (uint16 *)NULL; } +void SkyState::dumpFile(uint16 fileNr) { + char buf[128]; + File out; + byte* filePtr; + + filePtr = (byte *)loadFile(fileNr, NULL); + sprintf(buf, "dumps/file-%d.dmp", fileNr); + + out.open(buf, "", 1); + if (out.isOpen() == false) { + out.open(buf, "", 2); + if (out.isOpen() == false) + return; + out.write(filePtr, _lastLoadedFileSize); + } + out.close(); + free(filePtr); +} |