Added some slight fixes for the RAMA demo, which starts now, though it dies horribly when clicking on anything

svn-id: r50569
This commit is contained in:
Filippos Karapetis 2010-07-01 21:08:38 +00:00
parent 0e3f923f78
commit d5e037e703
2 changed files with 19 additions and 0 deletions

View File

@ -405,6 +405,18 @@ SciVersion GameFeatures::detectGfxFunctionsType() {
#ifdef ENABLE_SCI32
bool GameFeatures::autoDetectSci21KernelType() {
// First, check if the Sound object is loaded
reg_t soundObjAddr = _segMan->findObjectByName("Sound");
if (soundObjAddr.isNull()) {
// Usually, this means that the Sound object isn't loaded yet.
// This case doesn't occur in early SCI2.1 games, and we've only
// seen it happen in the RAMA demo, thus we can assume that the
// game is using a SCI2.1 table
warning("autoDetectSci21KernelType(): Sound object not loaded, assuming a SCI2.1 table");
_sci21KernelType = SCI_VERSION_2_1;
return true;
}
// Look up the script address
reg_t addr = getDetectionAddr("Sound", SELECTOR(play));

View File

@ -463,6 +463,13 @@ reg_t kArray(EngineState *s, int argc, reg_t *argv) {
return argv[1];
}
case 6: { // Cpy
if (s->_segMan->getSegmentObj(argv[1].segment)->getType() != SEG_TYPE_ARRAY ||
s->_segMan->getSegmentObj(argv[3].segment)->getType() != SEG_TYPE_ARRAY) {
// Happens in the RAMA demo
warning("kArray(Cpy): Request to copy a segment which isn't an array, ignoring");
return NULL_REG;
}
SciArray<reg_t> *array1 = s->_segMan->lookupArray(argv[1]);
SciArray<reg_t> *array2 = s->_segMan->lookupArray(argv[3]);
uint32 index1 = argv[2].toUint16();