[Scummvm-git-logs] scummvm master -> aed5ff3c8901f398c055eeb9ba99ec0da2da76ec
bluegr
noreply at scummvm.org
Sat Jul 11 12:54:36 UTC 2026
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
aed5ff3c89 NANCY: Add the actionrecord_export console command
Commit: aed5ff3c8901f398c055eeb9ba99ec0da2da76ec
https://github.com/scummvm/scummvm/commit/aed5ff3c8901f398c055eeb9ba99ec0da2da76ec
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-07-11T15:54:26+03:00
Commit Message:
NANCY: Add the actionrecord_export console command
This allows us to export the data chunks of action records, for
inspection and debugging
Changed paths:
engines/nancy/console.cpp
engines/nancy/console.h
diff --git a/engines/nancy/console.cpp b/engines/nancy/console.cpp
index ae1dbc25843..fe3019ce90a 100644
--- a/engines/nancy/console.cpp
+++ b/engines/nancy/console.cpp
@@ -58,6 +58,7 @@ NancyConsole::NancyConsole() : GUI::Debugger() {
registerCmd("load_scene", WRAP_METHOD(NancyConsole, Cmd_loadScene));
registerCmd("scene_id", WRAP_METHOD(NancyConsole, Cmd_sceneID));
registerCmd("list_actionrecords", WRAP_METHOD(NancyConsole, Cmd_listActionRecords));
+ registerCmd("actionrecord_export", WRAP_METHOD(NancyConsole, Cmd_actionRecordExport));
registerCmd("scan_ar_type", WRAP_METHOD(NancyConsole, Cmd_scanForActionRecordType));
registerCmd("get_eventflags", WRAP_METHOD(NancyConsole, Cmd_getEventFlags));
registerCmd("set_eventflags", WRAP_METHOD(NancyConsole, Cmd_setEventFlags));
@@ -665,6 +666,62 @@ bool NancyConsole::Cmd_listActionRecords(int argc, const char **argv) {
return true;
}
+bool NancyConsole::Cmd_actionRecordExport(int argc, const char **argv) {
+ using namespace Action;
+
+ if (argc < 2) {
+ debugPrintf("Exports an action record of the current or a specified scene to a file\n");
+ debugPrintf("Usage: %s <actionRecordID> <sceneID>\n", argv[0]);
+ return true;
+ }
+
+ int recordId = atoi(argv[1]);
+ uint16 sceneId = 0;
+
+ if (argc == 2) {
+ // Export the record from the current scene
+ if (g_nancy->getState() != NancyState::kScene) {
+ debugPrintf("Not in the kScene state\n");
+ return true;
+ }
+
+ sceneId = NancySceneState.getSceneInfo().sceneID;
+ } else if (argc == 3) {
+ // Export a record from a different scene. We need to load all records into a temporary array and read from it
+ sceneId = (uint16)atoi(argv[2]);
+ }
+
+ Common::String s = Common::String::format("S%u", sceneId);
+
+ IFF *sceneIFF = g_nancy->_resource->loadIFF(Common::Path(s));
+ if (!sceneIFF) {
+ debugPrintf("Invalid scene S%s\n", argv[1]);
+ return true;
+ }
+
+ Common::SeekableReadStream *chunk = sceneIFF->getChunkStream("ACT", recordId);
+ if (chunk) {
+ char descBuf[48];
+ chunk->read(descBuf, 48);
+ descBuf[47] = '\0';
+ chunk->skip(2); // ARType, execType
+
+ Common::DumpFile f;
+ Common::String filename = Common::String::format("%s_scene_%d_record_%d_%s.dat", g_nancy->getGameId(), sceneId, recordId, descBuf);
+ f.open(Common::Path(filename));
+ f.writeStream(chunk, chunk->size() - 50);
+ f.close();
+ debugPrintf("Exported record %d (%s) from scene S%u to %s\n", recordId, descBuf, sceneId, filename.c_str());
+ } else {
+ debugPrintf("Invalid record ID %d\n", recordId);
+ }
+ delete chunk;
+
+ delete sceneIFF;
+
+ return true;
+}
+
bool NancyConsole::Cmd_scanForActionRecordType(int argc, const char **argv) {
if (argc < 2 || argc % 2) {
debugPrintf("Scans all IFFs for ActionRecords of the provided type\n");
diff --git a/engines/nancy/console.h b/engines/nancy/console.h
index 849f8430d72..9be301cf610 100644
--- a/engines/nancy/console.h
+++ b/engines/nancy/console.h
@@ -56,6 +56,7 @@ private:
bool Cmd_loadScene(int argc, const char **argv);
bool Cmd_sceneID(int argc, const char **argv);
bool Cmd_listActionRecords(int argc, const char **argv);
+ bool Cmd_actionRecordExport(int argc, const char **argv);
bool Cmd_scanForActionRecordType(int argc, const char **argv);
bool Cmd_getEventFlags(int argc, const char **argv);
bool Cmd_setEventFlags(int argc, const char **argv);
More information about the Scummvm-git-logs
mailing list