Zak/Indy box matrix fix. Still doesn't quite work :/
svn-id: r3684
This commit is contained in:
parent
ad800009b2
commit
41d1864add
2 changed files with 26 additions and 7 deletions
21
debug.cpp
21
debug.cpp
|
@ -108,15 +108,28 @@ bool ScummDebugger::do_command() {
|
||||||
return true;
|
return true;
|
||||||
case CMD_DUMPBOX:
|
case CMD_DUMPBOX:
|
||||||
{
|
{
|
||||||
int num, i; BoxCoords box;
|
int num, i = 0, rows = 0;
|
||||||
|
BoxCoords box;
|
||||||
|
byte *boxm = _s->getBoxMatrixBaseAddr();
|
||||||
num = _s->getNumBoxes();
|
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; i<num; i++) {
|
for (i=0; i<num; i++) {
|
||||||
printf("bt %d\n", i);
|
|
||||||
BoxTest(i);
|
BoxTest(i);
|
||||||
_s->getBoxCoordinates(i, &box);
|
_s->getBoxCoordinates(i, &box);
|
||||||
printf("%d: [%d x %d] [%d x %d] [%d x %d] [%d x %d]\n", i,
|
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.ul.x, box.ul.y, box.ll.x, box.ll.y,
|
||||||
box.ur.x, box.ur.y, box.lr.x, box.lr.y);
|
box.ur.x, box.ur.y, box.lr.x, box.lr.y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -780,7 +780,13 @@ void Scumm::initRoomSubBlocks() {
|
||||||
ptr = findResourceData(MKID('BOXD'), roomptr);
|
ptr = findResourceData(MKID('BOXD'), roomptr);
|
||||||
if (ptr) {
|
if (ptr) {
|
||||||
byte numOfBoxes=*(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);
|
createResource(rtMatrix, 2, size);
|
||||||
memcpy(getResourceAddress(rtMatrix, 2), ptr, size);
|
memcpy(getResourceAddress(rtMatrix, 2), ptr, size);
|
||||||
ptr += size;
|
ptr += size;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue