diff options
author | Bertrand Augereau | 2011-12-03 17:31:29 +0100 |
---|---|---|
committer | Bertrand Augereau | 2011-12-03 18:06:24 +0100 |
commit | 4619419402094608a7d56ab454610e4680f29887 (patch) | |
tree | b247b6a4660da012b38bcec8bff8235d42b8ccc3 /engines | |
parent | f6f47d13cc7552bc1cca080b9ac5d97f2caa06fd (diff) | |
download | scummvm-rg350-4619419402094608a7d56ab454610e4680f29887.tar.gz scummvm-rg350-4619419402094608a7d56ab454610e4680f29887.tar.bz2 scummvm-rg350-4619419402094608a7d56ab454610e4680f29887.zip |
DREAMWEB: 'rockstar' ported to C++
Diffstat (limited to 'engines')
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 59 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 1 | ||||
-rw-r--r-- | engines/dreamweb/sprite.cpp | 41 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 1 |
4 files changed, 40 insertions, 62 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 6ade575c32..b89c1dcc27 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -360,65 +360,6 @@ gotsoldframe: addToPeopleList(); } -void DreamGenContext::rockstar() { - STACK_CHECK; - ax = es.word(bx+3); - _cmp(ax, 303); - if (flags.z()) - goto rockcombatend; - _cmp(ax, 118); - if (flags.z()) - goto rockcombatend; - checkSpeed(); - if (!flags.z()) - goto rockspeed; - ax = es.word(bx+3); - _inc(ax); - _cmp(ax, 118); - if (!flags.z()) - goto notbeforedead; - data.byte(kMandead) = 2; - goto gotrockframe; -notbeforedead: - _cmp(ax, 79); - if (!flags.z()) - goto gotrockframe; - _dec(ax); - _cmp(data.byte(kLastweapon), 1); - if (!flags.z()) - goto notgunonrock; - data.byte(kLastweapon) = -1; - ax = 123; - goto gotrockframe; -notgunonrock: - _inc(data.byte(kCombatcount)); - _cmp(data.byte(kCombatcount), 40); - if (!flags.z()) - goto gotrockframe; - data.byte(kCombatcount) = 0; - ax = 79; -gotrockframe: - es.word(bx+3) = ax; -rockspeed: - showGameReel(); - _cmp(es.word(bx+3), 78); - if (!flags.z()) - goto notalkrock; - addToPeopleList(); - data.byte(kPointermode) = 2; - data.word(kWatchingtime) = 0; - return; -notalkrock: - data.word(kWatchingtime) = 2; - data.byte(kPointermode) = 0; - al = data.byte(kMapy); - es.byte(bx+2) = al; - return; -rockcombatend: - data.byte(kNewlocation) = 45; - showGameReel(); -} - void DreamGenContext::helicopter() { STACK_CHECK; ax = es.word(bx+3); diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index b0cb21f231..8f30dd42a8 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -794,7 +794,6 @@ public: void drinker(); void placeFreeObject(); void allPalette(); - void rockstar(); void adjustRight(); void putUnderZoom(); void vSync(); diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp index b2ac6f5c9e..67ce7dcbba 100644 --- a/engines/dreamweb/sprite.cpp +++ b/engines/dreamweb/sprite.cpp @@ -581,7 +581,7 @@ static void (DreamGenContext::*reelCallbacks[57])() = { &DreamGenContext::keeper, &DreamGenContext::candles1, &DreamGenContext::smallCandle, &DreamGenContext::security, &DreamGenContext::copper, &DreamGenContext::poolGuard, - &DreamGenContext::rockstar, &DreamGenContext::businessMan, + NULL, &DreamGenContext::businessMan, &DreamGenContext::train, &DreamGenContext::aide, &DreamGenContext::mugger, &DreamGenContext::helicopter, &DreamGenContext::introMagic1, &DreamGenContext::introMusic, @@ -613,7 +613,7 @@ static void (DreamGenContext::*reelCallbacksCPP[57])(ReelRoutine &) = { /*&DreamGenContext::keeper*/NULL, /*&DreamGenContext::candles1*/NULL, /*&DreamGenContext::smallcandle*/NULL, /*&DreamGenContext::security*/NULL, /*&DreamGenContext::copper*/NULL, /*&DreamGenContext::poolGuard*/NULL, - /*&DreamGenContext::rockstar*/NULL, /*&DreamGenContext::businessMan*/NULL, + &DreamGenContext::rockstar, /*&DreamGenContext::businessMan*/NULL, /*&DreamGenContext::train*/NULL, /*&DreamGenContext::aide*/NULL, /*&DreamGenContext::mugger*/NULL, /*&DreamGenContext::helicopter*/NULL, /*&DreamGenContext::introMagic1*/NULL, /*&DreamGenContext::introMusic*/NULL, @@ -1137,5 +1137,42 @@ void DreamGenContext::sparky(ReelRoutine &routine) { data.byte(kTalkedtosparky) = 1; } +void DreamGenContext::rockstar(ReelRoutine &routine) { + if ((routine.reelPointer() == 303) || (routine.reelPointer() == 118)) { + data.byte(kNewlocation) = 45; + showGameReel(&routine); + return; + } + if (checkSpeed(&routine)) { + uint16 nextReelPointer = routine.reelPointer() + 1; + if (nextReelPointer == 118) { + data.byte(kMandead) = 2; + } else if (nextReelPointer == 79) { + --nextReelPointer; + if (data.byte(kLastweapon) != 1) { + ++data.byte(kCombatcount); + if (data.byte(kCombatcount) == 40) { + data.byte(kCombatcount) = 0; + nextReelPointer = 79; + } + } else { + data.byte(kLastweapon) = -1; + nextReelPointer = 123; + } + } + routine.setReelPointer(nextReelPointer); + } + showGameReel(&routine); + if (routine.reelPointer() == 78) { + addToPeopleList(&routine); + data.byte(kPointermode) = 2; + data.word(kWatchingtime) = 0; + } else { + data.word(kWatchingtime) = 2; + data.byte(kPointermode) = 0; + routine.mapY = data.byte(kMapy); + } +} + } /*namespace dreamgen */ diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index de9335f289..9adad3dbb7 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -386,6 +386,7 @@ void sparky(ReelRoutine &routine); void femaleFan(ReelRoutine &routine); void maleFan(ReelRoutine &routine); + void rockstar(ReelRoutine &routine); void singleKey(uint8 key, uint16 x, uint16 y); void showKeypad(); void showOuterPad(); |