aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/debugger.cpp
diff options
context:
space:
mode:
authorathrxx2013-04-07 22:38:25 +0200
committerathrxx2013-04-14 13:12:08 +0200
commit66a3b2b2accffb28b6d4dcb17b8218ab8fb40d66 (patch)
tree66147647580d3917e5c944bd2bf96ebef0bb5e00 /engines/kyra/debugger.cpp
parenta33045f4fa50b9c5d9755ad287e7bc19293db911 (diff)
downloadscummvm-rg350-66a3b2b2accffb28b6d4dcb17b8218ab8fb40d66.tar.gz
scummvm-rg350-66a3b2b2accffb28b6d4dcb17b8218ab8fb40d66.tar.bz2
scummvm-rg350-66a3b2b2accffb28b6d4dcb17b8218ab8fb40d66.zip
KYRA: (EOB) - add debug function to export save files in original format
Diffstat (limited to 'engines/kyra/debugger.cpp')
-rw-r--r--engines/kyra/debugger.cpp53
1 files changed, 52 insertions, 1 deletions
diff --git a/engines/kyra/debugger.cpp b/engines/kyra/debugger.cpp
index c0a91ac098..75981958d6 100644
--- a/engines/kyra/debugger.cpp
+++ b/engines/kyra/debugger.cpp
@@ -483,11 +483,12 @@ Debugger_EoB::Debugger_EoB(EoBCoreEngine *vm) : Debugger(vm), _vm(vm) {
void Debugger_EoB::initialize() {
DCmd_Register("import_savefile", WRAP_METHOD(Debugger_EoB, cmd_importSaveFile));
+ DCmd_Register("save_original", WRAP_METHOD(Debugger_EoB, cmd_saveOriginal));
}
bool Debugger_EoB::cmd_importSaveFile(int argc, const char **argv) {
if (!_vm->_allowImport) {
- DebugPrintf("This command may only be used from the main menu.\n");
+ DebugPrintf("This command only works from the main menu.\n");
return true;
}
@@ -507,6 +508,56 @@ bool Debugger_EoB::cmd_importSaveFile(int argc, const char **argv) {
return true;
}
+bool Debugger_EoB::cmd_saveOriginal(int argc, const char **argv) {
+ if (!_vm->_runFlag) {
+ DebugPrintf("This command doesn't work during intro or outro sequences,\nfrom the main menu or from the character generation.\n");
+ return true;
+ }
+
+ Common::String dir = ConfMan.get("savepath");
+ if (dir == "None")
+ dir.clear();
+
+ Common::FSNode nd(dir);
+ if (!nd.isDirectory())
+ return false;
+
+ if (_vm->game() == GI_EOB1) {
+ if (argc == 1) {
+ if (_vm->saveAsOriginalSaveFile()) {
+ Common::FSNode nf = nd.getChild(Common::String::format("EOBDATA.SAV"));
+ if (nf.isReadable())
+ DebugPrintf("Saved to file: %s\n\n", nf.getPath().c_str());
+ else
+ DebugPrintf("Failure.\n");
+ } else {
+ DebugPrintf("Failure.\n");
+ }
+ } else {
+ DebugPrintf("Syntax: save_original\n (Saves game in original file format to a file which can be used with the orginal game executable.)\n\n");
+ }
+ return true;
+
+ } else if (argc == 2) {
+ int slot = atoi(argv[1]);
+ if (slot < 0 || slot > 5) {
+ DebugPrintf("Slot must be between (including) 0 and 5.\n");
+ } else if (_vm->saveAsOriginalSaveFile(slot)) {
+ Common::FSNode nf = nd.getChild(Common::String::format("EOBDATA%d.SAV", slot));
+ if (nf.isReadable())
+ DebugPrintf("Saved to file: %s\n\n", nf.getPath().c_str());
+ else
+ DebugPrintf("Failure.\n");
+ } else {
+ DebugPrintf("Failure.\n");
+ }
+ return true;
+ }
+
+ DebugPrintf("Syntax: save_original <slot>\n (Saves game in original file format to a file which can be used with the orginal game executable.\n A save slot between 0 and 5 must be specified.)\n\n");
+ return true;
+}
+
#endif // ENABLE_EOB
} // End of namespace Kyra