aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlyssa Milburn2011-03-31 00:17:33 +0200
committerAlyssa Milburn2011-03-31 00:18:00 +0200
commite5533401dc5c10609072794b596a87a0be2c3786 (patch)
tree5dca1966b83b40e07738c5e9f635004eb5e17da2
parentae58ca42c535a672b9a135d44bafeded86f708be (diff)
downloadscummvm-rg350-e5533401dc5c10609072794b596a87a0be2c3786.tar.gz
scummvm-rg350-e5533401dc5c10609072794b596a87a0be2c3786.tar.bz2
scummvm-rg350-e5533401dc5c10609072794b596a87a0be2c3786.zip
MOHAWK: Nicer names/info for some LB data.
-rw-r--r--engines/mohawk/livingbooks.cpp32
-rw-r--r--engines/mohawk/livingbooks.h17
2 files changed, 30 insertions, 19 deletions
diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp
index 20bedf8be7..de87c7fea6 100644
--- a/engines/mohawk/livingbooks.cpp
+++ b/engines/mohawk/livingbooks.cpp
@@ -2077,22 +2077,22 @@ void LBItem::readData(uint16 type, uint16 size, Common::SeekableSubReadStreamEnd
debug(2, "kLBSetPlayPhase: %d", _phase);
break;
- case kLBUnknown6F:
+ case kLBSetKeyNotify:
{
+ // FIXME: variable-size notifies, targets
if (size != 18)
error("0x6f had wrong size (%d)", size);
- uint u1 = stream->readUint16();
- uint u2 = stream->readUint16();
uint event = stream->readUint16();
+ LBKey key;
+ stream->read(&key, 4);
uint opcode = stream->readUint16();
uint param = stream->readUint16();
uint u6 = stream->readUint16();
uint u7 = stream->readUint16();
uint u8 = stream->readUint16();
uint u9 = stream->readUint16();
- // FIXME: this is scripting stuff
- warning("0x6f: unknown: item %s, unknowns: %04x, %04x, event %04x, opcode %04x, param %04x, unknowns %04x, %04x, %04x, %04x",
- _desc.c_str(), u1, u2, event, opcode, param, u6, u7, u8, u9);
+ warning("ignoring kLBSetKeyNotify: item %s, key code %02x (modifier mask %d, char %d, repeat %d), event %04x, opcode %04x, param %04x, unknowns %04x, %04x, %04x, %04x",
+ _desc.c_str(), key.code, key.modifiers, key.char_, key.repeats, event, opcode, param, u6, u7, u8, u9);
}
break;
@@ -2126,27 +2126,27 @@ void LBItem::readData(uint16 type, uint16 size, Common::SeekableSubReadStreamEnd
_isAmbient = true;
break;
- case kLBUnknown7D:
+ case kLBSetKeyEvent:
{
+ // FIXME: targets
if (size != 10)
- error("0x7d had wrong size (%d)", size);
- uint u1 = stream->readUint16();
- uint key = stream->readUint16();
+ error("kLBSetKeyEvent had wrong size (%d)", size);
uint u3 = stream->readUint16();
+ LBKey key;
+ stream->read(&key, 4);
uint target = stream->readUint16();
- byte event = stream->readByte();
- byte u4 = stream->readByte();
+ uint16 event = stream->readUint16();
// FIXME: this is scripting stuff: what to run when key is pressed
- warning("0x7d: unknown: item %s, unknown %04x, key %04x, unknown %04x, target %d, event %02x, unknown %02x",
- _desc.c_str(), u1, key, u3, target, event, u4);
+ warning("ignoring kLBSetKeyEvent: item %s, key code %02x (modifier mask %d, char %d, repeat %d) unknown %04x, target %d, event %04x",
+ _desc.c_str(), key.code, key.modifiers, key.char_, key.repeats, u3, target, event);
}
break;
- case kLBUnknown80:
+ case kLBSetHitTest:
{
assert(size == 2);
uint id = stream->readUint16();
- warning("0x80: unknown: item %s, id %04x", _desc.c_str(), id);
+ warning("kLBSetHitTest: unknown: item %s, value %04x", _desc.c_str(), id);
// FIXME
}
break;
diff --git a/engines/mohawk/livingbooks.h b/engines/mohawk/livingbooks.h
index 9e4a5e0f33..8eb6f7ed15 100644
--- a/engines/mohawk/livingbooks.h
+++ b/engines/mohawk/livingbooks.h
@@ -42,6 +42,17 @@
namespace Mohawk {
+#define LBKEY_MOD_CTRL 1
+#define LBKEY_MOD_ALT 2
+#define LBKEY_MOD_SHIFT 4
+
+struct LBKey {
+ byte code;
+ byte modifiers;
+ byte char_;
+ byte repeats;
+};
+
enum NodeState {
kLBNodeDone = 0,
kLBNodeRunning = 1,
@@ -152,7 +163,7 @@ enum {
kLBSetOneShot = 0x6d, // unused?
kLBSetPlayPhase = 0x6e,
// from here, 2.x+
- kLBUnknown6F = 0x6f,
+ kLBSetKeyNotify = 0x6f,
kLBCommand = 0x70,
kLBPaletteAData = 0x71, // unused?
kLBPaletteXData = 0x72,
@@ -166,10 +177,10 @@ enum {
kLBGlobalSetVisible = 0x7a, // unused?
kLBSetAmbient = 0x7b,
kLBUnknown7C = 0x7c, // unused?
- kLBUnknown7D = 0x7d,
+ kLBSetKeyEvent = 0x7d,
kLBUnknown7E = 0x7e, // unused? (rect flag)
kLBSetParent = 0x7f, // unused?
- kLBUnknown80 = 0x80, // unused? TODO: sets +36
+ kLBSetHitTest = 0x80,
// from here, rugrats
kLBUnknown194 = 0x194
};