aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdevtools/tasmrecover/tasm-recover1
-rw-r--r--engines/dreamweb/dreamgen.cpp140
-rw-r--r--engines/dreamweb/dreamgen.h1
-rw-r--r--engines/dreamweb/stubs.h1
-rw-r--r--engines/dreamweb/talk.cpp86
5 files changed, 86 insertions, 143 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index eb10c886fc..da77e6facf 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -379,6 +379,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'dontloadseg',
'doorway',
'dosaveload',
+ 'dosometalk',
'dosreturn',
'doshake',
'drawflags',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 7416e1bafb..8cd5dd43df 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -927,146 +927,6 @@ cantpurge2:
goto lookforpurge2;
}
-void DreamGenContext::doSomeTalk() {
- STACK_CHECK;
-dospeech:
- al = data.byte(kTalkpos);
- al = data.byte(kCharacter);
- _and(al, 127);
- ah = 0;
- cx = 64;
- _mul(cx);
- cx = ax;
- al = data.byte(kTalkpos);
- ah = 0;
- _add(ax, cx);
- _add(ax, ax);
- si = ax;
- es = data.word(kPeople);
- _add(si, (0+24));
- cx = (0+24+(1026*2));
- ax = es.word(si);
- _add(ax, cx);
- si = ax;
- _cmp(es.byte(si), 0);
- if (flags.z())
- goto endheartalk;
- push(es);
- push(si);
- createPanel();
- showPanel();
- showMan();
- showExit();
- convIcons();
- si = pop();
- es = pop();
- di = 164;
- bx = 64;
- dl = 144;
- al = 0;
- ah = 0;
- printDirect();
- al = data.byte(kCharacter);
- _and(al, 127);
- ah = 0;
- cx = 64;
- _mul(cx);
- cl = data.byte(kTalkpos);
- ch = 0;
- _add(ax, cx);
- cl = 'C';
- dl = 'R';
- dh = data.byte(kReallocation);
- loadSpeech();
- _cmp(data.byte(kSpeechloaded), 0);
- if (flags.z())
- goto noplay1;
- al = 62;
- playChannel1();
-noplay1:
- data.byte(kPointermode) = 3;
- workToScreenM();
- cx = 180;
- hangOnPQ();
- if (!flags.c())
- goto _tmp1;
- return;
-_tmp1:
- _inc(data.byte(kTalkpos));
- al = data.byte(kTalkpos);
- al = data.byte(kCharacter);
- _and(al, 127);
- ah = 0;
- cx = 64;
- _mul(cx);
- cx = ax;
- al = data.byte(kTalkpos);
- ah = 0;
- _add(ax, cx);
- _add(ax, ax);
- si = ax;
- es = data.word(kPeople);
- _add(si, (0+24));
- cx = (0+24+(1026*2));
- ax = es.word(si);
- _add(ax, cx);
- si = ax;
- _cmp(es.byte(si), 0);
- if (flags.z())
- goto endheartalk;
- _cmp(es.byte(si), ':');
- if (flags.z())
- goto skiptalk2;
- _cmp(es.byte(si), 32);
- if (flags.z())
- goto skiptalk2;
- push(es);
- push(si);
- createPanel();
- showPanel();
- showMan();
- showExit();
- convIcons();
- si = pop();
- es = pop();
- di = 48;
- bx = 128;
- dl = 144;
- al = 0;
- ah = 0;
- printDirect();
- al = data.byte(kCharacter);
- _and(al, 127);
- ah = 0;
- cx = 64;
- _mul(cx);
- cl = data.byte(kTalkpos);
- ch = 0;
- _add(ax, cx);
- cl = 'C';
- dl = 'R';
- dh = data.byte(kReallocation);
- loadSpeech();
- _cmp(data.byte(kSpeechloaded), 0);
- if (flags.z())
- goto noplay2;
- al = 62;
- playChannel1();
-noplay2:
- data.byte(kPointermode) = 3;
- workToScreenM();
- cx = 180;
- hangOnPQ();
- if (!flags.c())
- goto skiptalk2;
- return;
-skiptalk2:
- _inc(data.byte(kTalkpos));
- goto dospeech;
-endheartalk:
- data.byte(kPointermode) = 0;
-}
-
void DreamGenContext::locationPic() {
STACK_CHECK;
getDestInfo();
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index d8270efdc3..52009dc5ed 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -454,7 +454,6 @@ public:
void __start();
#include "stubs.h" // Allow hand-reversed functions to have a signature different than void f()
- void doSomeTalk();
void outOfOpen();
void dirCom();
void findFirstPath();
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 09a68682a7..b1406182f0 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -100,6 +100,7 @@
void convIcons();
void startTalk();
void getPersonText(uint8 index);
+ void doSomeTalk();
void examineOb(bool examineAgain = true);
void dumpWatch();
void transferText();
diff --git a/engines/dreamweb/talk.cpp b/engines/dreamweb/talk.cpp
index c0622f7d53..834109b1dc 100644
--- a/engines/dreamweb/talk.cpp
+++ b/engines/dreamweb/talk.cpp
@@ -110,7 +110,7 @@ void DreamGenContext::startTalk() {
void DreamGenContext::getPersonText(uint8 index) {
es = data.word(kPeople);
- si = es.word((index * 64 * 2) + 24) + (1026 * 2) + 24;
+ si = es.word((index * 64 * 2) + kPersontxtdat) + kPersontext;
}
void DreamGenContext::moreTalk() {
@@ -138,7 +138,89 @@ void DreamGenContext::moreTalk() {
doSomeTalk();
}
-// TODO: put Dosometalk here
+void DreamGenContext::doSomeTalk() {
+ while (true) {
+ es = data.word(kPeople);
+ si = ((data.byte(kTalkpos) + (64 * (data.byte(kCharacter) & 0x7F))) * 2) + kPersontxtdat;
+ si = es.word(si) + kPersontext;
+
+ if (es.byte(si) == 0) {
+ // endheartalk
+ data.byte(kPointermode) = 0;
+ return;
+ }
+
+ push(es);
+ push(si);
+
+ createPanel();
+ showPanel();
+ showMan();
+ showExit();
+ convIcons();
+
+ si = pop();
+ es = pop();
+
+ const uint8 *str = es.ptr(si, 0);
+ uint16 y = 64;
+ printDirect(&str, 164, &y, 144, false);
+
+ loadSpeech('R', data.byte(kReallocation), 'C', (64 * (data.byte(kCharacter) & 0x7F)) + data.byte(kTalkpos));
+ if (data.byte(kSpeechloaded) != 0)
+ playChannel1(62);
+
+ data.byte(kPointermode) = 3;
+ workToScreenM();
+ cx = 180;
+ hangOnPQ();
+ if (flags.c())
+ return;
+
+ data.byte(kTalkpos)++;
+
+ es = data.word(kPeople);
+ si = kPersontxtdat + (((64 * (data.byte(kCharacter) & 0x7F)) + data.byte(kTalkpos)) * 2);
+ si = es.word(si) + kPersontext;
+
+ if (es.byte(si) == 0) {
+ // endheartalk
+ data.byte(kPointermode) = 0;
+ return;
+ }
+
+ if (es.byte(si) != ':' && es.byte(si) != 32) {
+ push(es);
+ push(si);
+
+ createPanel();
+ showPanel();
+ showMan();
+ showExit();
+ convIcons();
+
+ si = pop();
+ es = pop();
+
+ str = es.ptr(si, 0);
+ y = 128;
+ printDirect(&str, 48, &y, 144, false);
+
+ loadSpeech('R', data.byte(kReallocation), 'C', (64 * (data.byte(kCharacter) & 0x7F)) + data.byte(kTalkpos));
+ if (data.byte(kSpeechloaded) != 0)
+ playChannel1(62);
+
+ data.byte(kPointermode) = 3;
+ workToScreenM();
+ cx = 180;
+ hangOnPQ();
+ if (flags.c())
+ return;
+ }
+
+ data.byte(kTalkpos)++;
+ }
+}
void DreamGenContext::hangOnPQ() {
data.byte(kGetback) = 0;