diff options
author | Walter van Niftrik | 2010-01-26 19:51:08 +0000 |
---|---|---|
committer | Walter van Niftrik | 2010-01-26 19:51:08 +0000 |
commit | 473d8b7c2fb8fccdf7716308a5faced5e6259566 (patch) | |
tree | 4059b553ea25867166db9718aff8832beba085cb /engines/sci/engine/kstring.cpp | |
parent | 9861b04b935b84424b5b7950a2398dbfb44a99f9 (diff) | |
download | scummvm-rg350-473d8b7c2fb8fccdf7716308a5faced5e6259566.tar.gz scummvm-rg350-473d8b7c2fb8fccdf7716308a5faced5e6259566.tar.bz2 scummvm-rg350-473d8b7c2fb8fccdf7716308a5faced5e6259566.zip |
SCI: Add string support for odd-offset pointers into reg_t-based segments.
svn-id: r47572
Diffstat (limited to 'engines/sci/engine/kstring.cpp')
-rw-r--r-- | engines/sci/engine/kstring.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp index ee1e39047f..769964e914 100644 --- a/engines/sci/engine/kstring.cpp +++ b/engines/sci/engine/kstring.cpp @@ -115,7 +115,7 @@ reg_t kStrAt(EngineState *s, int argc, reg_t *argv) { } SegmentRef dest_r = s->_segMan->dereference(argv[0]); - if (!dest_r.raw) { + if (!dest_r.isValid()) { warning("Attempt to StrAt at invalid pointer %04x:%04x", PRINT_REG(argv[0])); return NULL_REG; } @@ -133,11 +133,15 @@ reg_t kStrAt(EngineState *s, int argc, reg_t *argv) { return s->r_acc; } + // FIXME: Move this to segman if (dest_r.isRaw) { value = dest_r.raw[offset]; if (argc > 2) /* Request to modify this char */ dest_r.raw[offset] = newvalue; } else { + if (dest_r.skipByte) + offset++; + reg_t &tmp = dest_r.reg[offset / 2]; if (!(offset & 1)) { value = tmp.offset & 0x00ff; |