From fa232d93b1e7530ba07067533412cc5e84b7c41e Mon Sep 17 00:00:00 2001 From: Bertrand Augereau Date: Sat, 30 Jul 2011 22:03:28 +0200 Subject: DREAMWEB: 'allocatemem' has a nicer API --- engines/dreamweb/stubs.cpp | 11 ++++++++--- engines/dreamweb/stubs.h | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'engines') 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); -- cgit v1.2.3