diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/dreamweb/dreamweb.cpp | 11 | ||||
-rw-r--r-- | engines/dreamweb/runtime.h | 8 |
2 files changed, 15 insertions, 4 deletions
diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 25e6118457..8c6b3ce3fb 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -153,11 +153,9 @@ void keyboardread(Context &context) { } void resetkeyboard(Context &context) { - ::error("resetkeyboard"); } void setkeyboardint(Context &context) { - ::error("setkeyboardint"); } void readfromfile(Context &context) { @@ -201,7 +199,12 @@ void gettime(Context &context) { } void allocatemem(Context &context) { - ::error("allocatemem"); + uint size = (context.bx + 2) * 16; + debug(1, "allocate mem, %u bytes", size); + context.flags._c = false; + SegmentRef seg = context.allocateSegment(size); + context.ax = (uint16)seg; + debug(1, "\tsegment address -> %04x", (uint16)context.ax); } void deallocatemem(Context &context) { @@ -213,7 +216,7 @@ void removeemm(Context &context) { } void setupemm(Context &context) { - ::error("setupemm"); + //fixme: double check this, but it seems that emm pages used only for sound } void pitinterupt(Context &context) { diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index 6b5f650fc6..bcc7c383a7 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -209,6 +209,14 @@ public: return SegmentRef(this, value, &i->_value); } + SegmentRef allocateSegment(uint size) { + unsigned id = kDefaultDataSegment + _segments.size(); + assert(!_segments.contains(id)); + Segment &seg = _segments[id]; + seg.data.resize(size); + return SegmentRef(this, id, &seg); + } + inline void _cmp(uint8 a, uint8 b) { uint8 x = a; _sub(x, b); |