diff options
author | Torbjörn Andersson | 2004-04-23 07:02:11 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2004-04-23 07:02:11 +0000 |
commit | 8f8185f035d747c720371d88de90c54e43a543d0 (patch) | |
tree | 2599ef6fe6c74d0ea01bdb02e4a0619074da55d3 /sword2/interpreter.cpp | |
parent | fd38da7f134235c541860168f21c8706c2e62c19 (diff) | |
download | scummvm-rg350-8f8185f035d747c720371d88de90c54e43a543d0.tar.gz scummvm-rg350-8f8185f035d747c720371d88de90c54e43a543d0.tar.bz2 scummvm-rg350-8f8185f035d747c720371d88de90c54e43a543d0.zip |
Major revamping of the BS2 memory manager and, some small changes to the
resource manager. All new code! All new bugs!
svn-id: r13603
Diffstat (limited to 'sword2/interpreter.cpp')
-rw-r--r-- | sword2/interpreter.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sword2/interpreter.cpp b/sword2/interpreter.cpp index 4b67fcdb29..8807f24e4a 100644 --- a/sword2/interpreter.cpp +++ b/sword2/interpreter.cpp @@ -194,7 +194,7 @@ do { \ stack[stackPtr++] = (value); \ } while (false) -#define push_ptr(ptr) push(_vm->_memory->ptrToInt(ptr)) +#define push_ptr(ptr) push(_vm->_memory->encodePtr(ptr)) #define pop() (assert(stackPtr < ARRAYSIZE(stack)), stack[--stackPtr]) @@ -301,7 +301,7 @@ int Logic::runScript(char *scriptData, char *objectData, uint32 *offset) { int retVal; int caseCount; bool foundCase; - uint8 *ptr; + byte *ptr; curCommand = code[ip++]; @@ -372,7 +372,7 @@ int Logic::runScript(char *scriptData, char *objectData, uint32 *offset) { Read16ip(parameter); parameter /= 4; - ptr = (uint8 *) &localVars[parameter]; + ptr = (byte *) &localVars[parameter]; push_ptr(ptr); debug(9, "CP_PUSH_LOCAL_ADDR: &localVars[%d] => %p", parameter, ptr); break; @@ -382,7 +382,7 @@ int Logic::runScript(char *scriptData, char *objectData, uint32 *offset) { Read8ip(parameter); // ip now points to the string - ptr = (uint8 *) (code + ip); + ptr = (byte *) (code + ip); push_ptr(ptr); debug(9, "CP_PUSH_STRING: \"%s\"", ptr); ip += (parameter + 1); @@ -390,7 +390,7 @@ int Logic::runScript(char *scriptData, char *objectData, uint32 *offset) { case CP_PUSH_DEREFERENCED_STRUCTURE: // Push the address of a dereferenced structure Read32ip(parameter); - ptr = (uint8 *) (objectData + sizeof(int32) + sizeof(StandardHeader) + sizeof(ObjectHub) + parameter); + ptr = (byte *) (objectData + sizeof(int32) + sizeof(StandardHeader) + sizeof(ObjectHub) + parameter); push_ptr(ptr); debug(9, "CP_PUSH_DEREFERENCED_STRUCTURE: %d => %p", parameter, ptr); break; |