diff options
Diffstat (limited to 'engines/dreamweb/runtime.h')
-rw-r--r-- | engines/dreamweb/runtime.h | 26 |
1 files changed, 17 insertions, 9 deletions
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) { |