aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdevtools/tasmrecover/tasm-recover1
-rw-r--r--engines/dreamweb/dreamgen.cpp20
-rw-r--r--engines/dreamweb/dreamgen.h3
-rw-r--r--engines/dreamweb/sprite.cpp24
-rw-r--r--engines/dreamweb/stubs.h2
5 files changed, 28 insertions, 22 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index cc678b711b..e05e58c2f7 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -112,6 +112,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'commandwithob',
'showpanel',
'updatepeople',
+ 'madmantext',
], skip_output = [
# These functions are processed but not output
'dreamweb',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 8c3719b6d6..9306acda49 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -1772,25 +1772,6 @@ ryansded:
showgamereel();
}
-void DreamGenContext::madmantext() {
- STACK_CHECK;
- _cmp(data.byte(kSpeechcount), 63);
- if (!flags.c())
- return /* (nomadtext) */;
- _cmp(data.byte(kCh1playing), 255);
- if (!flags.z())
- return /* (nomadtext) */;
- al = data.byte(kSpeechcount);
- _inc(data.byte(kSpeechcount));
- _add(al, 47);
- bl = 72;
- bh = 80;
- cx = 90;
- dx = 1;
- ah = 82;
- setuptimedtemp();
-}
-
void DreamGenContext::madmode() {
STACK_CHECK;
data.word(kWatchingtime) = 2;
@@ -19166,7 +19147,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
case addr_priest: priest(); break;
case addr_madmanstelly: madmanstelly(); break;
case addr_madman: madman(); break;
- case addr_madmantext: madmantext(); break;
case addr_madmode: madmode(); break;
case addr_priesttext: priesttext(); break;
case addr_textforend: textforend(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 851c87d00c..be3c1221f6 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -655,7 +655,6 @@ public:
static const uint16 addr_textforend = 0xc0ec;
static const uint16 addr_priesttext = 0xc0e8;
static const uint16 addr_madmode = 0xc0e4;
- static const uint16 addr_madmantext = 0xc0e0;
static const uint16 addr_madman = 0xc0dc;
static const uint16 addr_madmanstelly = 0xc0d8;
static const uint16 addr_priest = 0xc0d4;
@@ -1802,7 +1801,7 @@ public:
void dmaend();
//void quickquit2();
void twodigitnum();
- void madmantext();
+ //void madmantext();
void dumpcurrent();
void textforend();
void showdiarykeys();
diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp
index 59ca0cbc0b..da9d8c96f4 100644
--- a/engines/dreamweb/sprite.cpp
+++ b/engines/dreamweb/sprite.cpp
@@ -764,5 +764,29 @@ void DreamGenContext::updatepeople() {
}
}
+void DreamGenContext::madmantext() {
+ // The original sources has two codepaths depending if the game is 'if cd' or not
+ // This is a hack to guess which version to use with the assumption that if we have a cd version
+ // we managed to load the speech.
+ if (data.byte(kSpeechloaded)) {
+ if (data.byte(kSpeechcount) >= 63)
+ return;
+ _cmp(data.byte(kCh1playing), 255);
+ if (!flags.z())
+ return /* (nomadtext) */;
+ al = data.byte(kSpeechcount);
+ ++data.byte(kSpeechcount);
+ } else {
+ if (data.byte(kCombatcount) >= 61)
+ return;
+ al = data.byte(kCombatcount);
+ _and(al, 3);
+ if (!flags.z())
+ return /* (nomadtext) */;
+ al = data.byte(kCombatcount) / 4;
+ }
+ setuptimedtemp(47 + al, 82, 72, 80, 90, 1);
+}
+
} /*namespace dreamgen */
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 94580b3a68..5b8839fad9 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -128,4 +128,6 @@
void commandwithob(uint8 command, uint8 type, uint8 index);
void showpanel();
void updatepeople();
+ void madmantext();
+