DREAMWEB: 'autolook' ported to C++

This commit is contained in:
Bertrand Augereau 2011-11-23 13:09:31 +01:00
parent a8a698c82b
commit 7843073c0e
5 changed files with 17 additions and 25 deletions

View File

@ -272,6 +272,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'createpanel',
'createpanel2',
'findroominloc',
'autolook',
'reelsonscreen',
'reconstruct',
], skip_output = [

View File

@ -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);

View File

@ -378,7 +378,6 @@ public:
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;
@ -1586,7 +1585,7 @@ public:
void dosreturn();
void wheelsound();
void actualsave();
void autolook();
//void autolook();
void playguitar();
//void showreelframe();
void searchforsame();

View File

@ -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 */

View File

@ -332,4 +332,5 @@
void findroominloc();
void reelsonscreen();
void reconstruct();
void autolook();