aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir2011-06-07 02:26:37 +0400
committerAlyssa Milburn2011-06-15 17:31:09 +0200
commit9d53cefa53349c5717e3f585445664b56361c4de (patch)
tree458dc6218b7c97e187c63c94a8a7b683a444d05c
parentd9e4fb5d0e2b0239478d9d7030ddd1150707cd68 (diff)
downloadscummvm-rg350-9d53cefa53349c5717e3f585445664b56361c4de.tar.gz
scummvm-rg350-9d53cefa53349c5717e3f585445664b56361c4de.tar.bz2
scummvm-rg350-9d53cefa53349c5717e3f585445664b56361c4de.zip
DREAMWEB: added allocateSegment, added some stubs
-rw-r--r--engines/dreamweb/dreamweb.cpp11
-rw-r--r--engines/dreamweb/runtime.h8
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);