diff options
author | Bertrand Augereau | 2011-08-11 16:59:20 +0200 |
---|---|---|
committer | Bertrand Augereau | 2011-08-11 22:01:53 +0200 |
commit | b08b31eed3e31fb485a9091829f23cfb9006551f (patch) | |
tree | 86ad9cbc79ea52fc955ad4e772a58ba1d496aff4 /engines/dreamweb | |
parent | 2250c10ffeddad9b1b1796b6946cfd285f48207f (diff) | |
download | scummvm-rg350-b08b31eed3e31fb485a9091829f23cfb9006551f.tar.gz scummvm-rg350-b08b31eed3e31fb485a9091829f23cfb9006551f.tar.bz2 scummvm-rg350-b08b31eed3e31fb485a9091829f23cfb9006551f.zip |
DREAMWEB: 'setuptimedtemp' ported to C++
Diffstat (limited to 'engines/dreamweb')
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 53 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 3 | ||||
-rw-r--r-- | engines/dreamweb/stubs.cpp | 41 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 2 |
4 files changed, 44 insertions, 55 deletions
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); |