diff options
author | Bertrand Augereau | 2011-08-30 10:56:49 +0200 |
---|---|---|
committer | Bertrand Augereau | 2011-08-30 12:17:18 +0200 |
commit | 6a46429c448aa3899fa93e49dc36cd3617b922c7 (patch) | |
tree | 9ad19ae77145b4258aee64cadd335290ee6603b7 | |
parent | b71123ef4f6ecfb8c60fa87d8fb2da0d2f40eded (diff) | |
download | scummvm-rg350-6a46429c448aa3899fa93e49dc36cd3617b922c7.tar.gz scummvm-rg350-6a46429c448aa3899fa93e49dc36cd3617b922c7.tar.bz2 scummvm-rg350-6a46429c448aa3899fa93e49dc36cd3617b922c7.zip |
DREAMWEB: 'transferinv' ported to C++
-rwxr-xr-x | devtools/tasmrecover/tasm-recover | 1 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 50 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 3 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 1 | ||||
-rw-r--r-- | engines/dreamweb/vgagrafx.cpp | 17 |
5 files changed, 20 insertions, 52 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index c129b248ce..f0cfe30ea7 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -170,6 +170,7 @@ generator = cpp(context, "DreamGen", blacklist = [ 'paneltomap', 'obpicture', 'delthisone', + 'transferinv', ], skip_output = [ # These functions are processed but not output 'dreamweb', diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index bfead17dc7..ee034448b5 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -2766,55 +2766,6 @@ void DreamGenContext::createpanel2() { showframe(); } -void DreamGenContext::transferinv() { - STACK_CHECK; - di = data.word(kExframepos); - push(di); - al = data.byte(kExpos); - ah = 0; - bx = ax; - _add(ax, ax); - _add(ax, bx); - _inc(ax); - cx = 6; - _mul(cx); - es = data.word(kExtras); - bx = (0); - _add(bx, ax); - _add(di, (0+2080)); - push(bx); - al = data.byte(kItemtotran); - ah = 0; - bx = ax; - _add(ax, ax); - _add(ax, bx); - _inc(ax); - cx = 6; - _mul(cx); - ds = data.word(kFreeframes); - bx = (0); - _add(bx, ax); - si = (0+2080); - al = ds.byte(bx); - ah = 0; - cl = ds.byte(bx+1); - ch = 0; - _add(si, ds.word(bx+2)); - dx = ds.word(bx+4); - bx = pop(); - es.byte(bx+0) = al; - es.byte(bx+1) = cl; - es.word(bx+4) = dx; - _mul(cx); - cx = ax; - push(cx); - _movsb(cx, true); - cx = pop(); - ax = pop(); - es.word(bx+2) = ax; - _add(data.word(kExframepos), cx); -} - void DreamGenContext::transfermap() { STACK_CHECK; di = data.word(kExframepos); @@ -17732,7 +17683,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) { case addr_createpanel2: createpanel2(); break; case addr_vsync: vsync(); break; case addr_doshake: doshake(); break; - case addr_transferinv: transferinv(); break; case addr_transfermap: transfermap(); break; case addr_fadedos: fadedos(); break; case addr_dofade: dofade(); break; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 963a864bb3..196c630d56 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -557,7 +557,6 @@ public: static const uint16 addr_dofade = 0xc24c; static const uint16 addr_fadedos = 0xc248; static const uint16 addr_transfermap = 0xc244; - static const uint16 addr_transferinv = 0xc240; static const uint16 addr_doshake = 0xc20c; static const uint16 addr_vsync = 0xc208; static const uint16 addr_createpanel2 = 0xc200; @@ -1775,7 +1774,7 @@ public: void look(); void setmouse(); //void checkone(); - void transferinv(); + //void transferinv(); void candles2(); void pickupob(); void error(); diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index 7c4f43acd3..f025e382e4 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -202,4 +202,5 @@ void getexpos(); void paneltomap(); void obpicture(); + void transferinv(); diff --git a/engines/dreamweb/vgagrafx.cpp b/engines/dreamweb/vgagrafx.cpp index 00fb1715ef..235d28cc01 100644 --- a/engines/dreamweb/vgagrafx.cpp +++ b/engines/dreamweb/vgagrafx.cpp @@ -415,5 +415,22 @@ void DreamGenContext::paneltomap() { multiget(segRef(data.word(kMapstore)).ptr(0, 0), data.word(kMapxstart) + data.word(kMapadx), data.word(kMapystart) + data.word(kMapady), data.byte(kMapxsize), data.byte(kMapysize)); } +void DreamGenContext::transferinv() { + const Frame *freeFrames = (const Frame *)segRef(data.word(kFreeframes)).ptr(kFrframedata, 0); + const Frame *freeFrame = freeFrames + (3 * data.byte(kItemtotran) + 1); + Frame *exFrames = (Frame *)segRef(data.word(kExtras)).ptr(kExframedata, 0); + Frame *exFrame = exFrames + (3 * data.byte(kExpos) + 1); + exFrame->width = freeFrame->width; + exFrame->height = freeFrame->height; + exFrame->x = freeFrame->x; + exFrame->y = freeFrame->y; + uint16 byteCount = freeFrame->width * freeFrame->height; + const uint8 *src = segRef(data.word(kFreeframes)).ptr(kFrframes + freeFrame->ptr(), byteCount); + uint8 *dst = segRef(data.word(kExtras)).ptr(kExframes + data.word(kExframepos), byteCount); + memcpy(dst, src, byteCount); + exFrame->setPtr(data.word(kExframepos)); + data.word(kExframepos) += byteCount; +} + } /*namespace dreamgen */ |