From b08b31eed3e31fb485a9091829f23cfb9006551f Mon Sep 17 00:00:00 2001 From: Bertrand Augereau Date: Thu, 11 Aug 2011 16:59:20 +0200 Subject: DREAMWEB: 'setuptimedtemp' ported to C++ --- devtools/tasmrecover/tasm-recover | 1 + engines/dreamweb/dreamgen.cpp | 53 --------------------------------------- engines/dreamweb/dreamgen.h | 3 +-- engines/dreamweb/stubs.cpp | 41 ++++++++++++++++++++++++++++++ engines/dreamweb/stubs.h | 2 ++ 5 files changed, 45 insertions(+), 55 deletions(-) diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index 0a86ab43d0..3a9d4f462c 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -53,6 +53,7 @@ generator = cpp(context, "DreamGen", blacklist = [ 'printslow', 'usetimedtext', 'dumptimedtext', + 'setuptimedtemp', 'putundertimed', 'getundertimed', 'worktoscreen', diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index dc576314a4..12bfcb413f 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -12106,58 +12106,6 @@ void DreamGenContext::setuptimeduse() { data.word(kTimedoffset) = bx; } -void DreamGenContext::setuptimedtemp() { - STACK_CHECK; - _cmp(ah, 0); - if (flags.z()) - goto notloadspeech3; - push(ax); - push(bx); - push(cx); - push(dx); - dl = 'T'; - dh = ah; - cl = 'T'; - ah = 0; - loadspeech(); - _cmp(data.byte(kSpeechloaded), 1); - if (!flags.z()) - goto _tmp1; - al = 50+12; - playchannel1(); -_tmp1: - dx = pop(); - cx = pop(); - bx = pop(); - ax = pop(); - _cmp(data.byte(kSpeechloaded), 1); - if (!flags.z()) - goto notloadspeech3; - _cmp(data.byte(kSubtitles), 1); - if (flags.z()) - goto notloadspeech3; - return; -notloadspeech3: - _cmp(data.word(kTimecount), 0); - if (!flags.z()) - return /* (cantsetup2) */; - data.byte(kTimedy) = bh; - data.byte(kTimedx) = bl; - data.word(kCounttotimed) = cx; - _add(dx, cx); - data.word(kTimecount) = dx; - bl = al; - bh = 0; - _add(bx, bx); - es = data.word(kTextfile1); - cx = (66*2); - ax = es.word(bx); - _add(ax, cx); - bx = ax; - data.word(kTimedseg) = es; - data.word(kTimedoffset) = bx; -} - void DreamGenContext::edenscdplayer() { STACK_CHECK; showfirstuse(); @@ -19871,7 +19819,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) { case addr_dochange: dochange(); break; case addr_autoappear: autoappear(); break; case addr_setuptimeduse: setuptimeduse(); break; - case addr_setuptimedtemp: setuptimedtemp(); break; case addr_edenscdplayer: edenscdplayer(); break; case addr_usewall: usewall(); break; case addr_usechurchgate: usechurchgate(); break; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 5a74ed6ad0..42d135fa9a 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -313,7 +313,6 @@ public: static const uint16 addr_usechurchgate = 0xc730; static const uint16 addr_usewall = 0xc72c; static const uint16 addr_edenscdplayer = 0xc728; - static const uint16 addr_setuptimedtemp = 0xc720; static const uint16 addr_setuptimeduse = 0xc71c; static const uint16 addr_autoappear = 0xc70c; static const uint16 addr_dochange = 0xc708; @@ -1384,7 +1383,7 @@ public: //void kernchars(); void othersmoker(); void dofade(); - void setuptimedtemp(); + //void setuptimedtemp(); void blocknametext(); void useelevator5(); void useelevator4(); diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 361b22dac8..da37df99e1 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -326,6 +326,47 @@ void DreamGenContext::usetimedtext() { data.byte(kNeedtodumptimed) = 1; } +void DreamGenContext::setuptimedtemp() { + setuptimedtemp(al, ah, bl, bh, cx, dx); +} + +void DreamGenContext::setuptimedtemp(uint8 textIndex, uint8 voiceIndex, uint8 x, uint8 y, uint16 countToTimed, uint16 timeCount) { +#if 1 // if cd + if (voiceIndex != 0) { + push(ax); + push(bx); + push(cx); + push(dx); + dl = 'T'; + dh = voiceIndex; + cl = 'T'; + ah = 0; + loadspeech(); + if (data.byte(kSpeechloaded) == 1) { + al = 50+12; + playchannel1(); + } + dx = pop(); + cx = pop(); + bx = pop(); + ax = pop(); + if ((data.byte(kSpeechloaded) == 1) && (data.byte(kSubtitles) != 1)) + return; + } +#endif + + if (data.word(kTimecount) != 0) + return; + data.byte(kTimedy) = y; + data.byte(kTimedx) = x; + data.word(kCounttotimed) = countToTimed; + data.word(kTimecount) = timeCount + countToTimed; + data.word(kTimedseg) = data.word(kTextfile1); + data.word(kTimedoffset) = kTextstart + segRef(data.word(kTextfile1)).word(textIndex * 2); + const uint8 *string = segRef(data.word(kTextfile1)).ptr(data.word(kTimedoffset), 0); + debug(1, "setuptimedtemp: (%d, %d) => '%s'", textIndex, voiceIndex, string); +} + void DreamGenContext::dumptimedtext() { if (data.byte(kNeedtodumptimed) != 1) return; diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index 1baad44524..5886630821 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -49,6 +49,8 @@ void printdirect(const uint8** string, uint16 x, uint16 *y, uint8 maxWidth, bool centered); void usetimedtext(); void dumptimedtext(); + void setuptimedtemp(); + void setuptimedtemp(uint8 textIndex, uint8 voiceIndex, uint8 x, uint8 y, uint16 countToTimed, uint16 timeCount); void getundertimed(); void putundertimed(); uint8 printslow(const uint8 *string, uint16 x, uint16 y, uint8 maxWidth, bool centered); -- cgit v1.2.3