aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBertrand Augereau2011-08-16 03:23:09 +0200
committerBertrand Augereau2011-08-16 03:57:52 +0200
commit1fb3cb182f6b71a681c646d35e56322de3e38660 (patch)
tree44ab0e7eae49ba12f21a512e1327b68ef808ece6
parentd8ff4182f7cf249c560f4917c2a4faa0cc0f95a9 (diff)
downloadscummvm-rg350-1fb3cb182f6b71a681c646d35e56322de3e38660.tar.gz
scummvm-rg350-1fb3cb182f6b71a681c646d35e56322de3e38660.tar.bz2
scummvm-rg350-1fb3cb182f6b71a681c646d35e56322de3e38660.zip
DREAMWEB: 'madman' ported to C++
-rwxr-xr-xdevtools/tasmrecover/tasm-recover1
-rw-r--r--engines/dreamweb/dreamgen.cpp78
-rw-r--r--engines/dreamweb/sprite.cpp69
3 files changed, 66 insertions, 82 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index e05e58c2f7..376e2dc39f 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -118,5 +118,6 @@ generator = cpp(context, "DreamGen", blacklist = [
'dreamweb',
'backobject',
'mainman',
+ 'madman',
])
generator.generate('dreamweb') #start routine
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 9306acda49..34bb64b58c 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -1694,84 +1694,6 @@ notendtelly:
showgamereel();
}
-void DreamGenContext::madman() {
- STACK_CHECK;
- data.word(kWatchingtime) = 2;
- checkspeed();
- if (!flags.z())
- goto nomadspeed;
- ax = es.word(bx+3);
- _cmp(ax, 364);
- if (!flags.c())
- goto ryansded;
- _cmp(ax, 10);
- if (!flags.z())
- goto notfirstmad;
- push(es);
- push(bx);
- push(ax);
- dx = 2247;
- loadtemptext();
- ax = pop();
- bx = pop();
- es = pop();
- data.byte(kCombatcount) = -1;
- data.byte(kSpeechcount) = 0;
-notfirstmad:
- _inc(ax);
- _cmp(ax, 294);
- if (flags.z())
- goto madmanspoken;
- _cmp(ax, 66);
- if (!flags.z())
- goto nomadspeak;
- _inc(data.byte(kCombatcount));
- push(es);
- push(bx);
- madmantext();
- bx = pop();
- es = pop();
- ax = 53;
- _cmp(data.byte(kCombatcount), 64);
- if (flags.c())
- goto nomadspeak;
- _cmp(data.byte(kCombatcount), 70);
- if (flags.z())
- goto killryan;
- _cmp(data.byte(kLastweapon), 8);
- if (!flags.z())
- goto nomadspeak;
- data.byte(kCombatcount) = 72;
- data.byte(kLastweapon) = -1;
- data.byte(kMadmanflag) = 1;
- ax = 67;
- goto nomadspeak;
-killryan:
- ax = 310;
-nomadspeak:
- es.word(bx+3) = ax;
-nomadspeed:
- showgamereel();
- al = data.byte(kMapx);
- es.byte(bx+1) = al;
- madmode();
- return;
-madmanspoken:
- _cmp(data.byte(kWongame), 1);
- if (flags.z())
- return /* (alreadywon) */;
- data.byte(kWongame) = 1;
- push(es);
- push(bx);
- getridoftemptext();
- bx = pop();
- es = pop();
- return;
-ryansded:
- data.byte(kMandead) = 2;
- showgamereel();
-}
-
void DreamGenContext::madmode() {
STACK_CHECK;
data.word(kWatchingtime) = 2;
diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp
index e01fdca976..0da5faa111 100644
--- a/engines/dreamweb/sprite.cpp
+++ b/engines/dreamweb/sprite.cpp
@@ -768,9 +768,8 @@ void DreamGenContext::madmantext() {
if (isCD()) {
if (data.byte(kSpeechcount) >= 63)
return;
- _cmp(data.byte(kCh1playing), 255);
- if (!flags.z())
- return /* (nomadtext) */;
+ if (data.byte(kCh1playing) != 255)
+ return;
al = data.byte(kSpeechcount);
++data.byte(kSpeechcount);
} else {
@@ -779,11 +778,73 @@ void DreamGenContext::madmantext() {
al = data.byte(kCombatcount);
_and(al, 3);
if (!flags.z())
- return /* (nomadtext) */;
+ return;
al = data.byte(kCombatcount) / 4;
}
setuptimedtemp(47 + al, 82, 72, 80, 90, 1);
}
+void DreamGenContext::madman() {
+ data.word(kWatchingtime) = 2;
+ checkspeed();
+ if (flags.z()) {
+ ax = es.word(bx+3);
+ if (ax >= 364) {
+ data.byte(kMandead) = 2;
+ showgamereel();
+ return;
+ }
+ if (ax == 10) {
+ push(es);
+ push(bx);
+ push(ax);
+ dx = kIntrotextname;
+ loadtemptext();
+ ax = pop();
+ bx = pop();
+ es = pop();
+ data.byte(kCombatcount) = -1;
+ data.byte(kSpeechcount) = 0;
+ }
+ ++ax;
+ if (ax == 294) {
+ if (data.byte(kWongame) == 1)
+ return;
+ data.byte(kWongame) = 1;
+ push(es);
+ push(bx);
+ getridoftemptext();
+ bx = pop();
+ es = pop();
+ return;
+ }
+ if (ax == 66) {
+ ++data.byte(kCombatcount);
+ push(es);
+ push(bx);
+ madmantext();
+ bx = pop();
+ es = pop();
+ ax = 53;
+ if (data.byte(kCombatcount) >= (isCD() ? 64 : 62)) {
+ if (data.byte(kCombatcount) == (isCD() ? 70 : 68))
+ ax = 310;
+ else {
+ if (data.byte(kLastweapon) == 8) {
+ data.byte(kCombatcount) = isCD() ? 72 : 70;
+ data.byte(kLastweapon) = -1;
+ data.byte(kMadmanflag) = 1;
+ ax = 67;
+ }
+ }
+ }
+ }
+ es.word(bx+3) = ax;
+ }
+ showgamereel();
+ es.byte(bx+1) = data.byte(kMapx);
+ madmode();
+}
+
} /*namespace dreamgen */