diff options
-rwxr-xr-x | devtools/tasmrecover/tasm-recover | 2 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 61 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 2 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 2 | ||||
-rw-r--r-- | engines/dreamweb/use.cpp | 67 |
5 files changed, 61 insertions, 73 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index 56f968eeec..11dea3292e 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -421,6 +421,7 @@ generator = cpp(context, "DreamGen", blacklist = [ 'openpoolboss', 'openryan' 'opensarters', + 'opentvdoor', 'openyourneighbour', 'othersmoker', 'out22c', @@ -582,6 +583,7 @@ generator = cpp(context, "DreamGen", blacklist = [ 'usecharset1', 'usechurchgate', 'usechurchhole', + 'useclearbox', 'usecoveredbox', 'usedryer', 'useelevator1', diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index a2f75bd842..4f8792c471 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -5611,39 +5611,6 @@ nextcart: data.byte(kGetback) = 1; } -void DreamGenContext::useClearBox() { - STACK_CHECK; - _cmp(data.byte(kWithobject), 255); - if (!flags.z()) - goto clearboxwith; - withWhat(); - return; -clearboxwith: - al = data.byte(kWithobject); - ah = data.byte(kWithtype); - cl = 'R'; - ch = 'A'; - dl = 'I'; - dh = 'L'; - compare(); - if (flags.z()) - goto openbox; - cx = 300; - al = 14; - showPuzText(); - putBackObStuff(); - return; -openbox: - _inc(data.byte(kProgresspoints)); - showFirstUse(); - data.word(kWatchingtime) = 80; - data.word(kReeltowatch) = 67; - data.word(kEndwatchreel) = 105; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; -} - void DreamGenContext::useOpenBox() { STACK_CHECK; _cmp(data.byte(kWithobject), 255); @@ -5776,34 +5743,6 @@ thingsonaltar: data.byte(kGetback) = 1; } -void DreamGenContext::openTVDoor() { - STACK_CHECK; - _cmp(data.byte(kWithobject), 255); - if (!flags.z()) - goto tvdoorwith; - withWhat(); - return; -tvdoorwith: - al = data.byte(kWithobject); - ah = data.byte(kWithtype); - cl = 'U'; - ch = 'L'; - dl = 'O'; - dh = 'K'; - compare(); - if (flags.z()) - goto keyontv; - cx = 300; - al = 14; - showPuzText(); - putBackObStuff(); - return; -keyontv: - showFirstUse(); - data.byte(kLockstatus) = 0; - data.byte(kGetback) = 1; -} - void DreamGenContext::nextColon() { STACK_CHECK; lookcolon: diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index a504450810..2c870ec7a7 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -608,7 +608,6 @@ public: void lookInInterface(); void loadSpeech(); void adjustLeft(); - void useClearBox(); void entryAnims(); void getFreeAd(); void showArrows(); @@ -734,7 +733,6 @@ public: void showGun(); void louisChair(); void locationPic(); - void openTVDoor(); void triggerMessage(); void smallCandle(); void swapWithOpen(); diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index 6b90f74d43..18942e505a 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -399,6 +399,8 @@ void useWall(); void useChurchGate(); void useFullCart(); + void useClearBox(); + void openTVDoor(); void wearWatch(); void wearShades(); void checkFolderCoords(); diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 5bc8a4f93b..d33ad97821 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -331,13 +331,13 @@ void DreamGenContext::useShield() { data.byte(kLastweapon) = 3; showSecondUse(); data.byte(kGetback) = 1; - data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1; + data.byte(kProgresspoints)++; removeObFromInv(); } } void DreamGenContext::useCoveredBox() { - data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1; + data.byte(kProgresspoints)++; showFirstUse(); data.word(kWatchingtime) = 50; data.word(kReeltowatch) = 41; @@ -429,7 +429,7 @@ void DreamGenContext::useBalcony() { turnPathOff(3); turnPathOff(4); turnPathOff(5); - data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1; + data.byte(kProgresspoints)++; data.byte(kManspath) = 6; data.byte(kDestination) = 6; data.byte(kFinaldest) = 6; @@ -450,7 +450,7 @@ void DreamGenContext::useWindow() { showSecondUse(); putBackObStuff(); } else { - data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1; + data.byte(kProgresspoints)++; showFirstUse(); data.byte(kNewlocation) = 29; data.byte(kGetback) = 1; @@ -458,7 +458,7 @@ void DreamGenContext::useWindow() { } void DreamGenContext::trapDoor() { - data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1; + data.byte(kProgresspoints)++; showFirstUse(); switchRyanOff(); data.word(kWatchingtime) = 20 * 2; @@ -605,7 +605,7 @@ void DreamGenContext::sLabDoorA() { data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; } else { - data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1; + data.byte(kProgresspoints)++; data.word(kWatchingtime) = 60; data.word(kEndwatchreel) = 42; data.byte(kNewlocation) = 47; @@ -625,7 +625,7 @@ void DreamGenContext::sLabDoorC() { data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; } else { - data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1; + data.byte(kProgresspoints)++; data.word(kWatchingtime) = 60; data.word(kEndwatchreel) = 135; data.byte(kNewlocation) = 47; @@ -645,7 +645,7 @@ void DreamGenContext::sLabDoorD() { data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; } else { - data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1; + data.byte(kProgresspoints)++; data.word(kWatchingtime) = 60; data.word(kEndwatchreel) = 102; data.byte(kNewlocation) = 47; @@ -665,7 +665,7 @@ void DreamGenContext::sLabDoorE() { data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; } else { - data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1; + data.byte(kProgresspoints)++; data.word(kWatchingtime) = 60; data.word(kEndwatchreel) = 168; data.byte(kNewlocation) = 47; @@ -685,7 +685,7 @@ void DreamGenContext::sLabDoorF() { data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; } else { - data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1; + data.byte(kProgresspoints)++; data.word(kWatchingtime) = 60; data.word(kEndwatchreel) = 197; data.byte(kNewlocation) = 47; @@ -739,4 +739,51 @@ void DreamGenContext::useFullCart() { data.byte(kGetback) = 1; } +void DreamGenContext::useClearBox() { + if (data.byte(kWithobject) == 255) { + withWhat(); + return; + } + + char id[4] = { 'R', 'A', 'I', 'L' }; // TODO: convert to string with trailing zero + if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { + // Wrong item + cx = 300; + al = 14; + showPuzText(); + putBackObStuff(); + } else { + // Open box + data.byte(kProgresspoints)++; + showFirstUse(); + data.word(kWatchingtime) = 80; + data.word(kReeltowatch) = 67; + data.word(kEndwatchreel) = 105; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; + } +} + +void DreamGenContext::openTVDoor() { + if (data.byte(kWithobject) == 255) { + withWhat(); + return; + } + + char id[4] = { 'U', 'L', 'O', 'K' }; // TODO: convert to string with trailing zero + if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { + // Wrong item + cx = 300; + al = 14; + showPuzText(); + putBackObStuff(); + } else { + // Key on TV + showFirstUse(); + data.byte(kLockstatus) = 0; + data.byte(kGetback) = 1; + } +} + } /*namespace dreamgen */ |