diff options
author | Bertrand Augereau | 2011-07-30 22:03:28 +0200 |
---|---|---|
committer | Bertrand Augereau | 2011-07-30 22:03:28 +0200 |
commit | fa232d93b1e7530ba07067533412cc5e84b7c41e (patch) | |
tree | 08031261e886a6879a8d2bc6267f958ee5ee257d | |
parent | a607b78ec0fda1bb029dc9e215b397eadc408eca (diff) | |
download | scummvm-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.cpp | 11 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 1 |
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); |