aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2007-03-03 23:02:54 +0000
committerTravis Howell2007-03-03 23:02:54 +0000
commit8e70329ce3d550a621843ffc055e416797e6054d (patch)
tree7a867653f8b8a55e0249be1e5d03dc8544381181
parent5cee9799f1f0684ac0947be7a1747021435148ba (diff)
downloadscummvm-rg350-8e70329ce3d550a621843ffc055e416797e6054d.tar.gz
scummvm-rg350-8e70329ce3d550a621843ffc055e416797e6054d.tar.bz2
scummvm-rg350-8e70329ce3d550a621843ffc055e416797e6054d.zip
Fix level selection in PC Engine version of Loom.
svn-id: r25954
-rw-r--r--engines/scumm/costume.cpp11
-rw-r--r--engines/scumm/object.cpp42
-rw-r--r--engines/scumm/script.cpp7
-rw-r--r--engines/scumm/script_v5.cpp12
-rw-r--r--engines/scumm/sound.cpp4
5 files changed, 59 insertions, 17 deletions
diff --git a/engines/scumm/costume.cpp b/engines/scumm/costume.cpp
index aba347f939..7eaeb2b08c 100644
--- a/engines/scumm/costume.cpp
+++ b/engines/scumm/costume.cpp
@@ -88,7 +88,11 @@ byte ClassicCostumeRenderer::mainRoutine(int xmoveCur, int ymoveCur) {
int step;
Codec1 v1;
-
+ if (_vm->_game.id == GID_LOOM && _vm->_game.platform == Common::kPlatformPCEngine) {
+ // FIXME: Unknown costume format
+ return 0;
+ }
+
const int scaletableSize = 128;
const bool newAmiCost = (_vm->_game.version == 5) && (_vm->_game.platform == Common::kPlatformAmiga);
@@ -551,6 +555,11 @@ void ClassicCostumeLoader::loadCostume(int id) {
_id = id;
byte *ptr = _vm->getResourceAddress(rtCostume, id);
+ if (_vm->_game.id == GID_LOOM && _vm->_game.platform == Common::kPlatformPCEngine) {
+ // FIXME: Unknown costume format
+ return;
+ }
+
if (_vm->_game.version >= 6)
ptr += 8;
else if (_vm->_game.features & GF_OLD_BUNDLE)
diff --git a/engines/scumm/object.cpp b/engines/scumm/object.cpp
index db3155d6e2..3667bee35f 100644
--- a/engines/scumm/object.cpp
+++ b/engines/scumm/object.cpp
@@ -900,27 +900,41 @@ void ScummEngine_v4::resetRoomObject(ObjectData *od, const byte *room, const byt
od->obj_nr = READ_LE_UINT16(ptr + 6);
- od->x_pos = *(ptr + 9) * 8;
- od->y_pos = ((*(ptr + 10)) & 0x7F) * 8;
+ if (_game.id == GID_LOOM && _game.platform == Common::kPlatformPCEngine) {
+ od->x_pos = *(ptr + 8) * 8;
+ od->y_pos = ((*(ptr + 9)) & 0x7F) * 8;
- od->parentstate = (*(ptr + 10) & 0x80) ? 1 : 0;
- if (_game.version <= 2)
- od->parentstate *= 8;
-
- od->width = *(ptr + 11) * 8;
-
- od->parent = *(ptr + 12);
+ od->parentstate = (*(ptr + 11) & 0x80) ? 1 : 0;
+ od->width = *(ptr + 10) * 8;
- if (_game.version <= 2) {
+ od->parent = *(ptr + 11);
od->walk_x = *(ptr + 13) * 8;
od->walk_y = (*(ptr + 14) & 0x1f) * 8;
od->actordir = (*(ptr + 15)) & 7;
od->height = *(ptr + 15) & 0xf8;
} else {
- od->walk_x = READ_LE_UINT16(ptr + 13);
- od->walk_y = READ_LE_UINT16(ptr + 15);
- od->actordir = (*(ptr + 17)) & 7;
- od->height = *(ptr + 17) & 0xf8;
+ od->x_pos = *(ptr + 9) * 8;
+ od->y_pos = ((*(ptr + 10)) & 0x7F) * 8;
+
+ od->parentstate = (*(ptr + 10) & 0x80) ? 1 : 0;
+ if (_game.version <= 2)
+ od->parentstate *= 8;
+
+ od->width = *(ptr + 11) * 8;
+
+ od->parent = *(ptr + 12);
+
+ if (_game.version <= 2) {
+ od->walk_x = *(ptr + 13) * 8;
+ od->walk_y = (*(ptr + 14) & 0x1f) * 8;
+ od->actordir = (*(ptr + 15)) & 7;
+ od->height = *(ptr + 15) & 0xf8;
+ } else {
+ od->walk_x = READ_LE_UINT16(ptr + 13);
+ od->walk_y = READ_LE_UINT16(ptr + 15);
+ od->actordir = (*(ptr + 17)) & 7;
+ od->height = *(ptr + 17) & 0xf8;
+ }
}
}
diff --git a/engines/scumm/script.cpp b/engines/scumm/script.cpp
index 8418f8a0ee..dc97f8694c 100644
--- a/engines/scumm/script.cpp
+++ b/engines/scumm/script.cpp
@@ -167,7 +167,8 @@ int ScummEngine::getVerbEntrypoint(int obj, int entry) {
verbptr = objptr + 14;
else if (_game.version <= 2)
verbptr = objptr + 15;
- else if (_game.features & GF_OLD_BUNDLE)
+ else if ((_game.id == GID_LOOM && _game.platform == Common::kPlatformPCEngine) ||
+ _game.features & GF_OLD_BUNDLE)
verbptr = objptr + 17;
else if (_game.features & GF_SMALL_HEADER)
verbptr = objptr + 19;
@@ -212,7 +213,9 @@ int ScummEngine::getVerbEntrypoint(int obj, int entry) {
verbptr += 3;
} while (1);
- if (_game.features & GF_SMALL_HEADER)
+ if (_game.id == GID_LOOM && _game.platform == Common::kPlatformPCEngine)
+ return verboffs + READ_LE_UINT16(verbptr + 1) + 3;
+ else if (_game.features & GF_SMALL_HEADER)
return READ_LE_UINT16(verbptr + 1);
else
return verboffs + READ_LE_UINT16(verbptr + 1);
diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index 650a946f93..e2e7b87ff0 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -1705,6 +1705,12 @@ void ScummEngine_v5::o5_resourceRoutines() {
int op = _opcode & 0x3F;
+ // FIXME: Sound resources are currently missing
+ if (_game.id == GID_LOOM && _game.platform == Common::kPlatformPCEngine &&
+ (op == 2 || op == 6)) {
+ return;
+ }
+
switch (op) {
case 1: // SO_LOAD_SCRIPT
case 2: // SO_LOAD_SOUND
@@ -1739,6 +1745,9 @@ void ScummEngine_v5::o5_resourceRoutines() {
_res->lock(rtScript, resid);
break;
case 10: // SO_LOCK_SOUND
+ // FIXME: Sound resources are currently missing
+ if (_game.id == GID_LOOM && _game.platform == Common::kPlatformPCEngine)
+ break;
_res->lock(rtSound, resid);
break;
case 11: // SO_LOCK_COSTUME
@@ -1756,6 +1765,9 @@ void ScummEngine_v5::o5_resourceRoutines() {
_res->unlock(rtScript, resid);
break;
case 14: // SO_UNLOCK_SOUND
+ // FIXME: Sound resources are currently missing
+ if (_game.id == GID_LOOM && _game.platform == Common::kPlatformPCEngine)
+ break;
_res->unlock(rtSound, resid);
break;
case 15: // SO_UNLOCK_COSTUME
diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index bc3a80676b..a81fc80b51 100644
--- a/engines/scumm/sound.cpp
+++ b/engines/scumm/sound.cpp
@@ -165,6 +165,10 @@ void Sound::playSound(int soundID) {
int rate;
byte flags = Audio::Mixer::FLAG_UNSIGNED | Audio::Mixer::FLAG_AUTOFREE;
+ // FIXME: Sound resources are currently missing
+ if (_vm->_game.id == GID_LOOM && _vm->_game.platform == Common::kPlatformPCEngine)
+ return;
+
debugC(DEBUG_SOUND, "playSound #%d (room %d)", soundID,
_vm->getResourceRoomNr(rtSound, soundID));