DREAMWEB: Port 'entryanims' to C++

This commit is contained in:
Filippos Karapetis 2011-12-12 21:51:25 +02:00
parent b04af6dc31
commit 6507853b87
5 changed files with 83 additions and 135 deletions

View File

@ -357,6 +357,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'endpaltostart',
'entercode',
'entersymbol',
'entryanims',
'entrytexts',
'eraseoldobs',
'error',

View File

@ -5029,137 +5029,6 @@ nomatchslot:
goto slotloop;
}
void DreamGenContext::entryAnims() {
STACK_CHECK;
data.word(kReeltowatch) = -1;
data.byte(kWatchmode) = -1;
_cmp(data.byte(kLocation), 33);
if (!flags.z())
goto notinthebeach;
switchRyanOff();
data.word(kWatchingtime) = 76*2;
data.word(kReeltowatch) = 0;
data.word(kEndwatchreel) = 76;
data.byte(kWatchspeed) = 1;
data.byte(kSpeedcount) = 1;
return;
notinthebeach:
_cmp(data.byte(kLocation), 44);
if (!flags.z())
goto notsparkys;
al = 8;
resetLocation();
data.word(kWatchingtime) = 50*2;
data.word(kReeltowatch) = 247;
data.word(kEndwatchreel) = 297;
data.byte(kWatchspeed) = 1;
data.byte(kSpeedcount) = 1;
switchRyanOff();
return;
notsparkys:
_cmp(data.byte(kLocation), 22);
if (!flags.z())
goto notinthelift;
data.word(kWatchingtime) = 31*2;
data.word(kReeltowatch) = 0;
data.word(kEndwatchreel) = 30;
data.byte(kWatchspeed) = 1;
data.byte(kSpeedcount) = 1;
switchRyanOff();
return;
notinthelift:
_cmp(data.byte(kLocation), 26);
if (!flags.z())
goto notunderchurch;
data.byte(kSymboltopnum) = 2;
data.byte(kSymbolbotnum) = 1;
return;
notunderchurch:
_cmp(data.byte(kLocation), 45);
if (!flags.z())
goto notenterdream;
data.byte(kKeeperflag) = 0;
data.word(kWatchingtime) = 296;
data.word(kReeltowatch) = 45;
data.word(kEndwatchreel) = 198;
data.byte(kWatchspeed) = 1;
data.byte(kSpeedcount) = 1;
switchRyanOff();
return;
notenterdream:
_cmp(data.byte(kReallocation), 46);
if (!flags.z())
goto notcrystal;
_cmp(data.byte(kSartaindead), 1);
if (!flags.z())
goto notcrystal;
al = 0;
removeFreeObject();
return;
notcrystal:
_cmp(data.byte(kLocation), 9);
if (!flags.z())
goto nottopchurch;
al = 2;
checkIfPathIsOn();
if (flags.z())
goto nottopchurch;
_cmp(data.byte(kAidedead), 0);
if (flags.z())
goto nottopchurch;
al = 3;
checkIfPathIsOn();
if (!flags.z())
goto makedoorsopen;
al = 2;
turnPathOn();
makedoorsopen:
al = 4;
removeSetObject();
al = 5;
placeSetObject();
return;
nottopchurch:
_cmp(data.byte(kLocation), 47);
if (!flags.z())
goto notdreamcentre;
al = 4;
placeSetObject();
al = 5;
placeSetObject();
return;
notdreamcentre:
_cmp(data.byte(kLocation), 38);
if (!flags.z())
goto notcarpark;
data.word(kWatchingtime) = 57*2;
data.word(kReeltowatch) = 4;
data.word(kEndwatchreel) = 57;
data.byte(kWatchspeed) = 1;
data.byte(kSpeedcount) = 1;
switchRyanOff();
return;
notcarpark:
_cmp(data.byte(kLocation), 32);
if (!flags.z())
goto notalley;
data.word(kWatchingtime) = 66*2;
data.word(kReeltowatch) = 0;
data.word(kEndwatchreel) = 66;
data.byte(kWatchspeed) = 1;
data.byte(kSpeedcount) = 1;
switchRyanOff();
return;
notalley:
_cmp(data.byte(kLocation), 24);
if (!flags.z())
return /* (notedensagain) */;
al = 2;
ah = data.byte(kRoomnum);
_dec(ah);
turnAnyPathOn();
}
void DreamGenContext::clearBuffers() {
STACK_CHECK;
es = data.word(kBuffers);

View File

@ -522,7 +522,6 @@ public:
void inToInv();
void adjustLeft();
void deleteExText();
void entryAnims();
void getFreeAd();
void removeObFromInv();
void heavy();

View File

@ -4349,13 +4349,13 @@ void DreamBase::entryTexts() {
case 31:
setupTimedUse(30, 60, 11, 68, 64);
break;
case 20:
case 20: // Sarter's 2
setupTimedUse(31, 60, 11, 68, 64);
break;
case 24:
case 24: // Eden's lobby
setupTimedUse(32, 60, 3, 68, 64);
break;
case 34:
case 34: // Eden 2
setupTimedUse(33, 60, 3, 68, 64);
break;
default:
@ -4363,4 +4363,82 @@ void DreamBase::entryTexts() {
}
}
void DreamGenContext::entryAnims() {
data.word(kReeltowatch) = 0xFFFF;
data.byte(kWatchmode) = (byte)-1;
switch (data.byte(kLocation)) {
case 33: // beach
switchRyanOff();
data.word(kWatchingtime) = 76 * 2;
data.word(kReeltowatch) = 0;
data.word(kEndwatchreel) = 76;
data.byte(kWatchspeed) = 1;
data.byte(kSpeedcount) = 1;
break;
case 44: // Sparky's
al = 8;
resetLocation();
data.word(kWatchingtime) = 50*2;
data.word(kReeltowatch) = 247;
data.word(kEndwatchreel) = 297;
data.byte(kWatchspeed) = 1;
data.byte(kSpeedcount) = 1;
switchRyanOff();
break;
case 22: // lift
data.word(kWatchingtime) = 31 * 2;
data.word(kReeltowatch) = 0;
data.word(kEndwatchreel) = 30;
data.byte(kWatchspeed) = 1;
data.byte(kSpeedcount) = 1;
switchRyanOff();
break;
case 26: // under church
data.byte(kSymboltopnum) = 2;
data.byte(kSymbolbotnum) = 1;
break;
case 45: // entered Dreamweb
data.byte(kKeeperflag) = 0;
data.word(kWatchingtime) = 296;
data.word(kReeltowatch) = 45;
data.word(kEndwatchreel) = 198;
data.byte(kWatchspeed) = 1;
data.byte(kSpeedcount) = 1;
switchRyanOff();
break;
default:
if (data.byte(kReallocation) == 46 && data.byte(kSartaindead) == 1) { // Crystal
removeFreeObject(0);
} else if (data.byte(kLocation) == 9 && checkIfPathIsOn(2) && data.byte(kAidedead) == 0) {
// Top of church
if (checkIfPathIsOn(3))
turnPathOn(2);
// Make doors open
removeSetObject(4);
placeSetObject(5);
} else if (data.byte(kLocation) == 47) { // Dream centre
placeSetObject(4);
placeSetObject(5);
} else if (data.byte(kLocation) == 38) { // Car park
data.word(kWatchingtime) = 57 * 2;
data.word(kReeltowatch) = 4;
data.word(kEndwatchreel) = 57;
data.byte(kWatchspeed) = 1;
data.byte(kSpeedcount) = 1;
switchRyanOff();
} else if (data.byte(kLocation) == 32) { // Alley
data.word(kWatchingtime) = 66 * 2;
data.word(kReeltowatch) = 0;
data.word(kEndwatchreel) = 66;
data.byte(kWatchspeed) = 1;
data.byte(kSpeedcount) = 1;
switchRyanOff();
} else if (data.byte(kLocation) == 24) { // Eden's again
turnAnyPathOn(2, data.byte(kRoomnum) - 1);
}
}
}
} // End of namespace DreamGen

View File

@ -568,5 +568,6 @@
void autoAppear();
void quitKey();
void setupTimedUse();
void entryAnims();
#endif