aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBertrand Augereau2011-07-27 17:53:50 +0200
committerBertrand Augereau2011-07-28 17:26:48 +0200
commitfe73a2407820000d0321173a50e0d98dbcfc213f (patch)
tree7fb4c14ca83eb821008b08d5e8057fb127cc58c2
parentb5c6ac150b81d49dad0a9d2f6327cb85a7c525ff (diff)
downloadscummvm-rg350-fe73a2407820000d0321173a50e0d98dbcfc213f.tar.gz
scummvm-rg350-fe73a2407820000d0321173a50e0d98dbcfc213f.tar.bz2
scummvm-rg350-fe73a2407820000d0321173a50e0d98dbcfc213f.zip
DREAMWEB: 'makebackob' ported
-rwxr-xr-xdevtools/tasmrecover/tasm-recover1
-rw-r--r--engines/dreamweb/dreamgen.cpp35
-rw-r--r--engines/dreamweb/dreamgen.h3
-rw-r--r--engines/dreamweb/structs.h3
-rw-r--r--engines/dreamweb/stubs.cpp23
-rw-r--r--engines/dreamweb/stubs.h1
6 files changed, 28 insertions, 38 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index e0b0e21394..f550cb0826 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -75,6 +75,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'cancelch0',
'cancelch1',
'getroomspaths',
+ 'makebackob',
'facerightway',
])
generator.generate('dreamweb') #start routine
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 182a4411dd..9fa7f16995 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -7476,40 +7476,6 @@ blankframe:
goto showobsloop;
}
-void DreamGenContext::makebackob() {
- STACK_CHECK;
- _cmp(data.byte(kNewobs), 0);
- if (flags.z())
- return /* (nomake) */;
- al = es.byte(si+5);
- ah = es.byte(si+8);
- push(si);
- push(ax);
- push(si);
- ax = data.word(kObjectx);
- bx = data.word(kObjecty);
- ah = bl;
- si = ax;
- cx = 49520;
- dx = data.word(kSetframes);
- di = (0);
- makesprite();
- ax = pop();
- es.word(bx+20) = ax;
- ax = pop();
- _cmp(al, 255);
- if (!flags.z())
- goto usedpriority;
- al = 0;
-usedpriority:
- es.byte(bx+23) = al;
- es.byte(bx+30) = ah;
- es.byte(bx+16) = 0;
- es.byte(bx+18) = 0;
- es.byte(bx+19) = 0;
- si = pop();
-}
-
void DreamGenContext::showallfree() {
STACK_CHECK;
es = data.word(kBuffers);
@@ -21046,7 +21012,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
case addr_addlength: addlength(); break;
case addr_drawflags: drawflags(); break;
case addr_showallobs: showallobs(); break;
- case addr_makebackob: makebackob(); break;
case addr_showallfree: showallfree(); break;
case addr_showallex: showallex(); break;
case addr_calcfrframe: calcfrframe(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 130e0f0b5b..2b7149621b 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -505,7 +505,6 @@ public:
static const uint16 addr_calcfrframe = 0xc454;
static const uint16 addr_showallex = 0xc450;
static const uint16 addr_showallfree = 0xc44c;
- static const uint16 addr_makebackob = 0xc448;
static const uint16 addr_showallobs = 0xc444;
static const uint16 addr_drawflags = 0xc43c;
static const uint16 addr_addlength = 0xc438;
@@ -1559,7 +1558,7 @@ public:
void discops();
//void printdirect();
void delthisone();
- void makebackob();
+ //void makebackob();
void middlepanel();
void dumpwatch();
void saveload();
diff --git a/engines/dreamweb/structs.h b/engines/dreamweb/structs.h
index e274375cf4..ac304ae2c2 100644
--- a/engines/dreamweb/structs.h
+++ b/engines/dreamweb/structs.h
@@ -31,7 +31,8 @@ struct Sprite {
uint16 w12;
uint8 b14;
uint8 b15;
- uint16 w16;
+ uint8 b16;
+ uint8 b17;
uint8 delay;
uint8 frame;
uint16 obj_data;
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 140e278d1d..8c278b5990 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -825,5 +825,28 @@ uint8 *DreamGenContext::getroomspathsCPP() {
return (uint8 *)result;
}
+void DreamGenContext::makebackob() {
+ if (data.byte(kNewobs) == 0)
+ return;
+ uint8 priority = es.byte(si+5);
+ uint8 type = es.byte(si+8);
+ Sprite *sprite = makesprite(data.word(kObjectx), data.word(kObjecty), addr_backobject, data.word(kSetframes), 0);
+
+ // Recover es:bx from sprite
+ es = data.word(kBuffers);
+ bx = kSpritetable;
+ Sprite *sprites = (Sprite *)es.ptr(bx, sizeof(Sprite) * 16);
+ bx += sizeof(Sprite) * (sprite - sprites);
+ //
+ WRITE_LE_UINT16(&sprite->obj_data, si);
+ if (priority == 255)
+ priority = 0;
+ sprite->priority = priority;
+ sprite->type = type;
+ sprite->b16 = 0;
+ sprite->delay = 0;
+ sprite->frame = 0;
+}
+
} /*namespace dreamgen */
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 559c95625d..e72229639b 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -90,6 +90,7 @@
void turnpathoffCPP(uint8 param);
void getroomspaths();
uint8 *getroomspathsCPP();
+ void makebackob();
void modifychar();
void lockmon();
void cancelch0();