aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Snover2016-12-18 21:18:23 -0600
committerColin Snover2016-12-19 12:47:48 -0600
commit20c211192dcdff42189cc6c3fbe948beb65c1e8e (patch)
treef376653eed138305e6914ef2edff8d735f30475d
parent8637cfc617d57bb9ea1e3f81f16c7b4f9f5b38ee (diff)
downloadscummvm-rg350-20c211192dcdff42189cc6c3fbe948beb65c1e8e.tar.gz
scummvm-rg350-20c211192dcdff42189cc6c3fbe948beb65c1e8e.tar.bz2
scummvm-rg350-20c211192dcdff42189cc6c3fbe948beb65c1e8e.zip
SCI32: Add segment table debugging info for SCI32 arrays
-rw-r--r--engines/sci/console.cpp9
-rw-r--r--engines/sci/engine/segment.h23
2 files changed, 31 insertions, 1 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index 63a1f0c2ec..412dfaf184 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -2213,9 +2213,16 @@ bool Console::segmentInfo(int nr) {
break;
#ifdef ENABLE_SCI32
- case SEG_TYPE_ARRAY:
+ case SEG_TYPE_ARRAY: {
+ ArrayTable &table = *(ArrayTable *)mobj;
debugPrintf("SCI32 arrays\n");
+ for (uint i = 0; i < table.size(); ++i) {
+ if (table.isValidEntry(i)) {
+ debugPrintf(" [%04x] %s\n", i, table[i].toDebugString().c_str());
+ }
+ }
break;
+ }
case SEG_TYPE_BITMAP: {
BitmapTable &table = *(BitmapTable *)mobj;
diff --git a/engines/sci/engine/segment.h b/engines/sci/engine/segment.h
index 7c415f3bb3..dda0189a77 100644
--- a/engines/sci/engine/segment.h
+++ b/engines/sci/engine/segment.h
@@ -855,6 +855,29 @@ public:
Common::strlcpy((char *)_data, string.c_str(), string.size() + 1);
}
+ Common::String toDebugString() const {
+ const char *type;
+ switch(_type) {
+ case kArrayTypeID:
+ type = "reg_t";
+ break;
+ case kArrayTypeByte:
+ type = "byte";
+ break;
+ case kArrayTypeInt16:
+ type = "int16";
+ break;
+ case kArrayTypeString:
+ type = "string";
+ break;
+ case kArrayTypeInvalid:
+ type = "invalid";
+ break;
+ }
+
+ return Common::String::format("type %s; %u entries; %u bytes", type, size(), byteSize());
+ }
+
protected:
void *_data;
SciArrayType _type;