diff options
-rwxr-xr-x | devtools/tasmrecover/tasm-recover | 1 | ||||
-rw-r--r-- | engines/dreamweb/backdrop.cpp | 2 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 41 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 3 | ||||
-rw-r--r-- | engines/dreamweb/sprite.cpp | 20 | ||||
-rw-r--r-- | engines/dreamweb/structs.h | 2 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 3 | ||||
-rw-r--r-- | engines/dreamweb/vgagrafx.cpp | 16 |
8 files changed, 33 insertions, 55 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index 75da6715ba..a962d65e2f 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -175,6 +175,7 @@ generator = cpp(context, "DreamGen", blacklist = [ 'transferinv', 'obicons', 'compare', + 'pixelcheckset', ], skip_output = [ # These functions are processed but not output 'dreamweb', diff --git a/engines/dreamweb/backdrop.cpp b/engines/dreamweb/backdrop.cpp index 2c399af3c4..f0e03502dd 100644 --- a/engines/dreamweb/backdrop.cpp +++ b/engines/dreamweb/backdrop.cpp @@ -162,7 +162,7 @@ void DreamGenContext::showallobs() { calcfrframe(); uint16 x, y; finalframe(&x, &y); - setEntry->b17 = setEntry->b18[0]; + setEntry->index = setEntry->b18[0]; if ((setEntry->type == 0) && (setEntry->priority != 5) && (setEntry->priority != 6)) { x += data.word(kMapadx); y += data.word(kMapady); diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index a426cedb73..9c584bea90 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -2657,46 +2657,6 @@ nought: goto palloop; } -void DreamGenContext::pixelcheckset() { - STACK_CHECK; - push(ax); - _sub(al, es.byte(bx)); - _sub(ah, es.byte(bx+1)); - push(es); - push(bx); - push(cx); - push(ax); - al = es.byte(bx+4); - getsetad(); - al = es.byte(bx+17); - es = data.word(kSetframes); - bx = (0); - ah = 0; - cx = 6; - _mul(cx); - _add(bx, ax); - ax = pop(); - push(ax); - al = ah; - ah = 0; - cl = es.byte(bx); - ch = 0; - _mul(cx); - cx = pop(); - ch = 0; - _add(ax, cx); - _add(ax, es.word(bx+2)); - bx = ax; - _add(bx, (0+2080)); - al = es.byte(bx); - dl = al; - cx = pop(); - bx = pop(); - es = pop(); - ax = pop(); - _cmp(dl, 0); -} - void DreamGenContext::createpanel() { STACK_CHECK; di = 0; @@ -17613,7 +17573,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) { case addr_showpcx: showpcx(); break; case addr_loadpalfromiff: loadpalfromiff(); break; case addr_setmode: setmode(); break; - case addr_pixelcheckset: pixelcheckset(); break; case addr_createpanel: createpanel(); break; case addr_createpanel2: createpanel2(); break; case addr_vsync: vsync(); break; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 3b680025cd..2b8174cc79 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -559,7 +559,6 @@ public: static const uint16 addr_vsync = 0xc208; static const uint16 addr_createpanel2 = 0xc200; static const uint16 addr_createpanel = 0xc1fc; - static const uint16 addr_pixelcheckset = 0xc1f8; static const uint16 addr_setmode = 0xc1dc; static const uint16 addr_loadpalfromiff = 0xc1d8; static const uint16 addr_showpcx = 0xc1cc; @@ -1618,7 +1617,7 @@ public: void playchannel0(); void usemon(); void steady(); - void pixelcheckset(); + //void pixelcheckset(); void reexfrominv(); void examinventory(); void talk(); diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp index c2ec27739c..7b41bbddab 100644 --- a/engines/dreamweb/sprite.cpp +++ b/engines/dreamweb/sprite.cpp @@ -297,7 +297,7 @@ void DreamGenContext::constant(Sprite *sprite, SetObject *objData) { sprite->frame = 0; } uint8 b18 = objData->b18[sprite->frame]; - objData->b17 = b18; + objData->index = b18; sprite->b15 = b18; } @@ -361,7 +361,7 @@ void DreamGenContext::dodoor(Sprite *sprite, SetObject *objData) { if (objData->b18[sprite->frame] == 255) { --sprite->frame; } - sprite->b15 = objData->b17 = objData->b18[sprite->frame]; + sprite->b15 = objData->index = objData->b18[sprite->frame]; data.byte(kThroughdoor) = 1; return; shutdoor: @@ -375,14 +375,14 @@ shutdoor: if (sprite->frame != 0) { --sprite->frame; } - sprite->b15 = objData->b17 = objData->b18[sprite->frame]; + sprite->b15 = objData->index = objData->b18[sprite->frame]; if (sprite->frame == 5) //nearly data.byte(kThroughdoor) = 0; } void DreamGenContext::steady(Sprite *sprite, SetObject *objData) { uint8 b18 = objData->b18[0]; - objData->b17 = b18; + objData->index = b18; sprite->b15 = b18; } @@ -426,7 +426,7 @@ void DreamGenContext::lockeddoorway(Sprite *sprite, SetObject *objData) { --sprite->frame; } - sprite->b15 = objData->b17 = objData->b18[sprite->frame]; + sprite->b15 = objData->index = objData->b18[sprite->frame]; if (sprite->frame == 5) data.byte(kThroughdoor) = 1; return; @@ -442,7 +442,7 @@ shutdoor2: } data.byte(kThroughdoor) = 0; - sprite->b15 = objData->b17 = objData->b18[sprite->frame]; + sprite->b15 = objData->index = objData->b18[sprite->frame]; if (sprite->frame == 0) { turnpathoffCPP(data.byte(kDoorpath)); @@ -461,7 +461,7 @@ void DreamGenContext::liftsprite(Sprite *sprite, SetObject *objData) { data.byte(kLiftflag) = 3; } sprite->frame = 0; - sprite->b15 = objData->b17 = objData->b18[sprite->frame]; + sprite->b15 = objData->index = objData->b18[sprite->frame]; } else if (liftFlag == 1) { //liftopen turnpathonCPP(data.byte(kLiftpath)); @@ -472,7 +472,7 @@ void DreamGenContext::liftsprite(Sprite *sprite, SetObject *objData) { data.byte(kLiftflag) = 2; } sprite->frame = 12; - sprite->b15 = objData->b17 = objData->b18[sprite->frame]; + sprite->b15 = objData->index = objData->b18[sprite->frame]; } else if (liftFlag == 3) { //openlift if (sprite->frame == 12) { @@ -484,7 +484,7 @@ void DreamGenContext::liftsprite(Sprite *sprite, SetObject *objData) { al = 2; liftnoise(); } - sprite->b15 = objData->b17 = objData->b18[sprite->frame]; + sprite->b15 = objData->index = objData->b18[sprite->frame]; } else { //closeLift assert(liftFlag == 2); if (sprite->frame == 0) { @@ -496,7 +496,7 @@ void DreamGenContext::liftsprite(Sprite *sprite, SetObject *objData) { al = 3; liftnoise(); } - sprite->b15 = objData->b17 = objData->b18[sprite->frame]; + sprite->b15 = objData->index = objData->b18[sprite->frame]; } } diff --git a/engines/dreamweb/structs.h b/engines/dreamweb/structs.h index 9b8d823491..07419459a6 100644 --- a/engines/dreamweb/structs.h +++ b/engines/dreamweb/structs.h @@ -85,7 +85,7 @@ struct SetObject { uint8 b11; uint8 name[4]; uint8 b16; - uint8 b17; + uint8 index; uint8 b18[13]; // NB: Don't know the size yet uint8 b31; uint8 b32; diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index ede60259a4..d085fb880b 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -210,4 +210,7 @@ void obicons(); void compare(); bool compare(uint8 index, uint8 flag, const char id[4]); + void pixelcheckset(); + bool pixelcheckset(ObjPos *pos, uint8 x, uint8 y); + diff --git a/engines/dreamweb/vgagrafx.cpp b/engines/dreamweb/vgagrafx.cpp index ee05ebfc15..8d437c2c73 100644 --- a/engines/dreamweb/vgagrafx.cpp +++ b/engines/dreamweb/vgagrafx.cpp @@ -455,5 +455,21 @@ void DreamGenContext::transferinv() { data.word(kExframepos) += byteCount; } +void DreamGenContext::pixelcheckset() { + uint8 x = al; + uint8 y = ah; + ObjPos *pos = (ObjPos *)es.ptr(bx, sizeof(ObjPos)); + flags._z = !pixelcheckset(pos, x, y); +} + +bool DreamGenContext::pixelcheckset(ObjPos *pos, uint8 x, uint8 y) { + x -= pos->xMin; + y -= pos->yMin; + SetObject *setObject = getsetad(pos->index); + Frame *frame = (Frame *)segRef(data.word(kSetframes)).ptr(kFramedata, 0) + setObject->index; + const uint8 *ptr = segRef(data.word(kSetframes)).ptr(kFrames, 0) + frame->ptr() + y * frame->width + x; + return *ptr != 0; +} + } /*namespace dreamgen */ |