aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBertrand Augereau2011-07-30 22:03:28 +0200
committerBertrand Augereau2011-07-30 22:03:28 +0200
commitfa232d93b1e7530ba07067533412cc5e84b7c41e (patch)
tree08031261e886a6879a8d2bc6267f958ee5ee257d
parenta607b78ec0fda1bb029dc9e215b397eadc408eca (diff)
downloadscummvm-rg350-fa232d93b1e7530ba07067533412cc5e84b7c41e.tar.gz
scummvm-rg350-fa232d93b1e7530ba07067533412cc5e84b7c41e.tar.bz2
scummvm-rg350-fa232d93b1e7530ba07067533412cc5e84b7c41e.zip
DREAMWEB: 'allocatemem' has a nicer API
-rw-r--r--engines/dreamweb/stubs.cpp11
-rw-r--r--engines/dreamweb/stubs.h1
2 files changed, 9 insertions, 3 deletions
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 2b330c831f..8c3086aebb 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -338,12 +338,17 @@ void DreamGenContext::gettime() {
}
void DreamGenContext::allocatemem() {
- uint size = (bx + 2) * 16;
+ ax = allocatemem(bx);
+}
+
+uint16 DreamGenContext::allocatemem(uint16 paragraphs) {
+ uint size = (paragraphs + 2) * 16;
debug(1, "allocate mem, %u bytes", size);
flags._c = false;
SegmentRef seg = allocateSegment(size);
- ax = (uint16)seg;
- debug(1, "\tsegment address -> %04x", (uint16)ax);
+ uint16 result = (uint16)seg;
+ debug(1, "\tsegment address -> %04x", result);
+ return result;
}
void DreamGenContext::deallocatemem() {
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index fc3b7c9127..35f54b6c6e 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
+ uint16 allocatemem(uint16 paragraphs);
uint8 *workspace();
void multidump();
void multidump(uint16 x, uint16 y, uint8 width, uint8 height);