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',
|
'useelevator3',
|
||||||
'useelevator4',
|
'useelevator4',
|
||||||
'useelevator5',
|
'useelevator5',
|
||||||
|
'useelvdoor',
|
||||||
'usefullcart',
|
'usefullcart',
|
||||||
'useladder',
|
'useladder',
|
||||||
'useladderb',
|
'useladderb',
|
||||||
'usehatch',
|
'usehatch',
|
||||||
'usemenu',
|
'usemenu',
|
||||||
'usemon',
|
'usemon',
|
||||||
|
'useobject',
|
||||||
'useplate',
|
'useplate',
|
||||||
|
'useplinth',
|
||||||
'userailing',
|
'userailing',
|
||||||
'useroutine',
|
'useroutine',
|
||||||
'useshield',
|
'useshield',
|
||||||
|
|
|
@ -5026,30 +5026,6 @@ void DreamGenContext::triggerMessage() {
|
||||||
data.byte(kLasttrigger) = 0;
|
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() {
|
void DreamGenContext::runTap() {
|
||||||
STACK_CHECK;
|
STACK_CHECK;
|
||||||
_cmp(data.byte(kWithobject), 255);
|
_cmp(data.byte(kWithobject), 255);
|
||||||
|
@ -5208,39 +5184,6 @@ alreadyfull:
|
||||||
putBackObStuff();
|
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() {
|
void DreamGenContext::chewy() {
|
||||||
STACK_CHECK;
|
STACK_CHECK;
|
||||||
showFirstUse();
|
showFirstUse();
|
||||||
|
@ -6322,41 +6265,6 @@ axeondoor:
|
||||||
data.byte(kGetback) = 1;
|
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() {
|
void DreamGenContext::withWhat() {
|
||||||
STACK_CHECK;
|
STACK_CHECK;
|
||||||
createPanel();
|
createPanel();
|
||||||
|
|
|
@ -641,7 +641,6 @@ public:
|
||||||
void interviewer();
|
void interviewer();
|
||||||
void getKeyAndLogo();
|
void getKeyAndLogo();
|
||||||
void selectOb();
|
void selectOb();
|
||||||
void usePlinth();
|
|
||||||
void useCooker();
|
void useCooker();
|
||||||
void receptionist();
|
void receptionist();
|
||||||
void selectSlot();
|
void selectSlot();
|
||||||
|
@ -689,7 +688,6 @@ public:
|
||||||
void poolGuard();
|
void poolGuard();
|
||||||
void lookAtPlace();
|
void lookAtPlace();
|
||||||
void useAxe();
|
void useAxe();
|
||||||
void useElvDoor();
|
|
||||||
void findAllOpen();
|
void findAllOpen();
|
||||||
void quitSymbol();
|
void quitSymbol();
|
||||||
void readFromFile();
|
void readFromFile();
|
||||||
|
@ -794,7 +792,6 @@ public:
|
||||||
void openOb();
|
void openOb();
|
||||||
void createFile();
|
void createFile();
|
||||||
void useHole();
|
void useHole();
|
||||||
void useObject();
|
|
||||||
void fadeToWhite();
|
void fadeToWhite();
|
||||||
void showLoadOps();
|
void showLoadOps();
|
||||||
};
|
};
|
||||||
|
|
|
@ -401,6 +401,9 @@
|
||||||
void useFullCart();
|
void useFullCart();
|
||||||
void useClearBox();
|
void useClearBox();
|
||||||
void usePlate();
|
void usePlate();
|
||||||
|
void usePlinth();
|
||||||
|
void useElvDoor();
|
||||||
|
void useObject();
|
||||||
void openTVDoor();
|
void openTVDoor();
|
||||||
void wearWatch();
|
void wearWatch();
|
||||||
void wearShades();
|
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 */
|
} /*namespace dreamgen */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue