Skip to content

Commit

Permalink
DREAMWEB: 'dolook' ported to C++
Browse files Browse the repository at this point in the history
  • Loading branch information
tramboi committed Nov 23, 2011
1 parent debd94f commit 5d5249e
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 40 deletions.
1 change: 1 addition & 0 deletions devtools/tasmrecover/tasm-recover
Expand Up @@ -274,6 +274,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'findroominloc',
'look',
'autolook',
'dolook',
'reelsonscreen',
'reconstruct',
], skip_output = [
Expand Down
38 changes: 0 additions & 38 deletions engines/dreamweb/dreamgen.cpp
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions engines/dreamweb/dreamgen.h
Expand Up @@ -376,7 +376,6 @@ class DreamGenContext : public Context {
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;
Expand Down Expand Up @@ -1709,7 +1708,7 @@ class DreamGenContext : public Context {
void saveems();
void locationpic();
//void getflagunderp();
void dolook();
//void dolook();
void opentvdoor();
void triggermessage();
void smallcandle();
Expand Down
25 changes: 25 additions & 0 deletions engines/dreamweb/stubs.cpp
Expand Up @@ -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 */

1 change: 1 addition & 0 deletions engines/dreamweb/stubs.h
Expand Up @@ -334,4 +334,5 @@
void reconstruct();
void look();
void autolook();
void dolook();

0 comments on commit 5d5249e

Please sign in to comment.