Fix E4 opcode implemetnation. Now it works

svn-id: r12888
This commit is contained in:
Eugene Sandulenko 2004-02-14 16:09:07 +00:00
parent abdb4fbe87
commit 4e7850b0f1

View file

@ -3115,15 +3115,15 @@ void ScummEngine_v6::o6_unknownE1() {
void ScummEngine_v6::o6_unknownE4() {
int arg = pop();
const byte *room = getResourceAddress(rtRoom, _roomResource);
const byte *boxd = room;
const byte *boxm = room;
const byte *boxd, *boxm;
int32 dboxSize, mboxSize;
ResourceIterator boxds(room, false);
for (int i = 0; i < arg; i++)
boxd = findResource(MKID('BOXD'), boxd);
boxd = boxds.findNext(MKID('BOXD'));
if (!boxd)
error("ScummEngine_v6::o6_unknownE4: Can't find boxes for set %d", arg);
error("ScummEngine_v6::o6_unknownE4: Can't find dboxes for set %d", arg);
dboxSize = READ_BE_UINT32(boxd + 4);
byte *matrix = createResource(rtMatrix, 2, dboxSize);
@ -3131,11 +3131,12 @@ void ScummEngine_v6::o6_unknownE4() {
assert(matrix);
memcpy(matrix, boxd, dboxSize);
ResourceIterator boxms(room, false);
for (int i = 0; i < arg; i++)
boxm = findResource(MKID('BOXM'), boxm);
boxm = boxms.findNext(MKID('BOXM'));
if (!boxm)
error("ScummEngine_v6::o6_unknownE4: Can't find boxes for set %d", arg);
error("ScummEngine_v6::o6_unknownE4: Can't find mboxes for set %d", arg);
mboxSize = READ_BE_UINT32(boxd + 4);
matrix = createResource(rtMatrix, 1, mboxSize);