aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2011-12-07 10:53:14 +0100
committerMax Horn2011-12-07 11:07:42 +0100
commit7b71bb6444533b01ac992b1fcfcb303625529ca5 (patch)
tree8c236a1c161d1c3b744f64f650381ddb12f93a0d
parenta29869b313f8ee0900afbeeb42891362f982741a (diff)
downloadscummvm-rg350-7b71bb6444533b01ac992b1fcfcb303625529ca5.tar.gz
scummvm-rg350-7b71bb6444533b01ac992b1fcfcb303625529ca5.tar.bz2
scummvm-rg350-7b71bb6444533b01ac992b1fcfcb303625529ca5.zip
DREAMWEB: Pass data segment as SegmentRef to Context constructor
And not as SegmentPtr.
-rw-r--r--devtools/tasmrecover/tasm/cpp.py2
-rw-r--r--engines/dreamweb/dreamgen.h2
-rw-r--r--engines/dreamweb/runtime.h26
3 files changed, 19 insertions, 11 deletions
diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py
index 24d353561a..e72779fa29 100644
--- a/devtools/tasmrecover/tasm/cpp.py
+++ b/devtools/tasmrecover/tasm/cpp.py
@@ -644,7 +644,7 @@ namespace %s {
"""
class %sContext : public DreamBase, public Context {
public:
- DreamGenContext() : DreamBase(), Context(_realData) {}
+ DreamGenContext() : DreamBase(), Context(data) {}
void __start();
"""
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index a5be8ec8ea..0dd7d8844a 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -538,7 +538,7 @@ static const uint16 kLenofreelrouts = (983-526);
class DreamGenContext : public DreamBase, public Context {
public:
- DreamGenContext() : DreamBase(), Context(_realData) {}
+ DreamGenContext() : DreamBase(), Context(data) {}
void __start();
#include "stubs.h" // Allow hand-reversed functions to have a signature different than void f()
diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h
index 48f7c88a20..a37fb56967 100644
--- a/engines/dreamweb/runtime.h
+++ b/engines/dreamweb/runtime.h
@@ -151,15 +151,19 @@ public:
: _value(value), _segment(segment) {
}
+ inline operator uint16() const {
+ return _value;
+ }
+
+ SegmentPtr getSegmentPtr() const {
+ return _segment;
+ }
+
inline uint8 &byte(unsigned index) {
assert(_segment != 0);
return _segment->byte(index);
}
- inline operator uint16() const {
- return _value;
- }
-
inline WordRef word(unsigned index) {
//debug(1, "getting word ref for %04x:%d", _value, index);
assert(_segment != 0);
@@ -194,6 +198,10 @@ public:
: _context(ctx), SegmentRef(value, segment) {
}
+ MutableSegmentRef(Context *ctx, SegmentRef seg)
+ : _context(ctx), SegmentRef(seg) {
+ }
+
inline MutableSegmentRef& operator=(const uint16 id);
};
@@ -255,12 +263,12 @@ public:
MutableSegmentRef es;
Flags flags;
- Context(SegmentPtr realData): al(ax), ah(ax), bl(bx), bh(bx), cl(cx), ch(cx), dl(dx), dh(dx),
- cs(kDefaultDataSegment, realData),
- ds(this, kDefaultDataSegment, realData),
- es(this, kDefaultDataSegment, realData) {
+ Context(SegmentRef data): al(ax), ah(ax), bl(bx), bh(bx), cl(cx), ch(cx), dl(dx), dh(dx),
+ cs(data),
+ ds(this, data),
+ es(this, data) {
- _segments[kDefaultDataSegment] = realData;
+ _segments[kDefaultDataSegment] = data.getSegmentPtr();
}
SegmentRef getSegment(uint16 value) {