aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/scriptdebug.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2018-08-25 12:21:36 +0300
committerFilippos Karapetis2018-08-25 12:39:12 +0300
commit941869c466354356c7ebf76e5c6fe37fe06785cf (patch)
treef08ad9e3db85b01e5e4583caa476aab6d69bf6ab /engines/sci/engine/scriptdebug.cpp
parent66cbaeefe20967348bb5306272f937dba0281021 (diff)
downloadscummvm-rg350-941869c466354356c7ebf76e5c6fe37fe06785cf.tar.gz
scummvm-rg350-941869c466354356c7ebf76e5c6fe37fe06785cf.tar.bz2
scummvm-rg350-941869c466354356c7ebf76e5c6fe37fe06785cf.zip
SCI32: Remove reg32_t and use reg_t in all cases
reg32_t was a transitive solution, before reg_t's were adapted to use 32-bit addresses internally, and before support for SCI3 was added. It was introduced as another way to handle large script offsets in SCI3, and was only used for the program counter (PC). It's no longer needed, as we now support SCI3 script offsets using reg_t's, so we can use make_reg32 in all cases where we need to access offsets over 64KB
Diffstat (limited to 'engines/sci/engine/scriptdebug.cpp')
-rw-r--r--engines/sci/engine/scriptdebug.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp
index b4dcbef0d4..f884e4da60 100644
--- a/engines/sci/engine/scriptdebug.cpp
+++ b/engines/sci/engine/scriptdebug.cpp
@@ -81,12 +81,10 @@ void DebugState::updateActiveBreakpointTypes() {
}
// Disassembles one command from the heap, returns address of next command or 0 if a ret was encountered.
-reg_t disassemble(EngineState *s, reg32_t pos, const Object *obj, bool printBWTag, bool printBytecode) {
+reg_t disassemble(EngineState *s, reg_t pos, const Object *obj, bool printBWTag, bool printBytecode) {
SegmentObj *mobj = s->_segMan->getSegment(pos.getSegment(), SEG_TYPE_SCRIPT);
Script *script_entity = NULL;
- reg_t retval;
- retval.setSegment(pos.getSegment());
- retval.setOffset(pos.getOffset() + 1);
+ reg_t retval = make_reg32(pos.getSegment(), pos.getOffset() + 1);
uint16 param_value = 0xffff; // Suppress GCC warning by setting default value, chose value as invalid to getKernelName etc.
uint i = 0;
Kernel *kernel = g_sci->getKernel();
@@ -261,9 +259,7 @@ reg_t disassemble(EngineState *s, reg32_t pos, const Object *obj, bool printBWTa
}
const uint32 offset = findOffset(param_value, script_entity, pos.getOffset() + bytecount);
- reg_t addr;
- addr.setSegment(retval.getSegment());
- addr.setOffset(offset);
+ reg_t addr = make_reg32(retval.getSegment(), offset);
if (!s->_segMan->isObject(addr)) {
debugN("\t\"%s\"", s->_segMan->derefString(addr));
} else {
@@ -438,7 +434,7 @@ void SciEngine::scriptDebug() {
}
if (_debugState.seeking != kDebugSeekNothing) {
- const reg32_t pc = s->xs->addr.pc;
+ const reg_t pc = s->xs->addr.pc;
SegmentObj *mobj = s->_segMan->getSegment(pc.getSegment(), SEG_TYPE_SCRIPT);
if (mobj) {
@@ -762,7 +758,7 @@ bool SciEngine::checkExportBreakpoint(uint16 script, uint16 pubfunct) {
return found;
}
-bool SciEngine::checkAddressBreakpoint(const reg32_t &address) {
+bool SciEngine::checkAddressBreakpoint(const reg_t &address) {
if (!(_debugState._activeBreakpointTypes & BREAK_ADDRESS))
return false;