DREAMWEB: 'foghornsound' and 'liftnoise' ported to C++

This commit is contained in:
Filippos Karapetis 2011-12-06 02:34:01 +02:00
parent 1b194dabae
commit f50fd3b7f9
6 changed files with 20 additions and 33 deletions

View file

@ -278,6 +278,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'finishedwalking',
'folderexit',
'folderhints',
'foghornsound',
'frameoutbh',
'frameoutfx',
'frameoutnm',
@ -331,6 +332,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'isitworn',
'kernchars',
'lastfolder',
'liftnoise',
'liftsprite',
'loadcart',
'loadfolder',

View file

@ -44,16 +44,6 @@ nobark:
es.word(bx+3) = ax;
}
void DreamGenContext::foghornSound() {
STACK_CHECK;
randomNumber();
_cmp(al, 198);
if (!flags.z())
return /* (nofog) */;
al = 13;
playChannel1();
}
void DreamGenContext::receptionist() {
STACK_CHECK;
checkSpeed();
@ -1654,21 +1644,6 @@ forgotone:
setupTimedUse();
}
void DreamGenContext::liftNoise() {
STACK_CHECK;
_cmp(data.byte(kReallocation), 5);
if (flags.z())
goto hissnoise;
_cmp(data.byte(kReallocation), 21);
if (flags.z())
goto hissnoise;
playChannel1();
return;
hissnoise:
al = 13;
playChannel1();
}
void DreamGenContext::delEverything() {
STACK_CHECK;
al = data.byte(kMapysize);

View file

@ -770,8 +770,6 @@ public:
void fillOpen();
void signOn();
void deleteExText();
void foghornSound();
void liftNoise();
void showGun();
void louisChair();
void locationPic();

View file

@ -51,7 +51,7 @@ static void (DreamGenContext::*reelCallbacks[57])() = {
&DreamGenContext::monkAndRyan, &DreamGenContext::endGameSeq,
&DreamGenContext::priest, NULL,
NULL, &DreamGenContext::alleyBarkSound,
&DreamGenContext::foghornSound, NULL,
NULL, NULL,
NULL, NULL,
NULL
};
@ -83,7 +83,7 @@ static void (DreamGenContext::*reelCallbacksCPP[57])(ReelRoutine &) = {
/*&DreamGenContext::monkAndRyan*/NULL, /*&DreamGenContext::endGameSeq*/NULL,
/*&DreamGenContext::priest*/NULL, &DreamGenContext::madman,
&DreamGenContext::madmansTelly, /*&DreamGenContext::alleyBarkSound*/NULL,
/*&DreamGenContext::foghornSound*/NULL, &DreamGenContext::carParkDrip,
&DreamGenContext::foghornSound, &DreamGenContext::carParkDrip,
&DreamGenContext::carParkDrip, &DreamGenContext::carParkDrip,
&DreamGenContext::carParkDrip
};
@ -455,5 +455,10 @@ void DreamGenContext::carParkDrip(ReelRoutine &routine) {
playChannel1(14);
}
void DreamGenContext::foghornSound(ReelRoutine &routine) {
if (engine->randomNumber() == 198)
playChannel1(13);
}
} /*namespace dreamgen */

View file

@ -440,8 +440,7 @@ void DreamGenContext::liftSprite(Sprite *sprite, SetObject *objData) {
}
++sprite->animFrame;
if (sprite->animFrame == 1) {
al = 2;
liftNoise();
liftNoise(2);
}
sprite->frameNumber = objData->index = objData->frames[sprite->animFrame];
} else { //closeLift
@ -452,8 +451,7 @@ void DreamGenContext::liftSprite(Sprite *sprite, SetObject *objData) {
}
--sprite->animFrame;
if (sprite->animFrame == 11) {
al = 3;
liftNoise();
liftNoise(3);
}
sprite->frameNumber = objData->index = objData->frames[sprite->animFrame];
}
@ -1172,5 +1170,12 @@ void DreamGenContext::getRidOfReels() {
deallocateMem(data.word(kReel3));
}
void DreamGenContext::liftNoise(uint8 index) {
if (data.byte(kReallocation) == 5 || data.byte(kReallocation) == 21)
playChannel1(13); // hiss noise
else
playChannel1(index);
}
} /*namespace dreamgen */

View file

@ -421,6 +421,7 @@
void louis(ReelRoutine &routine);
void handClap(ReelRoutine &routine);
void carParkDrip(ReelRoutine &routine);
void foghornSound(ReelRoutine &routine);
void singleKey(uint8 key, uint16 x, uint16 y);
void loadSaveBox();
void loadKeypad();
@ -480,5 +481,6 @@
void clearReels();
void getRidOfReels();
void setMode();
void liftNoise(uint8 index);
#endif