diff --git a/debug.cpp b/debug.cpp index 953d6e516db..70c8cc74903 100644 --- a/debug.cpp +++ b/debug.cpp @@ -108,15 +108,28 @@ bool ScummDebugger::do_command() { return true; case CMD_DUMPBOX: { - int num, i; BoxCoords box; - num = _s->getNumBoxes(); - for (i=0; igetBoxMatrixBaseAddr(); + num = _s->getNumBoxes(); + + printf("Walk matrix:\n"); + while (*boxm != 0xFF) { + printf("%d ", *boxm); + i++; *boxm++; + if (i >= num) {i = 0; rows++; printf("\n");} + } + + if (rows < num) + printf("\nERROR: Box Matrix invalid, missing or incomplete: %d row(s)", num - rows); + + printf("\nWalk boxes:\n"); + for (i=0; igetBoxCoordinates(i, &box); printf("%d: [%d x %d] [%d x %d] [%d x %d] [%d x %d]\n", i, - box.ul.x, box.ul.y, box.ll.x, box.ll.y, - box.ur.x, box.ur.y, box.lr.x, box.lr.y); + box.ul.x, box.ul.y, box.ll.x, box.ll.y, + box.ur.x, box.ur.y, box.lr.x, box.lr.y); } } return true; diff --git a/scummvm.cpp b/scummvm.cpp index 246323b02cc..39552332cde 100644 --- a/scummvm.cpp +++ b/scummvm.cpp @@ -780,7 +780,13 @@ void Scumm::initRoomSubBlocks() { ptr = findResourceData(MKID('BOXD'), roomptr); if (ptr) { byte numOfBoxes=*(ptr); - int size = numOfBoxes * SIZEOF_BOX+1; + int size; + if (_features & GF_OLD256) + size = numOfBoxes * (SIZEOF_BOX-2) + 1; + else + size = numOfBoxes * SIZEOF_BOX + 1; + + createResource(rtMatrix, 2, size); memcpy(getResourceAddress(rtMatrix, 2), ptr, size); ptr += size;