DREAMWEB: 'useelvdoor', 'useobject', 'useplinth' ported to C++
This commit is contained in:
parent
ddddce3728
commit
f2829a6a6c
5 changed files with 79 additions and 95 deletions
|
@ -602,13 +602,16 @@ generator = cpp(context, "DreamGen", blacklist = [
|
|||
'useelevator3',
|
||||
'useelevator4',
|
||||
'useelevator5',
|
||||
'useelvdoor',
|
||||
'usefullcart',
|
||||
'useladder',
|
||||
'useladderb',
|
||||
'usehatch',
|
||||
'usemenu',
|
||||
'usemon',
|
||||
'useobject',
|
||||
'useplate',
|
||||
'useplinth',
|
||||
'userailing',
|
||||
'useroutine',
|
||||
'useshield',
|
||||
|
|
|
@ -5026,30 +5026,6 @@ void DreamGenContext::triggerMessage() {
|
|||
data.byte(kLasttrigger) = 0;
|
||||
}
|
||||
|
||||
void DreamGenContext::useObject() {
|
||||
STACK_CHECK;
|
||||
data.byte(kWithobject) = 255;
|
||||
_cmp(data.byte(kCommandtype), 229);
|
||||
if (flags.z())
|
||||
goto alreadyuse;
|
||||
data.byte(kCommandtype) = 229;
|
||||
bl = data.byte(kCommand);
|
||||
bh = data.byte(kObjecttype);
|
||||
al = 51;
|
||||
commandWithOb();
|
||||
alreadyuse:
|
||||
ax = data.word(kMousebutton);
|
||||
_cmp(ax, data.word(kOldbutton));
|
||||
if (flags.z())
|
||||
return /* (nouse) */;
|
||||
_and(ax, 1);
|
||||
if (!flags.z())
|
||||
goto douse;
|
||||
return;
|
||||
douse:
|
||||
useRoutine();
|
||||
}
|
||||
|
||||
void DreamGenContext::runTap() {
|
||||
STACK_CHECK;
|
||||
_cmp(data.byte(kWithobject), 255);
|
||||
|
@ -5208,39 +5184,6 @@ alreadyfull:
|
|||
putBackObStuff();
|
||||
}
|
||||
|
||||
void DreamGenContext::usePlinth() {
|
||||
STACK_CHECK;
|
||||
_cmp(data.byte(kWithobject), 255);
|
||||
if (!flags.z())
|
||||
goto plinthwith;
|
||||
withWhat();
|
||||
return;
|
||||
plinthwith:
|
||||
al = data.byte(kWithobject);
|
||||
ah = data.byte(kWithtype);
|
||||
cl = 'D';
|
||||
ch = 'K';
|
||||
dl = 'E';
|
||||
dh = 'Y';
|
||||
compare();
|
||||
if (flags.z())
|
||||
goto isrightkey;
|
||||
showFirstUse();
|
||||
putBackObStuff();
|
||||
return;
|
||||
isrightkey:
|
||||
_inc(data.byte(kProgresspoints));
|
||||
showSecondUse();
|
||||
data.word(kWatchingtime) = 220;
|
||||
data.word(kReeltowatch) = 0;
|
||||
data.word(kEndwatchreel) = 104;
|
||||
data.byte(kWatchspeed) = 1;
|
||||
data.byte(kSpeedcount) = 1;
|
||||
data.byte(kGetback) = 1;
|
||||
al = data.byte(kRoomafterdream);
|
||||
data.byte(kNewlocation) = al;
|
||||
}
|
||||
|
||||
void DreamGenContext::chewy() {
|
||||
STACK_CHECK;
|
||||
showFirstUse();
|
||||
|
@ -6322,41 +6265,6 @@ axeondoor:
|
|||
data.byte(kGetback) = 1;
|
||||
}
|
||||
|
||||
void DreamGenContext::useElvDoor() {
|
||||
STACK_CHECK;
|
||||
_cmp(data.byte(kWithobject), 255);
|
||||
if (!flags.z())
|
||||
goto gotdoorwith;
|
||||
withWhat();
|
||||
return;
|
||||
gotdoorwith:
|
||||
al = data.byte(kWithobject);
|
||||
ah = data.byte(kWithtype);
|
||||
cl = 'A';
|
||||
ch = 'X';
|
||||
dl = 'E';
|
||||
dh = 'D';
|
||||
compare();
|
||||
if (flags.z())
|
||||
goto axeondoor;
|
||||
al = 14;
|
||||
cx = 300;
|
||||
showPuzText();
|
||||
putBackObStuff();
|
||||
return;
|
||||
axeondoor:
|
||||
al = 15;
|
||||
cx = 300;
|
||||
showPuzText();
|
||||
_inc(data.byte(kProgresspoints));
|
||||
data.word(kWatchingtime) = 46*2;
|
||||
data.word(kReeltowatch) = 31;
|
||||
data.word(kEndwatchreel) = 77;
|
||||
data.byte(kWatchspeed) = 1;
|
||||
data.byte(kSpeedcount) = 1;
|
||||
data.byte(kGetback) = 1;
|
||||
}
|
||||
|
||||
void DreamGenContext::withWhat() {
|
||||
STACK_CHECK;
|
||||
createPanel();
|
||||
|
|
|
@ -641,7 +641,6 @@ public:
|
|||
void interviewer();
|
||||
void getKeyAndLogo();
|
||||
void selectOb();
|
||||
void usePlinth();
|
||||
void useCooker();
|
||||
void receptionist();
|
||||
void selectSlot();
|
||||
|
@ -689,7 +688,6 @@ public:
|
|||
void poolGuard();
|
||||
void lookAtPlace();
|
||||
void useAxe();
|
||||
void useElvDoor();
|
||||
void findAllOpen();
|
||||
void quitSymbol();
|
||||
void readFromFile();
|
||||
|
@ -794,7 +792,6 @@ public:
|
|||
void openOb();
|
||||
void createFile();
|
||||
void useHole();
|
||||
void useObject();
|
||||
void fadeToWhite();
|
||||
void showLoadOps();
|
||||
};
|
||||
|
|
|
@ -401,6 +401,9 @@
|
|||
void useFullCart();
|
||||
void useClearBox();
|
||||
void usePlate();
|
||||
void usePlinth();
|
||||
void useElvDoor();
|
||||
void useObject();
|
||||
void openTVDoor();
|
||||
void wearWatch();
|
||||
void wearShades();
|
||||
|
|
|
@ -820,4 +820,77 @@ void DreamGenContext::usePlate() {
|
|||
}
|
||||
}
|
||||
|
||||
void DreamGenContext::usePlinth() {
|
||||
if (data.byte(kWithobject) == 255) {
|
||||
withWhat();
|
||||
return;
|
||||
}
|
||||
|
||||
char id[4] = { 'D', 'K', 'E', 'Y' }; // TODO: convert to string with trailing zero
|
||||
if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) {
|
||||
// Wrong key
|
||||
showFirstUse();
|
||||
putBackObStuff();
|
||||
} else {
|
||||
data.byte(kProgresspoints)++;
|
||||
showSecondUse();
|
||||
data.word(kWatchingtime) = 220;
|
||||
data.word(kReeltowatch) = 0;
|
||||
data.word(kEndwatchreel) = 104;
|
||||
data.byte(kWatchspeed) = 1;
|
||||
data.byte(kSpeedcount) = 1;
|
||||
data.byte(kGetback) = 1;
|
||||
data.byte(kNewlocation) = data.byte(kRoomafterdream);
|
||||
}
|
||||
}
|
||||
|
||||
void DreamGenContext::useElvDoor() {
|
||||
if (data.byte(kWithobject) == 255) {
|
||||
withWhat();
|
||||
return;
|
||||
}
|
||||
|
||||
char id[4] = { 'A', 'X', 'E', 'D' }; // TODO: convert to string with trailing zero
|
||||
if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) {
|
||||
// Wrong item
|
||||
cx = 300;
|
||||
al = 14;
|
||||
showPuzText();
|
||||
putBackObStuff();
|
||||
} else {
|
||||
// Axe on door
|
||||
al = 15;
|
||||
cx = 300;
|
||||
showPuzText();
|
||||
_inc(data.byte(kProgresspoints));
|
||||
data.word(kWatchingtime) = 46*2;
|
||||
data.word(kReeltowatch) = 31;
|
||||
data.word(kEndwatchreel) = 77;
|
||||
data.byte(kWatchspeed) = 1;
|
||||
data.byte(kSpeedcount) = 1;
|
||||
data.byte(kGetback) = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void DreamGenContext::useObject() {
|
||||
data.byte(kWithobject) = 255;
|
||||
|
||||
if (data.byte(kCommandtype) != 229) {
|
||||
data.byte(kCommandtype) = 229;
|
||||
commandWithOb(data.byte(kCommand), data.byte(kObjecttype), 51);
|
||||
}
|
||||
|
||||
alreadyuse:
|
||||
ax = data.word(kMousebutton);
|
||||
_cmp(ax, data.word(kOldbutton));
|
||||
if (flags.z())
|
||||
return /* (nouse) */;
|
||||
_and(ax, 1);
|
||||
if (!flags.z())
|
||||
goto douse;
|
||||
return;
|
||||
douse:
|
||||
useRoutine();
|
||||
}
|
||||
|
||||
} /*namespace dreamgen */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue