diff options
Diffstat (limited to 'engines/sci/engine/selector.cpp')
-rw-r--r-- | engines/sci/engine/selector.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/engines/sci/engine/selector.cpp b/engines/sci/engine/selector.cpp index cdbce5a6e4..92fed6e13e 100644 --- a/engines/sci/engine/selector.cpp +++ b/engines/sci/engine/selector.cpp @@ -176,32 +176,32 @@ void Kernel::mapSelectors() { #endif } -reg_t read_selector(SegManager *segMan, reg_t object, Selector selector_id) { +reg_t readSelector(SegManager *segMan, reg_t object, Selector selectorId) { ObjVarRef address; - if (lookup_selector(segMan, object, selector_id, &address, NULL) != kSelectorVariable) + if (lookupSelector(segMan, object, selectorId, &address, NULL) != kSelectorVariable) return NULL_REG; else return *address.getPointer(segMan); } -void write_selector(SegManager *segMan, reg_t object, Selector selector_id, reg_t value) { +void writeSelector(SegManager *segMan, reg_t object, Selector selectorId, reg_t value) { ObjVarRef address; - if ((selector_id < 0) || (selector_id > (int)g_sci->getKernel()->getSelectorNamesSize())) { + if ((selectorId < 0) || (selectorId > (int)g_sci->getKernel()->getSelectorNamesSize())) { warning("Attempt to write to invalid selector %d of" - " object at %04x:%04x.", selector_id, PRINT_REG(object)); + " object at %04x:%04x.", selectorId, PRINT_REG(object)); return; } - if (lookup_selector(segMan, object, selector_id, &address, NULL) != kSelectorVariable) + if (lookupSelector(segMan, object, selectorId, &address, NULL) != kSelectorVariable) warning("Selector '%s' of object at %04x:%04x could not be" - " written to", g_sci->getKernel()->getSelectorName(selector_id).c_str(), PRINT_REG(object)); + " written to", g_sci->getKernel()->getSelectorName(selectorId).c_str(), PRINT_REG(object)); else *address.getPointer(segMan) = value; } -int invoke_selector_argv(EngineState *s, reg_t object, int selector_id, SelectorInvocation noinvalid, +int invokeSelectorArgv(EngineState *s, reg_t object, int selectorId, SelectorInvocation noinvalid, int k_argc, StackPtr k_argp, int argc, const reg_t *argv) { int i; int framesize = 2 + 1 * argc; @@ -209,21 +209,21 @@ int invoke_selector_argv(EngineState *s, reg_t object, int selector_id, Selector int slc_type; StackPtr stackframe = k_argp + k_argc; - stackframe[0] = make_reg(0, selector_id); // The selector we want to call + stackframe[0] = make_reg(0, selectorId); // The selector we want to call stackframe[1] = make_reg(0, argc); // Argument count - slc_type = lookup_selector(s->_segMan, object, selector_id, NULL, &address); + slc_type = lookupSelector(s->_segMan, object, selectorId, NULL, &address); if (slc_type == kSelectorNone) { warning("Selector '%s' of object at %04x:%04x could not be invoked", - g_sci->getKernel()->getSelectorName(selector_id).c_str(), PRINT_REG(object)); + g_sci->getKernel()->getSelectorName(selectorId).c_str(), PRINT_REG(object)); if (noinvalid == kStopOnInvalidSelector) error("[Kernel] Not recoverable: VM was halted"); return 1; } if (slc_type == kSelectorVariable) { warning("Attempting to invoke variable selector %s of object %04x:%04x", - g_sci->getKernel()->getSelectorName(selector_id).c_str(), PRINT_REG(object)); + g_sci->getKernel()->getSelectorName(selectorId).c_str(), PRINT_REG(object)); return 0; } @@ -243,7 +243,7 @@ int invoke_selector_argv(EngineState *s, reg_t object, int selector_id, Selector return 0; } -int invoke_selector(EngineState *s, reg_t object, int selector_id, SelectorInvocation noinvalid, +int invokeSelector(EngineState *s, reg_t object, int selectorId, SelectorInvocation noinvalid, int k_argc, StackPtr k_argp, int argc, ...) { va_list argp; reg_t *args = new reg_t[argc]; @@ -253,13 +253,13 @@ int invoke_selector(EngineState *s, reg_t object, int selector_id, SelectorInvoc args[i] = va_arg(argp, reg_t); va_end(argp); - int retval = invoke_selector_argv(s, object, selector_id, noinvalid, k_argc, k_argp, argc, args); + int retval = invokeSelectorArgv(s, object, selectorId, noinvalid, k_argc, k_argp, argc, args); delete[] args; return retval; } -SelectorType lookup_selector(SegManager *segMan, reg_t obj_location, Selector selector_id, ObjVarRef *varp, reg_t *fptr) { +SelectorType lookupSelector(SegManager *segMan, reg_t obj_location, Selector selectorId, ObjVarRef *varp, reg_t *fptr) { const Object *obj = segMan->getObject(obj_location); int index; bool oldScriptHeader = (getSciVersion() == SCI_VERSION_0_EARLY); @@ -267,14 +267,14 @@ SelectorType lookup_selector(SegManager *segMan, reg_t obj_location, Selector se // Early SCI versions used the LSB in the selector ID as a read/write // toggle, meaning that we must remove it for selector lookup. if (oldScriptHeader) - selector_id &= ~1; + selectorId &= ~1; if (!obj) { - error("lookup_selector(): Attempt to send to non-object or invalid script. Address was %04x:%04x", + error("lookupSelector(): Attempt to send to non-object or invalid script. Address was %04x:%04x", PRINT_REG(obj_location)); } - index = obj->locateVarSelector(segMan, selector_id); + index = obj->locateVarSelector(segMan, selectorId); if (index >= 0) { // Found it as a variable @@ -286,7 +286,7 @@ SelectorType lookup_selector(SegManager *segMan, reg_t obj_location, Selector se } else { // Check if it's a method, with recursive lookup in superclasses while (obj) { - index = obj->funcSelectorPosition(selector_id); + index = obj->funcSelectorPosition(selectorId); if (index >= 0) { if (fptr) *fptr = obj->getFunction(index); @@ -301,7 +301,7 @@ SelectorType lookup_selector(SegManager *segMan, reg_t obj_location, Selector se } -// return _lookup_selector_function(segMan, obj, selector_id, fptr); +// return _lookupSelector_function(segMan, obj, selectorId, fptr); } } // End of namespace Sci |