From 941869c466354356c7ebf76e5c6fe37fe06785cf Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 25 Aug 2018 12:21:36 +0300 Subject: 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 --- engines/sci/engine/scriptdebug.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'engines/sci/engine/scriptdebug.cpp') 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; -- cgit v1.2.3