From f50fd3b7f93a8425f1a22e85b2012bca933252db Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 6 Dec 2011 02:34:01 +0200 Subject: DREAMWEB: 'foghornsound' and 'liftnoise' ported to C++ --- devtools/tasmrecover/tasm-recover | 2 ++ engines/dreamweb/dreamgen.cpp | 25 ------------------------- engines/dreamweb/dreamgen.h | 2 -- engines/dreamweb/people.cpp | 9 +++++++-- engines/dreamweb/sprite.cpp | 13 +++++++++---- engines/dreamweb/stubs.h | 2 ++ 6 files changed, 20 insertions(+), 33 deletions(-) diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index 9a0b3979a2..9ff1f26250 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -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', diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 595a869e68..c1a4a41138 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -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); diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 18732cf2d5..a70133f5ce 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -770,8 +770,6 @@ public: void fillOpen(); void signOn(); void deleteExText(); - void foghornSound(); - void liftNoise(); void showGun(); void louisChair(); void locationPic(); diff --git a/engines/dreamweb/people.cpp b/engines/dreamweb/people.cpp index 1bf46d32d7..93a9e91dcd 100644 --- a/engines/dreamweb/people.cpp +++ b/engines/dreamweb/people.cpp @@ -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 */ diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp index 7628a919d1..28b1ce8683 100644 --- a/engines/dreamweb/sprite.cpp +++ b/engines/dreamweb/sprite.cpp @@ -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 */ diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index 87b41e04c6..03b796a180 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -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 -- cgit v1.2.3