diff options
| -rwxr-xr-x | devtools/tasmrecover/tasm-recover | 1 | ||||
| -rw-r--r-- | engines/dreamweb/dreamgen.cpp | 115 | ||||
| -rw-r--r-- | engines/dreamweb/dreamgen.h | 3 | ||||
| -rw-r--r-- | engines/dreamweb/stubs.cpp | 42 | ||||
| -rw-r--r-- | engines/dreamweb/stubs.h | 1 |
5 files changed, 45 insertions, 117 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index f36938cbfd..86b789bb4c 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -152,6 +152,7 @@ generator = cpp(context, "DreamGen", blacklist = [ 'showblink', 'dumpblink', 'dumppointer', + 'showpointer', 'checkcoords', ], skip_output = [ # These functions are processed but not output diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index b39451b010..ffe8d81c3a 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -16336,120 +16336,6 @@ void DreamGenContext::putunderzoom() { multiput(); } -void DreamGenContext::showpointer() { - STACK_CHECK; - showblink(); - di = data.word(kMousex); - data.word(kOldpointerx) = di; - bx = data.word(kMousey); - data.word(kOldpointery) = bx; - _cmp(data.byte(kPickup), 1); - if (flags.z()) - goto itsanobject; - push(bx); - push(di); - ds = data.word(kIcons1); - al = data.byte(kPointerframe); - _add(al, 20); - ah = 0; - _add(ax, ax); - si = ax; - _add(ax, ax); - _add(si, ax); - cx = ds.word(si); - _cmp(cl, 12); - if (!flags.c()) - goto notsmallx; - cl = 12; -notsmallx: - _cmp(ch, 12); - if (!flags.c()) - goto notsmally; - ch = 12; -notsmally: - data.byte(kPointerxs) = cl; - data.byte(kPointerys) = ch; - push(ds); - ds = data.word(kBuffers); - si = (0+(228*13)+32+60); - multiget(); - ds = pop(); - di = pop(); - bx = pop(); - push(di); - push(bx); - al = data.byte(kPointerframe); - _add(al, 20); - ah = 0; - showframe(); - bx = pop(); - di = pop(); - return; -itsanobject: - al = data.byte(kItemframe); - ds = data.word(kExtras); - _cmp(data.byte(kObjecttype), 4); - if (flags.z()) - goto itsfrominv; - ds = data.word(kFreeframes); -itsfrominv: - cl = al; - _add(al, al); - _add(al, cl); - _inc(al); - ah = 0; - push(ax); - _add(ax, ax); - si = ax; - _add(ax, ax); - _add(si, ax); - ax = 2080; - cx = ds.word(si); - _cmp(cl, 12); - if (!flags.c()) - goto notsmallx2; - cl = 12; -notsmallx2: - _cmp(ch, 12); - if (!flags.c()) - goto notsmally2; - ch = 12; -notsmally2: - data.byte(kPointerxs) = cl; - data.byte(kPointerys) = ch; - ax = pop(); - push(di); - push(bx); - push(ax); - push(bx); - push(di); - push(ds); - al = cl; - ah = 0; - _shr(ax, 1); - _sub(data.word(kOldpointerx), ax); - _sub(di, ax); - al = ch; - _shr(ax, 1); - _sub(data.word(kOldpointery), ax); - _sub(bx, ax); - ds = data.word(kBuffers); - si = (0+(228*13)+32+60); - multiget(); - ds = pop(); - di = pop(); - bx = pop(); - ax = pop(); - ah = 128; - showframe(); - bx = pop(); - di = pop(); - ds = data.word(kIcons1); - al = 3; - ah = 128; - showframe(); -} - void DreamGenContext::undertextline() { STACK_CHECK; di = data.word(kTextaddressx); @@ -18805,7 +18691,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) { case addr_getunderzoom: getunderzoom(); break; case addr_dumpzoom: dumpzoom(); break; case addr_putunderzoom: putunderzoom(); break; - case addr_showpointer: showpointer(); break; case addr_undertextline: undertextline(); break; case addr_animpointer: animpointer(); break; case addr_setmouse: setmouse(); break; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 45aa873d1d..a6a32c22ac 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -87,7 +87,6 @@ public: static const uint16 addr_setmouse = 0xcae0; static const uint16 addr_animpointer = 0xcadc; static const uint16 addr_undertextline = 0xcad0; - static const uint16 addr_showpointer = 0xcac4; static const uint16 addr_putunderzoom = 0xcabc; static const uint16 addr_dumpzoom = 0xcab8; static const uint16 addr_getunderzoom = 0xcab4; @@ -1604,7 +1603,7 @@ public: void useplinth(); //void adjustlen(); //void quickquit(); - void showpointer(); + //void showpointer(); void usecooker(); void loadmenu(); //void aboutturn(); diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 22a3cf01c0..94d7a74d11 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -1466,6 +1466,48 @@ void DreamGenContext::checkcoords(const RectWithCallback *rectWithCallbacks) { } } +void DreamGenContext::showpointer() { + showblink(); + const Frame *icons1 = ((const Frame *)segRef(data.word(kIcons1)).ptr(0, 0)); + uint16 x = data.word(kMousex); + data.word(kOldpointerx) = data.word(kMousex); + uint16 y = data.word(kMousey); + data.word(kOldpointery) = data.word(kMousey); + if (data.byte(kPickup) == 1) { + const Frame *frames; + if (data.byte(kObjecttype) != 4) + frames = (const Frame *)segRef(data.word(kFreeframes)).ptr(0, 0); + else + frames = (const Frame *)segRef(data.word(kExtras)).ptr(0, 0); + const Frame *frame = frames + (3 * data.byte(kItemframe) + 1); + uint8 width = frame->width; + uint8 height = frame->height; + if (width < 12) + width = 12; + if (height < 12) + height = 12; + data.byte(kPointerxs) = width; + data.byte(kPointerys) = height; + data.word(kOldpointerx) -= width / 2; + data.word(kOldpointery) -= height / 2; + multiget(segRef(data.word(kBuffers)).ptr(kPointerback, 0), x - width / 2, y - height / 2, width, height); + showframe(frames, x, y, 3 * data.byte(kItemframe) + 1, 128); + showframe(icons1, x, y, 3, 128); + } else { + const Frame *frame = icons1 + (data.byte(kPointerframe) + 20); + uint8 width = frame->width; + uint8 height = frame->height; + if (width < 12) + width = 12; + if (height < 12) + height = 12; + data.byte(kPointerxs) = width; + data.byte(kPointerys) = height; + multiget(segRef(data.word(kBuffers)).ptr(kPointerback, 0), x, y, width, height); + showframe(icons1, x, y, data.byte(kPointerframe) + 20, 0); + } +} + bool DreamGenContext::isCD() { // The original sources has two codepaths depending if the game is 'if cd' or not // This is a hack to guess which version to use with the assumption that if we have a cd version diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index 8fbfda3d4f..dcd715a01d 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -181,6 +181,7 @@ void showblink(); void dumpblink(); void dumppointer(); + void showpointer(); void checkcoords(); void checkcoords(const RectWithCallback *rectWithCallbacks); |
