From 5d5249e1d997035db8c98f8b5d76b50f0a3f5676 Mon Sep 17 00:00:00 2001 From: Bertrand Augereau Date: Wed, 23 Nov 2011 21:50:35 +0100 Subject: DREAMWEB: 'dolook' ported to C++ --- devtools/tasmrecover/tasm-recover | 1 + engines/dreamweb/dreamgen.cpp | 38 -------------------------------------- engines/dreamweb/dreamgen.h | 3 +-- engines/dreamweb/stubs.cpp | 25 +++++++++++++++++++++++++ engines/dreamweb/stubs.h | 1 + 5 files changed, 28 insertions(+), 40 deletions(-) diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index c4946db9df..e1b8b51f37 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -274,6 +274,7 @@ generator = cpp(context, "DreamGen", blacklist = [ 'findroominloc', 'look', 'autolook', + 'dolook', 'reelsonscreen', 'reconstruct', ], skip_output = [ diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 0a69411ee5..59b0537146 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -4894,44 +4894,6 @@ void DreamGenContext::drawfloor() { es = pop(); } -void DreamGenContext::dolook() { - STACK_CHECK; - createpanel(); - showicon(); - undertextline(); - worktoscreenm(); - data.byte(kCommandtype) = 255; - dumptextline(); - bl = data.byte(kRoomnum); - _and(bl, 31); - bh = 0; - _add(bx, bx); - es = data.word(kRoomdesc); - _add(bx, (0)); - si = es.word(bx); - _add(si, (0+(38*2))); - findnextcolon(); - di = 66; - _cmp(data.byte(kReallocation), 50); - if (flags.c()) - goto notdream3; - di = 40; -notdream3: - bx = 80; - dl = 241; - printslow(); - _cmp(al, 1); - if (flags.z()) - goto afterlook; - cx = 400; - hangonp(); -afterlook: - data.byte(kPointermode) = 0; - data.byte(kCommandtype) = 0; - redrawmainscrn(); - worktoscreenm(); -} - void DreamGenContext::redrawmainscrn() { STACK_CHECK; data.word(kTimecount) = 0; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 462a2b00fa..fb80fd40f5 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -376,7 +376,6 @@ public: static const uint16 addr_talk = 0xc480; static const uint16 addr_getback1 = 0xc47c; static const uint16 addr_redrawmainscrn = 0xc478; - static const uint16 addr_dolook = 0xc474; static const uint16 addr_drawfloor = 0xc428; static const uint16 addr_deleteextext = 0xc420; static const uint16 addr_deleteexframe = 0xc41c; @@ -1709,7 +1708,7 @@ public: void saveems(); void locationpic(); //void getflagunderp(); - void dolook(); + //void dolook(); void opentvdoor(); void triggermessage(); void smallcandle(); diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 60fdf5d342..db71579de5 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -2287,5 +2287,30 @@ void DreamGenContext::look() { dolook(); } +void DreamGenContext::dolook() { + createpanel(); + showicon(); + undertextline(); + worktoscreenm(); + data.byte(kCommandtype) = 255; + dumptextline(); + uint8 index = data.byte(kRoomnum) & 31; + uint16 offset = segRef(data.word(kRoomdesc)).word(kIntextdat + index * 2); + uint8 *string = segRef(data.word(kRoomdesc)).ptr(kIntext, 0) + offset; + findnextcolon(&string); + uint16 x; + if (data.byte(kReallocation) < 50) + x = 66; + else + x = 40; + if (printslow(string, x, 80, 241, true) != 1) + hangonp(400); + + data.byte(kPointermode) = 0; + data.byte(kCommandtype) = 0; + redrawmainscrn(); + worktoscreenm(); +} + } /*namespace dreamgen */ diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index 42acc88131..a53f1bbe7a 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -334,4 +334,5 @@ void reconstruct(); void look(); void autolook(); + void dolook(); -- cgit v1.2.3