aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorBertrand Augereau2011-06-27 08:53:39 +0200
committerBertrand Augereau2011-07-18 22:59:14 +0200
commitc011bee0e2985b979372397eff650509ba094de0 (patch)
treed1b2eb8b48d0a06ec0701e06dfcf37bfb3a99658 /engines
parent9f8036cd86670a3de8562b7c6e398ddace8650fa (diff)
downloadscummvm-rg350-c011bee0e2985b979372397eff650509ba094de0.tar.gz
scummvm-rg350-c011bee0e2985b979372397eff650509ba094de0.tar.bz2
scummvm-rg350-c011bee0e2985b979372397eff650509ba094de0.zip
DREAMWEB: backobject reversed
Diffstat (limited to 'engines')
-rw-r--r--engines/dreamweb/structs.h15
-rw-r--r--engines/dreamweb/stubs.cpp33
-rw-r--r--engines/dreamweb/stubs.h2
3 files changed, 44 insertions, 6 deletions
diff --git a/engines/dreamweb/structs.h b/engines/dreamweb/structs.h
index 4a887ab9f3..a5ddabf7fe 100644
--- a/engines/dreamweb/structs.h
+++ b/engines/dreamweb/structs.h
@@ -10,7 +10,7 @@ struct Sprite {
uint8 b14;
uint8 b15;
uint16 w16;
- uint8 b18;
+ uint8 delay;
uint8 b19;
uint16 obj_data;
uint8 b22;
@@ -22,3 +22,16 @@ struct Sprite {
uint8 hidden;
};
+struct ObjData {
+ uint8 b0;
+ uint8 b1;
+ uint8 b2;
+ uint8 b3;
+ uint8 b4;
+ uint8 b5;
+ uint8 b6;
+ uint8 delay;
+ uint8 type;
+};
+
+
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index fb7d79275b..b5b88f66e2 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -740,7 +740,7 @@ Sprite* DreamGenContext::makesprite(uint8 x, uint8 y, uint16 updateCallback, uin
WRITE_LE_UINT16(&sprite->w8, somethingInDi);
sprite->w2 = 0xffff;
sprite->b15 = 0;
- sprite->b18 = 0;
+ sprite->delay = 0;
return sprite;
}
@@ -768,7 +768,7 @@ void DreamGenContext::spriteupdate() {
mainmanCPP(sprite);
else {
assert(updateCallback == addr_backobject);
- backobjectCPP(sprite);
+ backobject(sprite);
}
}
@@ -795,7 +795,7 @@ void DreamGenContext::mainmanCPP(Sprite* sprite) {
es = pop();
}
-void DreamGenContext::backobjectCPP(Sprite* sprite) {
+void DreamGenContext::backobject(Sprite* sprite) {
push(es);
push(ds);
@@ -806,7 +806,32 @@ void DreamGenContext::backobjectCPP(Sprite* sprite) {
bx += 32*(sprite-sprites);
//
- backobject();
+ ds = data.word(kSetdat);
+ di = READ_LE_UINT16(&sprite->obj_data);
+ ObjData* objData = (ObjData*)ds.ptr(di, 0);
+
+ if (sprite->delay != 0) {
+ --sprite->delay;
+ ds = pop();
+ es = pop();
+ return;
+ }
+
+ sprite->delay = objData->delay;
+ if (objData->type == 6)
+ widedoor();
+ else if (objData->type == 5)
+ random();
+ else if (objData->type == 4)
+ lockeddoorway();
+ else if (objData->type == 3)
+ liftsprite();
+ else if (objData->type == 2)
+ doorway();
+ else if (objData->type == 1)
+ constant();
+ else
+ steady();
ds = pop();
es = pop();
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 46250fc414..dbedb32640 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -26,7 +26,7 @@
Sprite* makesprite(uint8 x, uint8 y, uint16 updateCallback, uint16 somethingInDx, uint16 somethingInDi);
void spriteupdate();
void mainmanCPP(Sprite* sprite);
- void backobjectCPP(Sprite* sprite);
+ void backobject(Sprite* sprite);
void modifychar();
void lockmon();