Skip to content

Commit

Permalink
DREAMWEB: 'intromagic2', 'intromagic3' ported to C++
Browse files Browse the repository at this point in the history
  • Loading branch information
bluegr committed Dec 7, 2011
1 parent 9e617d0 commit ad877e9
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 42 deletions.
2 changes: 2 additions & 0 deletions devtools/tasmrecover/tasm-recover
Expand Up @@ -360,6 +360,8 @@ generator = cpp(context, "DreamGen", blacklist = [
'intro2text',
'intro3text',
'intromagic1',
'intromagic2',
'intromagic3',
'intromusic',
'inventory',
'isitdescribed',
Expand Down
36 changes: 0 additions & 36 deletions engines/dreamweb/dreamgen.cpp
Expand Up @@ -720,42 +720,6 @@ void DreamGenContext::candles2() {
showGameReel();
}

void DreamGenContext::introMagic2() {
STACK_CHECK;
checkSpeed();
if (!flags.z())
goto introm2fin;
ax = es.word(bx+3);
_inc(ax);
_cmp(ax, 216);
if (!flags.z())
goto gotintrom2;
ax = 192;
gotintrom2:
es.word(bx+3) = ax;
introm2fin:
showGameReel();
}

void DreamGenContext::introMagic3() {
STACK_CHECK;
checkSpeed();
if (!flags.z())
goto introm3fin;
ax = es.word(bx+3);
_inc(ax);
_cmp(ax, 218);
if (!flags.z())
goto gotintrom3;
data.byte(kGetback) = 1;
gotintrom3:
es.word(bx+3) = ax;
introm3fin:
showGameReel();
al = data.byte(kMapx);
es.byte(bx+1) = al;
}

void DreamGenContext::introMonks1() {
STACK_CHECK;
checkSpeed();
Expand Down
2 changes: 0 additions & 2 deletions engines/dreamweb/dreamgen.h
Expand Up @@ -639,8 +639,6 @@ class DreamGenContext : public DreamBase, public Context {
void openFileNoCheck();
void fadeUpMon();
void clearChanges();
void introMagic2();
void introMagic3();
void showDiaryPage();
void transferToEx();
void reExFromInv();
Expand Down
29 changes: 25 additions & 4 deletions engines/dreamweb/people.cpp
Expand Up @@ -44,8 +44,8 @@ static void (DreamGenContext::*reelCallbacks[57])() = {
NULL, NULL,
&DreamGenContext::mugger, &DreamGenContext::helicopter,
NULL, NULL,
&DreamGenContext::introMagic2, &DreamGenContext::candles2,
NULL, &DreamGenContext::introMagic3,
NULL, &DreamGenContext::candles2,
NULL, NULL,
&DreamGenContext::introMonks1, NULL,
&DreamGenContext::introMonks2, NULL,
&DreamGenContext::monkAndRyan, &DreamGenContext::endGameSeq,
Expand Down Expand Up @@ -76,8 +76,8 @@ static void (DreamGenContext::*reelCallbacksCPP[57])(ReelRoutine &) = {
&DreamGenContext::train, &DreamGenContext::genericPerson /*aide*/,
/*&DreamGenContext::mugger*/NULL, /*&DreamGenContext::helicopter*/NULL,
&DreamGenContext::introMagic1, &DreamGenContext::introMusic,
/*&DreamGenContext::introMagic2*/NULL, /*&DreamGenContext::candles2*/NULL,
&DreamGenContext::gates, /*&DreamGenContext::introMagic3*/NULL,
&DreamGenContext::introMagic2, /*&DreamGenContext::candles2*/NULL,
&DreamGenContext::gates, &DreamGenContext::introMagic3,
/*&DreamGenContext::intromonks1*/NULL, &DreamGenContext::candles,
/*&DreamGenContext::intromonks2*/NULL, &DreamGenContext::handClap,
/*&DreamGenContext::monkAndRyan*/NULL, /*&DreamGenContext::endGameSeq*/NULL,
Expand Down Expand Up @@ -398,6 +398,27 @@ void DreamGenContext::introMagic1(ReelRoutine &routine) {
showGameReel(&routine);
}

void DreamGenContext::introMagic2(ReelRoutine &routine) {
if (checkSpeed(routine)) {
uint16 nextReelPointer = routine.reelPointer() + 1;
if (nextReelPointer == 216)
nextReelPointer = 192;
routine.setReelPointer(nextReelPointer);
}
showGameReel(&routine);
}

void DreamGenContext::introMagic3(ReelRoutine &routine) {
if (checkSpeed(routine)) {
uint16 nextReelPointer = routine.reelPointer() + 1;
if (nextReelPointer == 218)
data.byte(kGetback) = 1;
routine.setReelPointer(nextReelPointer);
}
showGameReel(&routine);
routine.mapX = data.byte(kMapx);
}

void DreamGenContext::introMusic(ReelRoutine &routine) {
}

Expand Down
2 changes: 2 additions & 0 deletions engines/dreamweb/stubs.h
Expand Up @@ -431,6 +431,8 @@
void manAsleep(ReelRoutine &routine);
void drunk(ReelRoutine &routine);
void introMagic1(ReelRoutine &routine);
void introMagic2(ReelRoutine &routine);
void introMagic3(ReelRoutine &routine);
void introMusic(ReelRoutine &routine);
void candles(ReelRoutine &routine);
void gates(ReelRoutine &routine);
Expand Down

0 comments on commit ad877e9

Please sign in to comment.