aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdevtools/tasmrecover/tasm-recover4
-rw-r--r--engines/dreamweb/dreamgen.cpp152
-rw-r--r--engines/dreamweb/sprite.cpp12
-rw-r--r--engines/dreamweb/stubs.h2
4 files changed, 14 insertions, 156 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 278e4465d5..4ad926f241 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -80,6 +80,8 @@ generator = cpp(context, "DreamGen", blacklist = [
'facerightway',
], skip_output = [
# These functions are processed but not output
- 'dreamweb'
+ 'dreamweb',
+ 'backobject',
+ 'mainman',
])
generator.generate('dreamweb') #start routine
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index fbd7c079e0..ed9481fb13 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -2258,104 +2258,6 @@ over1001:
data.word(kTakeoff) = 320;
}
-void DreamGenContext::mainman() {
- STACK_CHECK;
- _cmp(data.byte(kResetmanxy), 1);
- if (!flags.z())
- goto notinnewroom;
- data.byte(kResetmanxy) = 0;
- al = data.byte(kRyanx);
- ah = data.byte(kRyany);
- es.word(bx+10) = ax;
- es.byte(bx+29) = 0;
- goto executewalk;
-notinnewroom:
- _dec(es.byte(bx+22));
- _cmp(es.byte(bx+22), -1);
- if (flags.z())
- goto executewalk;
- return;
-executewalk:
- es.byte(bx+22) = 0;
- al = data.byte(kTurntoface);
- _cmp(al, data.byte(kFacing));
- if (flags.z())
- goto facingok;
- aboutturn();
- goto notwalk;
-facingok:
- _cmp(data.byte(kTurndirection), 0);
- if (flags.z())
- goto alreadyturned;
- _cmp(data.byte(kLinepointer), 254);
- if (!flags.z())
- goto alreadyturned;
- data.byte(kReasseschanges) = 1;
- al = data.byte(kFacing);
- _cmp(al, data.byte(kLeavedirection));
- if (!flags.z())
- goto alreadyturned;
- checkforexit();
-alreadyturned:
- data.byte(kTurndirection) = 0;
- _cmp(data.byte(kLinepointer), 254);
- if (!flags.z())
- goto walkman;
- es.byte(bx+29) = 0;
- goto notwalk;
-walkman:
- al = es.byte(bx+29);
- _inc(al);
- _cmp(al, 11);
- if (!flags.z())
- goto notanimend1;
- al = 1;
-notanimend1:
- es.byte(bx+29) = al;
- walking();
- _cmp(data.byte(kLinepointer), 254);
- if (flags.z())
- goto afterwalk;
- al = data.byte(kFacing);
- _and(al, 1);
- if (flags.z())
- goto isdouble;
- al = es.byte(bx+29);
- _cmp(al, 2);
- if (flags.z())
- goto afterwalk;
- _cmp(al, 7);
- if (flags.z())
- goto afterwalk;
-isdouble:
- walking();
-afterwalk:
- _cmp(data.byte(kLinepointer), 254);
- if (!flags.z())
- goto notwalk;
- al = data.byte(kTurntoface);
- _cmp(al, data.byte(kFacing));
- if (!flags.z())
- goto notwalk;
- data.byte(kReasseschanges) = 1;
- al = data.byte(kFacing);
- _cmp(al, data.byte(kLeavedirection));
- if (!flags.z())
- goto notwalk;
- checkforexit();
-notwalk:
- al = data.byte(kFacing);
- ah = 0;
- di = 1105;
- _add(di, ax);
- al = cs.byte(di);
- _add(al, es.byte(bx+29));
- es.byte(bx+15) = al;
- ax = es.word(bx+10);
- data.byte(kRyanx) = al;
- data.byte(kRyany) = ah;
-}
-
void DreamGenContext::aboutturn() {
STACK_CHECK;
_cmp(data.byte(kTurndirection), 1);
@@ -2841,60 +2743,6 @@ isthunder1:
playchannel1();
}
-void DreamGenContext::backobject() {
- STACK_CHECK;
- ds = data.word(kSetdat);
- di = es.word(bx+20);
- al = es.byte(bx+18);
- _cmp(al, 0);
- if (flags.z())
- goto _tmp48z;
- _dec(al);
- es.byte(bx+18) = al;
- return /* (finishback) */;
-_tmp48z:
- al = ds.byte(di+7);
- es.byte(bx+18) = al;
- al = ds.byte(di+8);
- _cmp(al, 6);
- if (!flags.z())
- goto notwidedoor;
- widedoor();
- return /* (finishback) */;
-notwidedoor:
- _cmp(al, 5);
- if (!flags.z())
- goto notrandom;
- random();
- return /* (finishback) */;
-notrandom:
- _cmp(al, 4);
- if (!flags.z())
- goto notlockdoor;
- lockeddoorway();
- return /* (finishback) */;
-notlockdoor:
- _cmp(al, 3);
- if (!flags.z())
- goto notlift;
- liftsprite();
- return /* (finishback) */;
-notlift:
- _cmp(al, 2);
- if (!flags.z())
- goto notdoor;
- doorway();
- return /* (finishback) */;
-notdoor:
- _cmp(al, 1);
- if (!flags.z())
- goto steadyob;
- constant();
- return /* (finishback) */;
-steadyob:
- steady();
-}
-
void DreamGenContext::liftnoise() {
STACK_CHECK;
_cmp(data.byte(kReallocation), 5);
diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp
index d6347b62bf..76755a007e 100644
--- a/engines/dreamweb/sprite.cpp
+++ b/engines/dreamweb/sprite.cpp
@@ -115,7 +115,7 @@ void DreamGenContext::spriteupdate() {
if (updateCallback != 0xffff) {
sprite->w24 = sprite->w2;
if (updateCallback == addr_mainman) // NB : Let's consider the callback as an enum while more code is not ported to C++
- mainmanCPP(sprite);
+ mainman(sprite);
else {
assert(updateCallback == addr_backobject);
backobject(sprite);
@@ -135,7 +135,11 @@ void DreamGenContext::initman() {
sprite->b29 = 0;
}
-void DreamGenContext::mainmanCPP(Sprite *sprite) {
+void DreamGenContext::mainman() {
+ assert(false);
+}
+
+void DreamGenContext::mainman(Sprite *sprite) {
push(es);
push(ds);
@@ -267,6 +271,10 @@ void DreamGenContext::aboutturn(Sprite *sprite) {
}
}
+void DreamGenContext::backobject() {
+ assert(false);
+}
+
void DreamGenContext::backobject(Sprite *sprite) {
push(ds);
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 3a00c16d4d..0ae76419e9 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -69,7 +69,7 @@
Sprite *makesprite(uint8 x, uint8 y, uint16 updateCallback, uint16 somethingInDx, uint16 somethingInDi);
void spriteupdate();
void initman();
- void mainmanCPP(Sprite *sprite);
+ void mainman(Sprite *sprite);
void facerightway();
void walking();
void walking(Sprite *sprite);