SCI: Add new type SegmentRef which ultimately will allow us to distinguish between raw and 'reg_t' memory blocks in client code

svn-id: r44244
This commit is contained in:
Max Horn 2009-09-22 00:36:24 +00:00
parent 97d1f79e2d
commit 5f5ab54810
5 changed files with 89 additions and 54 deletions

View file

@ -1951,7 +1951,8 @@ bool Console::cmdViewReference(int argc, const char **argv) {
break;
case KSIG_REF: {
int size;
byte *block = _vm->_gamestate->segMan->dereference(reg, &size);
const SegmentRef block = _vm->_gamestate->segMan->dereference(reg);
size = block.maxSize;
DebugPrintf("raw data\n");
@ -1966,7 +1967,7 @@ bool Console::cmdViewReference(int argc, const char **argv) {
if (reg_end.segment != 0)
DebugPrintf("Block size less than or equal to %d\n", size);
Common::hexdump(block, size, 16, 0);
Common::hexdump(block.raw, size, 16, 0);
}
break;
case KSIG_ARITHMETIC:
@ -2248,8 +2249,8 @@ bool Console::cmdDissassembleAddress(int argc, const char **argv) {
return true;
}
_vm->_gamestate->segMan->dereference(vpc, &size);
size += vpc.offset; // total segment size
SegmentRef ref = _vm->_gamestate->segMan->dereference(vpc);
size = ref.maxSize + vpc.offset; // total segment size
for (int i = 2; i < argc; i++) {
if (!scumm_stricmp(argv[i], "bwt"))