diff options
author | D G Turner | 2012-07-27 03:49:15 +0100 |
---|---|---|
committer | D G Turner | 2012-07-27 03:49:15 +0100 |
commit | f856a0a7466f62ad0bd26484bf5c07c2d01c1461 (patch) | |
tree | 7a5b4a86b12647cb6b5f92905e6b61d03cc0749a | |
parent | 7bc646f8caeab2a25fb1c2cddd9efd34c868443d (diff) | |
download | scummvm-rg350-f856a0a7466f62ad0bd26484bf5c07c2d01c1461.tar.gz scummvm-rg350-f856a0a7466f62ad0bd26484bf5c07c2d01c1461.tar.bz2 scummvm-rg350-f856a0a7466f62ad0bd26484bf5c07c2d01c1461.zip |
TEENAGENT: Add dsAddr symbols for Inventory. Minor fix to logic.
The start address for the inventory item pointer data table was
incorrect and has been corrected.
-rw-r--r-- | engines/teenagent/inventory.cpp | 9 | ||||
-rw-r--r-- | engines/teenagent/resources.h | 6 |
2 files changed, 10 insertions, 5 deletions
diff --git a/engines/teenagent/inventory.cpp b/engines/teenagent/inventory.cpp index 7e8d056220..476e6cdb16 100644 --- a/engines/teenagent/inventory.cpp +++ b/engines/teenagent/inventory.cpp @@ -58,15 +58,14 @@ Inventory::Inventory(TeenAgentEngine *vm) : _vm(vm) { } _offset[92] = items_size; - for (byte i = 0; i <= 92; ++i) { + for (byte i = 0; i < 92; ++i) { InventoryObject io; - uint16 obj_addr = vm->res->dseg.get_word(0xc4a4 + i * 2); - if (obj_addr != 0) - io.load(vm->res->dseg.ptr(obj_addr)); + uint16 obj_addr = vm->res->dseg.get_word(dsAddr_inventoryItemDataPtrTable + i * 2); + io.load(vm->res->dseg.ptr(obj_addr)); _objects.push_back(io); } - _inventory = vm->res->dseg.ptr(0xc48d); + _inventory = vm->res->dseg.ptr(dsAddr_inventory); for (int y = 0; y < 4; ++y) for (int x = 0; x < 6; ++x) { diff --git a/engines/teenagent/resources.h b/engines/teenagent/resources.h index dde34ae36a..c424462a6c 100644 --- a/engines/teenagent/resources.h +++ b/engines/teenagent/resources.h @@ -645,6 +645,12 @@ const uint16 dsAddr_currentScene = 0xb4f3; // 1 byte // Object Combine Error Message : 0xc3e2 to 0xc41e const uint16 dsAddr_objCombineErrorMsg = 0xc3e2; // "Using these two objects ..." +// Inventory (item ids held by Ego) (1 byte * 24) : 0xc48d to 0xc4a4 +const uint16 dsAddr_inventory = 0xc48d; +// 0xc4a5 is null word alignment byte +// Inventory item data address table (2 bytes * 92) : 0xc4a6 to 0xc55d +const uint16 dsAddr_inventoryItemDataPtrTable = 0xc4a6; + // Current Music Id Playing : 0xdb90 const uint16 dsAddr_currentMusic = 0xdb90; // 1 byte // Counter for Mansion Intrusion Attempts : 0xdbea |