mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-24 05:01:43 +00:00
SCI: cleanup
svn-id: r44128
This commit is contained in:
parent
68dfdce043
commit
b26f744e23
engines/sci/engine
@ -632,11 +632,10 @@ int determine_reg_type(SegManager *segMan, reg_t reg, bool allow_invalid) {
|
||||
return type;
|
||||
}
|
||||
|
||||
if ((reg.segment >= segMan->_heap.size()) || !segMan->_heap[reg.segment])
|
||||
mobj = segMan->getMemObject(reg.segment);
|
||||
if (!mobj)
|
||||
return 0; // Invalid
|
||||
|
||||
mobj = segMan->_heap[reg.segment];
|
||||
|
||||
SciVersion version = segMan->sciVersion(); // for the offset defines
|
||||
|
||||
switch (mobj->getType()) {
|
||||
|
@ -204,7 +204,7 @@ reg_t kMemory(EngineState *s, int, int argc, reg_t *argv) {
|
||||
warning("Attempt to peek invalid memory at %04x:%04x", PRINT_REG(argv[1]));
|
||||
return s->r_acc;
|
||||
}
|
||||
if (s->segMan->_heap[argv[1].segment]->getType() == MEM_OBJ_LOCALS)
|
||||
if (s->segMan->getMemObjectType(argv[1].segment) == MEM_OBJ_LOCALS)
|
||||
return *((reg_t *) ref);
|
||||
else
|
||||
return make_reg(0, (int16)READ_LE_UINT16(ref));
|
||||
@ -218,7 +218,7 @@ reg_t kMemory(EngineState *s, int, int argc, reg_t *argv) {
|
||||
return s->r_acc;
|
||||
}
|
||||
|
||||
if (s->segMan->_heap[argv[1].segment]->getType() == MEM_OBJ_LOCALS)
|
||||
if (s->segMan->getMemObjectType(argv[1].segment) == MEM_OBJ_LOCALS)
|
||||
*((reg_t *) ref) = argv[2];
|
||||
else {
|
||||
if (argv[2].segment) {
|
||||
|
@ -46,6 +46,7 @@ enum ScriptLoadType {
|
||||
|
||||
|
||||
class SegManager : public Common::Serializable {
|
||||
friend class Console;
|
||||
public:
|
||||
/**
|
||||
* Initialize the segment manager.
|
||||
@ -366,16 +367,18 @@ public:
|
||||
|
||||
SciVersion sciVersion() { return _resMan->sciVersion(); }
|
||||
|
||||
public: // TODO: make private
|
||||
Common::Array<MemObject *> _heap;
|
||||
Common::Array<Class> _classtable; /**< Table of all classes */
|
||||
|
||||
private:
|
||||
/** Map script ids to segment ids. */
|
||||
Common::HashMap<int, SegmentId> _scriptSegMap;
|
||||
|
||||
public: // TODO: make private
|
||||
Common::Array<MemObject *> _heap;
|
||||
bool _exportsAreWide;
|
||||
Common::Array<Class> _classtable; /**< Table of all classes */
|
||||
ResourceManager *_resMan;
|
||||
|
||||
bool _exportsAreWide;
|
||||
|
||||
SegmentId Clones_seg_id; ///< ID of the (a) clones segment
|
||||
SegmentId Lists_seg_id; ///< ID of the (a) list segment
|
||||
SegmentId Nodes_seg_id; ///< ID of the (a) node segment
|
||||
|
Loading…
x
Reference in New Issue
Block a user