From ea941af7f26671b76fb842c54b96658d87b00423 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 12 Dec 2011 04:18:17 +0200 Subject: DREAMWEB: Convert 'monkspeaking' and 'showmonk' to C++ Also, remove the 'monkface' data from the data blob --- engines/dreamweb/dreamgen.cpp | 170 ++++++++++++++---------------------------- engines/dreamweb/dreamgen.h | 39 +++++----- engines/dreamweb/stubs.cpp | 38 ++++++++++ engines/dreamweb/stubs.h | 1 + 4 files changed, 113 insertions(+), 135 deletions(-) (limited to 'engines/dreamweb') diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 6137c32247..b811322e47 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -1168,62 +1168,6 @@ void DreamGenContext::initialMonCols() { showGroup(); } -void DreamGenContext::monkSpeaking() { - STACK_CHECK; - data.byte(kRoomssample) = 35; - loadRoomsSample(); - dx = 1001; - loadIntoTemp(); - clearWork(); - showMonk(); - workToScreen(); - data.byte(kVolume) = 7; - data.byte(kVolumedirection) = -1; - data.byte(kVolumeto) = 5; - al = 12; - ah = 255; - playChannel0(); - fadeScreenUps(); - cx = 300; - hangOn(); - al = 40; -loadspeech2: - push(ax); - dl = 'T'; - dh = 83; - cl = 'T'; - ah = 0; - loadSpeech(); - al = 50+12; - playChannel1(); -notloadspeech2: - vSync(); - _cmp(data.byte(kCh1playing), 255); - if (!flags.z()) - goto notloadspeech2; - ax = pop(); - _inc(al); - _cmp(al, 48); - if (!flags.z()) - goto loadspeech2; - data.byte(kVolumedirection) = 1; - data.byte(kVolumeto) = 7; - fadeScreenDowns(); - cx = 300; - hangOn(); - getRidOfTemp(); -} - -void DreamGenContext::showMonk() { - STACK_CHECK; - al = 0; - ah = 128; - di = 160; - bx = 72; - ds = data.word(kTempgraphics); - showFrame(); -} - void DreamGenContext::runEndSeq() { STACK_CHECK; atmospheres(); @@ -3135,14 +3079,14 @@ void DreamGenContext::getDestInfo() { push(ax); dx = data; es = dx; - si = 1353; + si = 1340; _add(si, ax); cl = es.byte(si); ax = pop(); push(cx); dx = data; es = dx; - si = 1369; + si = 1356; _add(si, ax); ax = pop(); } @@ -3194,7 +3138,7 @@ clearedlocations: bx = ax; dx = data; es = dx; - _add(bx, 1353); + _add(bx, 1340); es.byte(bx) = 0; } @@ -3230,7 +3174,7 @@ void DreamGenContext::execCommand() { es = cs; bx = offset_comlist; ds = cs; - si = 1387; + si = 1374; al = ds.byte(si); _cmp(al, 0); if (!flags.z()) @@ -3323,7 +3267,7 @@ dirroot: si = offset_rootdir; _inc(si); es = cs; - di = 1210; + di = 1197; _inc(di); cx = 12; _movsb(cx, true); @@ -3425,7 +3369,7 @@ notyetassigned: push(bx); _add(bx, 2); ds = cs; - si = 1387; + si = 1374; checkpass: _lodsw(); ah = es.byte(bx); @@ -3496,7 +3440,7 @@ void DreamGenContext::read() { return; okcom: es = cs; - di = 1210; + di = 1197; ax = data.word(kTextfile1); data.word(kMonsource) = ax; ds = ax; @@ -3626,7 +3570,7 @@ keyok2: ds = cs; si = offset_operand1+1; es = cs; - di = 1210+1; + di = 1197+1; cx = 12; _movsb(cx, true); monitorLogo(); @@ -3753,7 +3697,7 @@ void DreamGenContext::parser() { al = '='; _stosb(); ds = cs; - si = 1387; + si = 1374; notspace1: _lodsw(); _cmp(al, 32); @@ -5766,7 +5710,7 @@ void DreamGenContext::clearChanges() { di = 0; _stosw(cx, true); es = cs; - di = 1353; + di = 1340; al = 1; _stosb(2); al = 0; @@ -6083,55 +6027,55 @@ void DreamGenContext::__start() { //0x03c0: ...2 ...! (..2 ...D 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x56, 0x39, 0x39, 0x00, 0x44, 0x52, 0x45, 0x41, //0x03d0: REAM WEB. V99. DREA - 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x56, 0x4f, 0x4c, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, - //0x03e0: MWEB .VOL .DRE AMWE - 0x42, 0x2e, 0x47, 0x31, 0x35, 0x00, 0x00, 0x01, 0x45, 0x58, 0x49, 0x54, 0x20, 0x20, 0x20, 0x20, - //0x03f0: B.G1 5... EXIT - 0x20, 0x20, 0x48, 0x45, 0x4c, 0x50, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x49, 0x53, 0x54, - //0x0400: HE LP LIST - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x52, 0x45, 0x41, 0x44, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - //0x0410: RE AD - 0x4c, 0x4f, 0x47, 0x4f, 0x4e, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4b, 0x45, 0x59, 0x53, 0x20, 0x20, - //0x0420: LOGO N KE YS - 0x20, 0x20, 0x20, 0x20, 0x01, 0x00, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x20, 0x20, 0x20, - //0x0430: ..PU BLIC - 0x20, 0x20, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, - //0x0440: PU BLIC ... - 0x42, 0x4c, 0x41, 0x43, 0x4b, 0x44, 0x52, 0x41, 0x47, 0x4f, 0x4e, 0x20, 0x52, 0x59, 0x41, 0x4e, - //0x0450: BLAC KDRA GON RYAN - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x48, 0x45, 0x4e, 0x44, 0x52, 0x49, - //0x0460: . ..HE NDRI - 0x58, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x4f, 0x55, 0x49, 0x53, 0x20, 0x20, 0x20, 0x20, 0x20, - //0x0470: X LO UIS - 0x20, 0x00, 0x00, 0x00, 0x53, 0x45, 0x50, 0x54, 0x49, 0x4d, 0x55, 0x53, 0x20, 0x20, 0x20, 0x20, - //0x0480: ... SEPT IMUS - 0x42, 0x45, 0x43, 0x4b, 0x45, 0x54, 0x54, 0x20, 0x20, 0x20, 0x20, 0x00, 0xff, 0xff, 0x20, 0x20, - //0x0490: BECK ETT . .. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x22, 0x52, 0x4f, 0x4f, - //0x04a0: . "ROO - 0x54, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, - //0x04b0: T ." - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x30, 0x30, 0x30, 0x30, 0x00, 0x30, 0x30, 0x00, - //0x04c0: . 0000 .00. - 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x53, 0x50, 0x45, 0x45, 0x43, 0x48, 0x52, 0x32, 0x34, 0x43, 0x30, - //0x04d0: .... $SPE ECHR 24C0 - 0x30, 0x30, 0x35, 0x2e, 0x52, 0x41, 0x57, 0x00, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x20, 0x4e, - //0x04e0: 005. RAW. OBJE CT N - 0x41, 0x4d, 0x45, 0x20, 0x4f, 0x4e, 0x45, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - //0x04f0: AME ONE + 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x56, 0x4f, 0x4c, 0x00, 0x00, 0x01, 0x45, 0x58, 0x49, 0x54, 0x20, + //0x03e0: MWEB .VOL ...E XIT + 0x20, 0x20, 0x20, 0x20, 0x20, 0x48, 0x45, 0x4c, 0x50, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4c, + //0x03f0: HEL P L + 0x49, 0x53, 0x54, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x52, 0x45, 0x41, 0x44, 0x20, 0x20, 0x20, + //0x0400: IST REA D + 0x20, 0x20, 0x20, 0x4c, 0x4f, 0x47, 0x4f, 0x4e, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4b, 0x45, 0x59, + //0x0410: L OGON KEY + 0x53, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x01, 0x00, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, + //0x0420: S . .PUB LIC + 0x20, 0x20, 0x20, 0x20, 0x20, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x20, 0x20, 0x20, 0x20, + //0x0430: PUB LIC + 0x00, 0x00, 0x00, 0x42, 0x4c, 0x41, 0x43, 0x4b, 0x44, 0x52, 0x41, 0x47, 0x4f, 0x4e, 0x20, 0x52, + //0x0440: ...B LACK DRAG ON R + 0x59, 0x41, 0x4e, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x48, 0x45, 0x4e, + //0x0450: YAN .. .HEN + 0x44, 0x52, 0x49, 0x58, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x4f, 0x55, 0x49, 0x53, 0x20, 0x20, + //0x0460: DRIX LOU IS + 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x53, 0x45, 0x50, 0x54, 0x49, 0x4d, 0x55, 0x53, 0x20, + //0x0470: ...S EPTI MUS + 0x20, 0x20, 0x20, 0x42, 0x45, 0x43, 0x4b, 0x45, 0x54, 0x54, 0x20, 0x20, 0x20, 0x20, 0x00, 0xff, + //0x0480: B ECKE TT .. + 0xff, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x22, + //0x0490: . ." + 0x52, 0x4f, 0x4f, 0x54, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x22, 0x20, 0x20, + //0x04a0: ROOT ." + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x30, 0x30, 0x30, 0x30, 0x00, + //0x04b0: .0 000. + 0x30, 0x30, 0x00, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x53, 0x50, 0x45, 0x45, 0x43, 0x48, 0x52, 0x32, + //0x04c0: 00.. ...$ SPEE CHR2 + 0x34, 0x43, 0x30, 0x30, 0x30, 0x35, 0x2e, 0x52, 0x41, 0x57, 0x00, 0x4f, 0x42, 0x4a, 0x45, 0x43, + //0x04d0: 4C00 05.R AW.O BJEC + 0x54, 0x20, 0x4e, 0x41, 0x4d, 0x45, 0x20, 0x4f, 0x4e, 0x45, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + //0x04e0: T NA ME O NE 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - //0x0500: - 0x00, 0x10, 0x12, 0x12, 0x11, 0x10, 0x10, 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - //0x0510: .... .... .... .... - 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x44, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, - //0x0520: .... .... .D:. .... + //0x04f0: + 0x20, 0x20, 0x20, 0x00, 0x10, 0x12, 0x12, 0x11, 0x10, 0x10, 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, + //0x0500: . .... .... .... + 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x44, 0x3a, 0x00, 0x00, + //0x0510: .... .... .... D:.. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + //0x0520: .... .... .... .... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, //0x0530: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x02, //0x0540: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x02, 0x04, 0x01, 0x0a, + 0x04, 0x01, 0x0a, 0x09, 0x08, 0x06, 0x0b, 0x04, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0x0550: .... .... .... .... - 0x09, 0x08, 0x06, 0x0b, 0x04, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0x0560: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0x0570: .... .... .... .... @@ -6145,11 +6089,9 @@ void DreamGenContext::__start() { //0x05b0: .... .... .... .... 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0x05c0: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, //0x05d0: .... .... .... .... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, - //0x05e0: .... .... .... .... - 0xff, 0x00, 0x00, 0x00, }; + 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, }; ds.assign(src, src + sizeof(src)); dreamweb(); } diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index ba03891395..9c138bbd99 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -32,15 +32,15 @@ namespace DreamGen { -static const uint16 offset_commandline = 0x04e8; -static const uint16 offset_money2poke = 0x04cd; -static const uint16 offset_speechfile = 0x04db; -static const uint16 offset_rootdir = 0x04ac; -static const uint16 offset_keys = 0x0434; -static const uint16 offset_money1poke = 0x04c8; -static const uint16 offset_comlist = 0x03f8; -static const uint16 offset_openchangesize = 0x03f6; -static const uint16 offset_operand1 = 0x049e; +static const uint16 offset_openchangesize = 0x03e9; +static const uint16 offset_speechfile = 0x04ce; +static const uint16 offset_operand1 = 0x0491; +static const uint16 offset_money2poke = 0x04c0; +static const uint16 offset_commandline = 0x04db; +static const uint16 offset_keys = 0x0427; +static const uint16 offset_rootdir = 0x049f; +static const uint16 offset_money1poke = 0x04bb; +static const uint16 offset_comlist = 0x03eb; static const uint16 kStartvars = 0; static const uint16 kProgresspoints = 1; static const uint16 kWatchon = 2; @@ -413,16 +413,15 @@ static const uint16 kHowmuchalloc = 516; static const uint16 kReelroutines = 518; static const uint16 kBasicsample = 975; static const uint16 kVolumetabname = 988; -static const uint16 kMonkface = 1001; -static const uint16 kCurrentfile = 1210; -static const uint16 kRoomscango = 1353; -static const uint16 kRoompics = 1369; -static const uint16 kOplist = 1384; -static const uint16 kInputline = 1387; -static const uint16 kPresslist = 1515; -static const uint16 kQuitrequested = 1521; -static const uint16 kSubtitles = 1522; -static const uint16 kForeignrelease = 1523; +static const uint16 kCurrentfile = 1197; +static const uint16 kRoomscango = 1340; +static const uint16 kRoompics = 1356; +static const uint16 kOplist = 1371; +static const uint16 kInputline = 1374; +static const uint16 kPresslist = 1502; +static const uint16 kQuitrequested = 1508; +static const uint16 kSubtitles = 1509; +static const uint16 kForeignrelease = 1510; static const uint16 kBlocktextdat = (0); static const uint16 kPersonframes = (0); static const uint16 kDebuglevel1 = (0); @@ -558,7 +557,6 @@ public: void usePipe(); void reminders(); void runTap(); - void showMonk(); void checkForExit(); void lookInInterface(); void inToInv(); @@ -640,7 +638,6 @@ public: void findExObject(); void clearChanges(); void searchForFiles(); - void monkSpeaking(); void getExAd(); void initialMonCols(); void useButtonA(); diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index e9cba0d6f2..89d53361f5 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -4257,4 +4257,42 @@ void DreamGenContext::showPuzText(uint16 command, uint16 count) { hangOnP(count); } +void DreamGenContext::monkSpeaking() { + data.byte(kRoomssample) = 35; + loadRoomsSample(); + loadIntoTemp("DREAMWEB.G15"); + clearWork(); + showFrame(tempGraphics(), 160, 72, 0, 128); // show monk + workToScreen(); + data.byte(kVolume) = 7; + data.byte(kVolumedirection) = 0xFF; + data.byte(kVolumeto) = 5; + playChannel0(12, 255); + fadeScreenUps(); + hangOn(300); + al = 40; + + for (int i = 40; i < 48; i++) { + dl = 'T'; + dh = 83; + cl = 'T'; + ah = 0; + loadSpeech(); + + playChannel1(50 + 12); + + do { + engine->waitForVSync(); + } while (data.byte(kCh1playing) != 255); + + al++; + } + + data.byte(kVolumedirection) = 1; + data.byte(kVolumeto) = 7; + fadeScreenDowns(); + hangOn(300); + getRidOfTemp(); +} + } // End of namespace DreamGen diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index ad60a1af1c..36328f59dc 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -567,5 +567,6 @@ void newPlace(); void showPuzText(uint16 command, uint16 count); void showPuzText(); + void monkSpeaking(); #endif -- cgit v1.2.3