Skip to content

Commit

Permalink
DREAMWEB: 'autolook' ported to C++
Browse files Browse the repository at this point in the history
  • Loading branch information
tramboi committed Nov 23, 2011
1 parent a8a698c commit 7843073
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 25 deletions.
1 change: 1 addition & 0 deletions devtools/tasmrecover/tasm-recover
Expand Up @@ -272,6 +272,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'createpanel',
'createpanel2',
'findroominloc',
'autolook',
'reelsonscreen',
'reconstruct',
], skip_output = [
Expand Down
23 changes: 0 additions & 23 deletions engines/dreamweb/dreamgen.cpp
Expand Up @@ -4894,29 +4894,6 @@ void DreamGenContext::drawfloor() {
es = pop();
}

void DreamGenContext::autolook() {
STACK_CHECK;
ax = data.word(kMousex);
_cmp(ax, data.word(kOldx));
if (!flags.z())
goto diffmouse;
ax = data.word(kMousey);
_cmp(ax, data.word(kOldy));
if (!flags.z())
goto diffmouse;
_dec(data.word(kLookcounter));
_cmp(data.word(kLookcounter), 0);
if (!flags.z())
return /* (noautolook) */;
_cmp(data.word(kWatchingtime), 0);
if (!flags.z())
return /* (noautolook) */;
dolook();
return;
diffmouse:
data.word(kLookcounter) = 1000;
}

void DreamGenContext::look() {
STACK_CHECK;
_cmp(data.word(kWatchingtime), 0);
Expand Down
3 changes: 1 addition & 2 deletions engines/dreamweb/dreamgen.h
Expand Up @@ -378,7 +378,6 @@ class DreamGenContext : public Context {
static const uint16 addr_redrawmainscrn = 0xc478;
static const uint16 addr_dolook = 0xc474;
static const uint16 addr_look = 0xc470;
static const uint16 addr_autolook = 0xc46c;
static const uint16 addr_drawfloor = 0xc428;
static const uint16 addr_deleteextext = 0xc420;
static const uint16 addr_deleteexframe = 0xc41c;
Expand Down Expand Up @@ -1586,7 +1585,7 @@ class DreamGenContext : public Context {
void dosreturn();
void wheelsound();
void actualsave();
void autolook();
//void autolook();
void playguitar();
//void showreelframe();
void searchforsame();
Expand Down
14 changes: 14 additions & 0 deletions engines/dreamweb/stubs.cpp
Expand Up @@ -2260,5 +2260,19 @@ void DreamGenContext::findroominloc() {
data.byte(kRoomnum) = roomNum;
}

void DreamGenContext::autolook() {
if ((data.word(kMousex) != data.word(kOldx)) || (data.word(kMousey) != data.word(kOldy))) {
data.word(kLookcounter) = 1000;
return;
}

--data.word(kLookcounter);
if (data.word(kLookcounter))
return;
if (data.word(kWatchingtime))
return;
dolook();
}

} /*namespace dreamgen */

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

0 comments on commit 7843073

Please sign in to comment.