diff options
-rwxr-xr-x | devtools/tasmrecover/tasm-recover | 1 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 43 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 1 | ||||
-rw-r--r-- | engines/dreamweb/pathfind.cpp | 27 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 1 |
5 files changed, 29 insertions, 44 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index 41bf3abe23..9c3f55d94e 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -498,6 +498,7 @@ generator = cpp(context, "DreamGen", blacklist = [ 'setupemm', 'setuppit', 'setuptimedtemp', + 'setwalk', 'showallex', 'showallfree', 'showallobs', diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 7fbf380d22..f1eabe84c3 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -9362,49 +9362,6 @@ searchmess: printDirect(); } -void DreamGenContext::setWalk() { - STACK_CHECK; - _cmp(data.byte(kLinepointer), 254); - if (!flags.z()) - goto alreadywalking; - al = data.byte(kPointerspath); - _cmp(al, data.byte(kManspath)); - if (flags.z()) - goto cantwalk2; - _cmp(data.byte(kWatchmode), 1); - if (flags.z()) - goto holdingreel; - _cmp(data.byte(kWatchmode), 2); - if (flags.z()) - return /* (cantwalk) */; - data.byte(kDestination) = al; - data.byte(kFinaldest) = al; - _cmp(data.word(kMousebutton), 2); - if (!flags.z()) - goto notwalkandexam; - _cmp(data.byte(kCommandtype), 3); - if (flags.z()) - goto notwalkandexam; - data.byte(kWalkandexam) = 1; - al = data.byte(kCommandtype); - data.byte(kWalkexamtype) = al; - al = data.byte(kCommand); - data.byte(kWalkexamnum) = al; -notwalkandexam: - autoSetWalk(); - return; -cantwalk2: - faceRightWay(); - return; -alreadywalking: - al = data.byte(kPointerspath); - data.byte(kFinaldest) = al; - return; -holdingreel: - data.byte(kDestafterhold) = al; - data.byte(kWatchmode) = 2; -} - void DreamGenContext::workoutFrames() { STACK_CHECK; bx = data.word(kLinestartx); diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 8589d2250e..bc22d5b68b 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -753,7 +753,6 @@ public: void dreamweb(); void dropError(); void checkInside(); - void setWalk(); void findPathOfPoint(); void isSetObOnMap(); void getDestInfo(); diff --git a/engines/dreamweb/pathfind.cpp b/engines/dreamweb/pathfind.cpp index a8ac4acf70..6b49a879ba 100644 --- a/engines/dreamweb/pathfind.cpp +++ b/engines/dreamweb/pathfind.cpp @@ -77,6 +77,33 @@ RoomPaths *DreamGenContext::getRoomsPaths() { return (RoomPaths *)result; } +void DreamGenContext::setWalk() { + if (data.byte(kLinepointer) != 254) { + // Already walking + data.byte(kFinaldest) = data.byte(kPointerspath); + } else if (data.byte(kPointerspath) == data.byte(kManspath)) { + // Can't walk + faceRightWay(); + } else if (data.byte(kWatchmode) == 1) { + // Holding reel + data.byte(kDestafterhold) = data.byte(kPointerspath); + data.byte(kWatchmode) = 2; + } else if (data.byte(kWatchmode) == 2) { + // Can't walk + } else { + data.byte(kDestination) = data.byte(kPointerspath); + data.byte(kFinaldest) = data.byte(kPointerspath); + if (data.word(kMousebutton) != 2 || data.word(kMousebutton) == 3) { + autoSetWalk(); + } else { + data.byte(kWalkandexam) = 1; + data.byte(kWalkexamtype) = data.byte(kCommandtype); + data.byte(kWalkexamnum) = data.byte(kCommand); + autoSetWalk(); + } + } +} + void DreamGenContext::autoSetWalk() { al = data.byte(kManspath); if (data.byte(kFinaldest) == al) diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index 74660e58b4..0a8ef491e1 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -520,5 +520,6 @@ void openSarters(); void openLouis(); void DOSReturn(); + void setWalk(); #endif |