2009-02-17 15:02:16 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
* $URL$
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
*/
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-05-14 12:38:50 +00:00
|
|
|
#include "sci/sci.h"
|
2009-05-15 14:07:45 +00:00
|
|
|
#include "sci/resource.h"
|
2009-02-27 02:23:40 +00:00
|
|
|
#include "sci/engine/state.h"
|
2010-01-29 11:03:54 +00:00
|
|
|
#include "sci/engine/selector.h"
|
2009-02-24 05:51:55 +00:00
|
|
|
#include "sci/engine/kernel.h"
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-02-21 10:23:36 +00:00
|
|
|
namespace Sci {
|
|
|
|
|
2009-02-20 17:05:47 +00:00
|
|
|
// Loads arbitrary resources of type 'restype' with resource numbers 'resnrs'
|
|
|
|
// This implementation ignores all resource numbers except the first one.
|
- Changed the unimplemented debug SCI kernel functions (InspectObj, ShowSends, ShowObjs, ShowFree, StackUsage and Profiler) to be dummy functions - we have our own debugger, and don't use these functions for debugging
- Removed the function number parameter from all kernel functions, as it's no longer needed, and removed the FAKE_FUNCT_NR hack
- Removed kUnknown() and kStub()
- Dummy/unknown kernel functions are no longer invoked, and a warning is shown instead, with the paremeters passed to them
Note: there is an evil hack used for debugging scripts in invoke_selector(), which probably no longer works now
svn-id: r44461
2009-09-29 14:24:07 +00:00
|
|
|
reg_t kLoad(EngineState *s, int argc, reg_t *argv) {
|
2009-06-07 15:53:30 +00:00
|
|
|
int restype = argv[0].toUint16();
|
|
|
|
int resnr = argv[1].toUint16();
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-02-28 23:46:50 +00:00
|
|
|
// Request to dynamically allocate hunk memory for later use
|
|
|
|
if (restype == kResourceTypeMemory)
|
2010-05-18 13:05:09 +00:00
|
|
|
return s->_segMan->allocateHunkEntry("kLoad()", resnr);
|
2009-02-15 22:28:12 +00:00
|
|
|
|
2009-02-20 17:05:47 +00:00
|
|
|
return make_reg(0, ((restype << 11) | resnr)); // Return the resource identifier as handle
|
2009-02-15 06:10:59 +00:00
|
|
|
}
|
|
|
|
|
- Changed the unimplemented debug SCI kernel functions (InspectObj, ShowSends, ShowObjs, ShowFree, StackUsage and Profiler) to be dummy functions - we have our own debugger, and don't use these functions for debugging
- Removed the function number parameter from all kernel functions, as it's no longer needed, and removed the FAKE_FUNCT_NR hack
- Removed kUnknown() and kStub()
- Dummy/unknown kernel functions are no longer invoked, and a warning is shown instead, with the paremeters passed to them
Note: there is an evil hack used for debugging scripts in invoke_selector(), which probably no longer works now
svn-id: r44461
2009-09-29 14:24:07 +00:00
|
|
|
reg_t kLock(EngineState *s, int argc, reg_t *argv) {
|
2009-06-07 15:53:30 +00:00
|
|
|
int state = argc > 2 ? argv[2].toUint16() : 1;
|
2009-06-07 19:15:55 +00:00
|
|
|
ResourceType type = (ResourceType)(argv[0].toUint16() & 0x7f);
|
|
|
|
ResourceId id = ResourceId(type, argv[1].toUint16());
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-02-28 21:59:49 +00:00
|
|
|
Resource *which;
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-02-15 22:28:12 +00:00
|
|
|
switch (state) {
|
2009-02-15 06:10:59 +00:00
|
|
|
case 1 :
|
2010-02-13 17:44:19 +00:00
|
|
|
g_sci->getResMan()->findResource(id, 1);
|
2009-02-15 06:10:59 +00:00
|
|
|
break;
|
|
|
|
case 0 :
|
2010-02-13 17:44:19 +00:00
|
|
|
which = g_sci->getResMan()->findResource(id, 0);
|
2009-06-07 19:15:55 +00:00
|
|
|
|
|
|
|
if (which)
|
2010-02-13 17:44:19 +00:00
|
|
|
g_sci->getResMan()->unlockResource(which);
|
2009-06-07 19:15:55 +00:00
|
|
|
else {
|
|
|
|
if (id.type == kResourceTypeInvalid)
|
2009-09-02 12:02:37 +00:00
|
|
|
warning("[resMan] Attempt to unlock resource %i of invalid type %i", id.number, type);
|
2009-06-07 19:15:55 +00:00
|
|
|
else
|
2009-09-02 12:02:37 +00:00
|
|
|
warning("[resMan] Attempt to unlock non-existant resource %s", id.toString().c_str());
|
2009-06-07 19:15:55 +00:00
|
|
|
}
|
2009-02-15 06:10:59 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
return s->r_acc;
|
|
|
|
}
|
|
|
|
|
2009-02-20 17:05:47 +00:00
|
|
|
// Unloads an arbitrary resource of type 'restype' with resource numbber 'resnr'
|
- Changed the unimplemented debug SCI kernel functions (InspectObj, ShowSends, ShowObjs, ShowFree, StackUsage and Profiler) to be dummy functions - we have our own debugger, and don't use these functions for debugging
- Removed the function number parameter from all kernel functions, as it's no longer needed, and removed the FAKE_FUNCT_NR hack
- Removed kUnknown() and kStub()
- Dummy/unknown kernel functions are no longer invoked, and a warning is shown instead, with the paremeters passed to them
Note: there is an evil hack used for debugging scripts in invoke_selector(), which probably no longer works now
svn-id: r44461
2009-09-29 14:24:07 +00:00
|
|
|
reg_t kUnLoad(EngineState *s, int argc, reg_t *argv) {
|
2010-01-26 11:25:15 +00:00
|
|
|
if (argc >= 2) {
|
|
|
|
int restype = argv[0].toUint16();
|
|
|
|
reg_t resnr = argv[1];
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2010-01-26 11:25:15 +00:00
|
|
|
if (restype == kResourceTypeMemory)
|
2010-05-18 13:05:09 +00:00
|
|
|
s->_segMan->freeHunkEntry(resnr);
|
2010-01-26 11:25:15 +00:00
|
|
|
|
|
|
|
if (argc > 2)
|
|
|
|
warning("kUnload called with more than 2 parameters (%d)", argc);
|
|
|
|
} else {
|
2010-01-26 11:28:11 +00:00
|
|
|
warning("kUnload called with less than 2 parameters (%d) - ignoring", argc);
|
2010-01-26 11:25:15 +00:00
|
|
|
}
|
2009-02-15 06:10:59 +00:00
|
|
|
|
|
|
|
return s->r_acc;
|
|
|
|
}
|
|
|
|
|
- Changed the unimplemented debug SCI kernel functions (InspectObj, ShowSends, ShowObjs, ShowFree, StackUsage and Profiler) to be dummy functions - we have our own debugger, and don't use these functions for debugging
- Removed the function number parameter from all kernel functions, as it's no longer needed, and removed the FAKE_FUNCT_NR hack
- Removed kUnknown() and kStub()
- Dummy/unknown kernel functions are no longer invoked, and a warning is shown instead, with the paremeters passed to them
Note: there is an evil hack used for debugging scripts in invoke_selector(), which probably no longer works now
svn-id: r44461
2009-09-29 14:24:07 +00:00
|
|
|
reg_t kResCheck(EngineState *s, int argc, reg_t *argv) {
|
2009-06-07 19:15:55 +00:00
|
|
|
Resource *res = NULL;
|
2009-06-07 15:53:30 +00:00
|
|
|
ResourceType restype = (ResourceType)(argv[0].toUint16() & 0x7f);
|
2009-05-19 02:10:58 +00:00
|
|
|
|
2009-06-07 19:15:55 +00:00
|
|
|
if ((restype == kResourceTypeAudio36) || (restype == kResourceTypeSync36)) {
|
|
|
|
if (argc >= 6) {
|
|
|
|
uint noun = argv[2].toUint16() & 0xff;
|
|
|
|
uint verb = argv[3].toUint16() & 0xff;
|
|
|
|
uint cond = argv[4].toUint16() & 0xff;
|
|
|
|
uint seq = argv[5].toUint16() & 0xff;
|
|
|
|
|
2010-02-13 17:44:19 +00:00
|
|
|
res = g_sci->getResMan()->testResource(ResourceId(restype, argv[1].toUint16(), noun, verb, cond, seq));
|
2009-06-07 19:15:55 +00:00
|
|
|
}
|
|
|
|
} else {
|
2010-02-13 17:44:19 +00:00
|
|
|
res = g_sci->getResMan()->testResource(ResourceId(restype, argv[1].toUint16()));
|
2009-05-19 02:10:58 +00:00
|
|
|
}
|
2009-06-07 19:15:55 +00:00
|
|
|
|
|
|
|
return make_reg(0, res != NULL);
|
2009-05-19 02:10:58 +00:00
|
|
|
}
|
|
|
|
|
- Changed the unimplemented debug SCI kernel functions (InspectObj, ShowSends, ShowObjs, ShowFree, StackUsage and Profiler) to be dummy functions - we have our own debugger, and don't use these functions for debugging
- Removed the function number parameter from all kernel functions, as it's no longer needed, and removed the FAKE_FUNCT_NR hack
- Removed kUnknown() and kStub()
- Dummy/unknown kernel functions are no longer invoked, and a warning is shown instead, with the paremeters passed to them
Note: there is an evil hack used for debugging scripts in invoke_selector(), which probably no longer works now
svn-id: r44461
2009-09-29 14:24:07 +00:00
|
|
|
reg_t kClone(EngineState *s, int argc, reg_t *argv) {
|
2009-02-15 06:10:59 +00:00
|
|
|
reg_t parent_addr = argv[0];
|
2010-05-26 16:30:10 +00:00
|
|
|
const Object *parent_obj = s->_segMan->getObject(parent_addr);
|
2009-02-15 06:10:59 +00:00
|
|
|
reg_t clone_addr;
|
2009-02-28 11:12:59 +00:00
|
|
|
Clone *clone_obj; // same as Object*
|
2009-02-15 06:10:59 +00:00
|
|
|
|
|
|
|
if (!parent_obj) {
|
2009-05-21 17:18:46 +00:00
|
|
|
error("Attempt to clone non-object/class at %04x:%04x failed", PRINT_REG(parent_addr));
|
2009-02-15 06:10:59 +00:00
|
|
|
return NULL_REG;
|
|
|
|
}
|
|
|
|
|
2010-01-30 11:59:05 +00:00
|
|
|
debugC(2, kDebugLevelMemory, "Attempting to clone from %04x:%04x", PRINT_REG(parent_addr));
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-10-04 18:38:18 +00:00
|
|
|
clone_obj = s->_segMan->allocateClone(&clone_addr);
|
2009-02-15 06:10:59 +00:00
|
|
|
|
|
|
|
if (!clone_obj) {
|
2009-05-31 10:02:16 +00:00
|
|
|
error("Cloning %04x:%04x failed-- internal error", PRINT_REG(parent_addr));
|
2009-02-15 06:10:59 +00:00
|
|
|
return NULL_REG;
|
|
|
|
}
|
|
|
|
|
2009-05-12 23:30:42 +00:00
|
|
|
*clone_obj = *parent_obj;
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-02-20 17:05:47 +00:00
|
|
|
// Mark as clone
|
2009-09-17 16:50:53 +00:00
|
|
|
clone_obj->setInfoSelector(make_reg(0, SCRIPT_INFO_CLONE));
|
2009-10-10 15:58:51 +00:00
|
|
|
clone_obj->setSpeciesSelector(clone_obj->getPos());
|
2009-09-17 16:50:53 +00:00
|
|
|
if (parent_obj->isClass())
|
2009-10-10 15:58:51 +00:00
|
|
|
clone_obj->setSuperClassSelector(parent_obj->getPos());
|
|
|
|
s->_segMan->getScript(parent_obj->getPos().segment)->incrementLockers();
|
|
|
|
s->_segMan->getScript(clone_obj->getPos().segment)->incrementLockers();
|
2009-02-15 06:10:59 +00:00
|
|
|
|
|
|
|
return clone_addr;
|
|
|
|
}
|
|
|
|
|
2009-02-21 10:47:56 +00:00
|
|
|
extern void _k_view_list_mark_free(EngineState *s, reg_t off);
|
2009-02-15 06:10:59 +00:00
|
|
|
|
- Changed the unimplemented debug SCI kernel functions (InspectObj, ShowSends, ShowObjs, ShowFree, StackUsage and Profiler) to be dummy functions - we have our own debugger, and don't use these functions for debugging
- Removed the function number parameter from all kernel functions, as it's no longer needed, and removed the FAKE_FUNCT_NR hack
- Removed kUnknown() and kStub()
- Dummy/unknown kernel functions are no longer invoked, and a warning is shown instead, with the paremeters passed to them
Note: there is an evil hack used for debugging scripts in invoke_selector(), which probably no longer works now
svn-id: r44461
2009-09-29 14:24:07 +00:00
|
|
|
reg_t kDisposeClone(EngineState *s, int argc, reg_t *argv) {
|
2009-02-15 06:10:59 +00:00
|
|
|
reg_t victim_addr = argv[0];
|
2009-10-04 18:38:18 +00:00
|
|
|
Clone *victim_obj = s->_segMan->getObject(victim_addr);
|
2009-02-15 06:10:59 +00:00
|
|
|
|
|
|
|
if (!victim_obj) {
|
2009-05-31 10:02:16 +00:00
|
|
|
error("Attempt to dispose non-class/object at %04x:%04x",
|
2009-02-15 22:28:12 +00:00
|
|
|
PRINT_REG(victim_addr));
|
2009-02-15 06:10:59 +00:00
|
|
|
return s->r_acc;
|
|
|
|
}
|
|
|
|
|
2009-09-17 16:50:53 +00:00
|
|
|
if (victim_obj->getInfoSelector().offset != SCRIPT_INFO_CLONE) {
|
2009-05-31 10:02:16 +00:00
|
|
|
//warning("Attempt to dispose something other than a clone at %04x", offset);
|
2009-02-20 17:05:47 +00:00
|
|
|
// SCI silently ignores this behaviour; some games actually depend on it
|
2009-02-15 06:10:59 +00:00
|
|
|
return s->r_acc;
|
|
|
|
}
|
|
|
|
|
2009-09-29 07:40:04 +00:00
|
|
|
// QFG3 clears clones with underbits set
|
2010-05-29 23:37:15 +00:00
|
|
|
//if (readSelectorValue(victim_addr, underBits))
|
2009-09-29 07:40:04 +00:00
|
|
|
// warning("Clone %04x:%04x was cleared with underBits set", PRINT_REG(victim_addr));
|
|
|
|
|
2009-02-15 06:10:59 +00:00
|
|
|
#if 0
|
2009-02-20 17:05:47 +00:00
|
|
|
if (s->dyn_views) { // Free any widget associated with the clone
|
2009-04-24 10:46:20 +00:00
|
|
|
GfxWidget *widget = gfxw_set_id(gfxw_remove_ID(s->dyn_views, offset), GFXW_NO_ID);
|
2009-02-15 06:10:59 +00:00
|
|
|
|
|
|
|
if (widget && s->bg_widgets)
|
|
|
|
s->bg_widgets->add(GFXWC(s->bg_widgets), widget);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2009-10-10 15:58:51 +00:00
|
|
|
victim_obj->markAsFreed();
|
2010-01-25 01:39:44 +00:00
|
|
|
|
2009-02-15 06:10:59 +00:00
|
|
|
return s->r_acc;
|
|
|
|
}
|
|
|
|
|
2009-02-20 17:05:47 +00:00
|
|
|
// Returns script dispatch address index in the supplied script
|
- Changed the unimplemented debug SCI kernel functions (InspectObj, ShowSends, ShowObjs, ShowFree, StackUsage and Profiler) to be dummy functions - we have our own debugger, and don't use these functions for debugging
- Removed the function number parameter from all kernel functions, as it's no longer needed, and removed the FAKE_FUNCT_NR hack
- Removed kUnknown() and kStub()
- Dummy/unknown kernel functions are no longer invoked, and a warning is shown instead, with the paremeters passed to them
Note: there is an evil hack used for debugging scripts in invoke_selector(), which probably no longer works now
svn-id: r44461
2009-09-29 14:24:07 +00:00
|
|
|
reg_t kScriptID(EngineState *s, int argc, reg_t *argv) {
|
2009-06-07 15:53:30 +00:00
|
|
|
int script = argv[0].toUint16();
|
2009-06-07 16:50:34 +00:00
|
|
|
int index = (argc > 1) ? argv[1].toUint16() : 0;
|
2009-02-15 06:10:59 +00:00
|
|
|
|
|
|
|
if (argv[0].segment)
|
|
|
|
return argv[0];
|
|
|
|
|
2009-10-04 18:38:18 +00:00
|
|
|
SegmentId scriptSeg = s->_segMan->getScriptSegment(script, SCRIPT_GET_LOAD);
|
2009-09-06 12:57:42 +00:00
|
|
|
|
|
|
|
if (!scriptSeg)
|
2009-02-15 06:10:59 +00:00
|
|
|
return NULL_REG;
|
|
|
|
|
2010-05-19 08:50:24 +00:00
|
|
|
Script *scr = s->_segMan->getScript(scriptSeg);
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-09-16 23:32:27 +00:00
|
|
|
if (!scr->_numExports) {
|
2010-05-30 20:01:25 +00:00
|
|
|
// This is normal. Some scripts don't have a dispatch (exports) table,
|
|
|
|
// and this call is probably used to load them in memory, ignoring
|
|
|
|
// the return value. If only one argument is passed, this call is done
|
|
|
|
// only to load the script in memory. Thus, don't show any warning,
|
|
|
|
// as no return value is expected
|
|
|
|
if (argc == 2)
|
|
|
|
warning("Script 0x%x does not have a dispatch table and export %d "
|
|
|
|
"was requested from it", script, index);
|
2009-02-15 06:10:59 +00:00
|
|
|
return NULL_REG;
|
|
|
|
}
|
|
|
|
|
2009-09-16 23:32:27 +00:00
|
|
|
if (index > scr->_numExports) {
|
|
|
|
error("Dispatch index too big: %d > %d", index, scr->_numExports);
|
2009-02-15 06:10:59 +00:00
|
|
|
return NULL_REG;
|
|
|
|
}
|
|
|
|
|
2010-05-29 15:29:27 +00:00
|
|
|
uint16 address = scr->validateExportFunc(index);
|
|
|
|
|
|
|
|
// Point to the heap for SCI1.1+ games
|
|
|
|
if (getSciVersion() >= SCI_VERSION_1_1)
|
2010-05-30 16:14:31 +00:00
|
|
|
address += scr->getScriptSize();
|
2010-05-29 15:29:27 +00:00
|
|
|
|
|
|
|
return make_reg(scriptSeg, address);
|
2009-02-15 06:10:59 +00:00
|
|
|
}
|
|
|
|
|
- Changed the unimplemented debug SCI kernel functions (InspectObj, ShowSends, ShowObjs, ShowFree, StackUsage and Profiler) to be dummy functions - we have our own debugger, and don't use these functions for debugging
- Removed the function number parameter from all kernel functions, as it's no longer needed, and removed the FAKE_FUNCT_NR hack
- Removed kUnknown() and kStub()
- Dummy/unknown kernel functions are no longer invoked, and a warning is shown instead, with the paremeters passed to them
Note: there is an evil hack used for debugging scripts in invoke_selector(), which probably no longer works now
svn-id: r44461
2009-09-29 14:24:07 +00:00
|
|
|
reg_t kDisposeScript(EngineState *s, int argc, reg_t *argv) {
|
2009-02-15 06:10:59 +00:00
|
|
|
int script = argv[0].offset;
|
2009-02-15 22:28:12 +00:00
|
|
|
|
2009-02-20 17:05:47 +00:00
|
|
|
// Work around QfG1 graveyard bug
|
|
|
|
if (argv[0].segment)
|
|
|
|
return s->r_acc;
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2010-02-15 10:01:09 +00:00
|
|
|
SegmentId id = s->_segMan->getScriptSegment(script);
|
2009-10-04 18:38:18 +00:00
|
|
|
Script *scr = s->_segMan->getScriptIfLoaded(id);
|
2009-05-15 09:27:39 +00:00
|
|
|
if (scr) {
|
2009-05-18 18:15:45 +00:00
|
|
|
if (s->_executionStack.back().addr.pc.segment != id)
|
2009-09-01 17:09:59 +00:00
|
|
|
scr->setLockers(1);
|
2009-02-15 06:10:59 +00:00
|
|
|
}
|
|
|
|
|
2009-10-04 18:38:18 +00:00
|
|
|
script_uninstantiate(s->_segMan, script);
|
2009-09-01 17:09:59 +00:00
|
|
|
|
|
|
|
if (argc != 2) {
|
|
|
|
return s->r_acc;
|
|
|
|
} else {
|
2009-12-21 14:32:54 +00:00
|
|
|
// This exists in the KQ5CD and GK1 interpreter. We know it is used when GK1 starts
|
|
|
|
// up, before the Sierra logo.
|
2009-09-01 17:09:59 +00:00
|
|
|
warning("kDisposeScript called with 2 parameters, still untested");
|
|
|
|
return argv[1];
|
|
|
|
}
|
2009-02-15 06:10:59 +00:00
|
|
|
}
|
|
|
|
|
- Changed the unimplemented debug SCI kernel functions (InspectObj, ShowSends, ShowObjs, ShowFree, StackUsage and Profiler) to be dummy functions - we have our own debugger, and don't use these functions for debugging
- Removed the function number parameter from all kernel functions, as it's no longer needed, and removed the FAKE_FUNCT_NR hack
- Removed kUnknown() and kStub()
- Dummy/unknown kernel functions are no longer invoked, and a warning is shown instead, with the paremeters passed to them
Note: there is an evil hack used for debugging scripts in invoke_selector(), which probably no longer works now
svn-id: r44461
2009-09-29 14:24:07 +00:00
|
|
|
reg_t kIsObject(EngineState *s, int argc, reg_t *argv) {
|
|
|
|
if (argv[0].offset == SIGNAL_OFFSET) // Treated specially
|
2009-02-15 06:10:59 +00:00
|
|
|
return NULL_REG;
|
|
|
|
else
|
2009-10-04 18:38:18 +00:00
|
|
|
return make_reg(0, s->_segMan->isHeapObject(argv[0]));
|
2009-02-15 06:10:59 +00:00
|
|
|
}
|
|
|
|
|
- Changed the unimplemented debug SCI kernel functions (InspectObj, ShowSends, ShowObjs, ShowFree, StackUsage and Profiler) to be dummy functions - we have our own debugger, and don't use these functions for debugging
- Removed the function number parameter from all kernel functions, as it's no longer needed, and removed the FAKE_FUNCT_NR hack
- Removed kUnknown() and kStub()
- Dummy/unknown kernel functions are no longer invoked, and a warning is shown instead, with the paremeters passed to them
Note: there is an evil hack used for debugging scripts in invoke_selector(), which probably no longer works now
svn-id: r44461
2009-09-29 14:24:07 +00:00
|
|
|
reg_t kRespondsTo(EngineState *s, int argc, reg_t *argv) {
|
2009-02-15 06:10:59 +00:00
|
|
|
reg_t obj = argv[0];
|
2009-06-07 15:53:30 +00:00
|
|
|
int selector = argv[1].toUint16();
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2010-05-29 23:37:15 +00:00
|
|
|
return make_reg(0, s->_segMan->isHeapObject(obj) && lookupSelector(s->_segMan, obj, selector, NULL, NULL) != kSelectorNone);
|
2009-02-15 06:10:59 +00:00
|
|
|
}
|
2009-02-21 10:23:36 +00:00
|
|
|
|
|
|
|
} // End of namespace Sci
|