diff options
author | Travis Howell | 2007-03-03 12:59:48 +0000 |
---|---|---|
committer | Travis Howell | 2007-03-03 12:59:48 +0000 |
commit | b0fea397ab22e3956106a3429994d794686d17e7 (patch) | |
tree | 20af16ec8513bd1e34daa958be6706f7aa1b4551 /engines | |
parent | 84d2c1782f0a4c31fd8a75eb075ecbc5515d2c50 (diff) | |
download | scummvm-rg350-b0fea397ab22e3956106a3429994d794686d17e7.tar.gz scummvm-rg350-b0fea397ab22e3956106a3429994d794686d17e7.tar.bz2 scummvm-rg350-b0fea397ab22e3956106a3429994d794686d17e7.zip |
Allow PC Engine version of Loom to at least start up.
svn-id: r25951
Diffstat (limited to 'engines')
-rw-r--r-- | engines/scumm/gfx.cpp | 24 | ||||
-rw-r--r-- | engines/scumm/object.cpp | 4 | ||||
-rw-r--r-- | engines/scumm/plugin.cpp | 1 | ||||
-rw-r--r-- | engines/scumm/script_v5.cpp | 10 | ||||
-rw-r--r-- | engines/scumm/scumm-md5.h | 3 | ||||
-rw-r--r-- | engines/scumm/scumm.cpp | 3 |
6 files changed, 33 insertions, 12 deletions
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp index 9426d8dbde..f9b825d8ac 100644 --- a/engines/scumm/gfx.cpp +++ b/engines/scumm/gfx.cpp @@ -1495,6 +1495,11 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, const int y, const // Check whether lights are turned on or not const bool lightsOn = _vm->isLightOn(); + if (_vm->_game.id == GID_LOOM && _vm->_game.platform == Common::kPlatformPCEngine) { + // FIXME: Image format unknown + return; + } + if (_vm->_game.features & GF_SMALL_HEADER) { smap_ptr = ptr; } else if (_vm->_game.version == 8) { @@ -1602,20 +1607,31 @@ bool Gdi::drawStrip(byte *dstPtr, VirtScreen *vs, int x, int y, const int width, // but if e.g. a savegame gets corrupted, we can easily get into // trouble here. See also bug #795214. int offset = -1, smapLen; - if (_vm->_game.features & GF_16COLOR) { + if (_vm->_game.id == GID_LOOM && _vm->_game.platform == Common::kPlatformPCEngine) { + // Length of offsets segment only + smapLen = READ_LE_UINT16(smap_ptr); + if (stripnr * 2 + 2 < smapLen) { + offset = READ_LE_UINT16(smap_ptr + stripnr * 2 + 2); + offset += stripnr * 2 + 9; + } + debug(0, "stripnr %d len %d offset %d", stripnr, smapLen, offset); + } else if (_vm->_game.features & GF_16COLOR) { smapLen = READ_LE_UINT16(smap_ptr); - if (stripnr * 2 + 2 < smapLen) + if (stripnr * 2 + 2 < smapLen) { offset = READ_LE_UINT16(smap_ptr + stripnr * 2 + 2); + } + assertRange(0, offset, smapLen-1, "screen strip"); } else if (_vm->_game.features & GF_SMALL_HEADER) { smapLen = READ_LE_UINT32(smap_ptr); if (stripnr * 4 + 4 < smapLen) offset = READ_LE_UINT32(smap_ptr + stripnr * 4 + 4); + assertRange(0, offset, smapLen-1, "screen strip"); } else { smapLen = READ_BE_UINT32(smap_ptr); if (stripnr * 4 + 8 < smapLen) offset = READ_LE_UINT32(smap_ptr + stripnr * 4 + 8); + assertRange(0, offset, smapLen-1, "screen strip"); } - assertRange(0, offset, smapLen-1, "screen strip"); return decompressBitmap(dstPtr, vs->pitch, smap_ptr + offset, height); } @@ -1937,7 +1953,7 @@ void Gdi::resetBackground(int top, int bottom, int strip) { bool Gdi::decompressBitmap(byte *dst, int dstPitch, const byte *src, int numLinesToProcess) { assert(numLinesToProcess); - + if (_vm->_game.features & GF_16COLOR) { drawStripEGA(dst, dstPitch, src, numLinesToProcess); return false; diff --git a/engines/scumm/object.cpp b/engines/scumm/object.cpp index 08c720f814..db3155d6e2 100644 --- a/engines/scumm/object.cpp +++ b/engines/scumm/object.cpp @@ -846,9 +846,11 @@ void ScummEngine_v4::resetRoomObjects() { ResourceIterator obims(room, true); for (i = 0; i < _numObjectsInRoom; i++) { + // In the PC Engine version of Loom, there aren't image blocks + // for all objects. ptr = obims.findNext(MKID_BE('OBIM')); if (ptr == NULL) - error("Room %d missing image blocks(s)", _roomResource); + break; obim_id = READ_LE_UINT16(ptr + 6); diff --git a/engines/scumm/plugin.cpp b/engines/scumm/plugin.cpp index c91d2d889b..4b5ec4027d 100644 --- a/engines/scumm/plugin.cpp +++ b/engines/scumm/plugin.cpp @@ -225,6 +225,7 @@ static const GameSettings gameVariantsTable[] = { {"loom", "EGA", "ega", GID_LOOM, 3, 0, MDT_PCSPK | MDT_ADLIB | MDT_MIDI, 0, UNK}, {"loom", "No Adlib", "ega", GID_LOOM, 3, 0, MDT_PCSPK, 0, UNK}, {"loom", "FM-TOWNS", 0, GID_LOOM, 3, 0, MDT_TOWNS, GF_AUDIOTRACKS | GF_OLD256, Common::kPlatformFMTowns}, + {"loom", "PC-Engine", 0, GID_LOOM, 3, 0, MDT_NONE, GF_16COLOR | GF_AUDIOTRACKS | GF_OLD256, Common::kPlatformPCEngine}, {"loom", "VGA", "vga", GID_LOOM, 4, 0, MDT_NONE, GF_AUDIOTRACKS, Common::kPlatformPC}, {"pass", 0, 0, GID_PASS, 4, 0, MDT_PCSPK | MDT_ADLIB, GF_16COLOR, Common::kPlatformPC}, diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp index 7a84235deb..650a946f93 100644 --- a/engines/scumm/script_v5.cpp +++ b/engines/scumm/script_v5.cpp @@ -1816,7 +1816,7 @@ void ScummEngine_v5::o5_resourceRoutines() { void ScummEngine_v5::o5_roomOps() { int a = 0, b = 0, c, d, e; - if (_game.version == 3) { + if (_game.version == 3 && _game.platform != Common::kPlatformPCEngine) { a = getVarOrDirectWord(PARAM_1); b = getVarOrDirectWord(PARAM_2); } @@ -1824,7 +1824,7 @@ void ScummEngine_v5::o5_roomOps() { _opcode = fetchScriptByte(); switch (_opcode & 0x1F) { case 1: // SO_ROOM_SCROLL - if (_game.version != 3) { + if (_game.version != 3 || _game.platform == Common::kPlatformPCEngine) { a = getVarOrDirectWord(PARAM_1); b = getVarOrDirectWord(PARAM_2); } @@ -1841,7 +1841,7 @@ void ScummEngine_v5::o5_roomOps() { break; case 2: // SO_ROOM_COLOR if (_game.features & GF_SMALL_HEADER) { - if (_game.version != 3) { + if (_game.version != 3 || _game.platform == Common::kPlatformPCEngine) { a = getVarOrDirectWord(PARAM_1); b = getVarOrDirectWord(PARAM_2); } @@ -1854,7 +1854,7 @@ void ScummEngine_v5::o5_roomOps() { break; case 3: // SO_ROOM_SCREEN - if (_game.version != 3) { + if (_game.version != 3 || _game.platform == Common::kPlatformPCEngine) { a = getVarOrDirectWord(PARAM_1); b = getVarOrDirectWord(PARAM_2); } @@ -1862,7 +1862,7 @@ void ScummEngine_v5::o5_roomOps() { break; case 4: // SO_ROOM_PALETTE if (_game.features & GF_SMALL_HEADER) { - if (_game.version != 3) { + if (_game.version != 3 || _game.platform == Common::kPlatformPCEngine) { a = getVarOrDirectWord(PARAM_1); b = getVarOrDirectWord(PARAM_2); } diff --git a/engines/scumm/scumm-md5.h b/engines/scumm/scumm-md5.h index 07ed10ce0b..deaa7fcb6b 100644 --- a/engines/scumm/scumm-md5.h +++ b/engines/scumm/scumm-md5.h @@ -1,5 +1,5 @@ /* - This file was generated by the md5table tool on Sun Feb 25 11:49:10 2007 + This file was generated by the md5table tool on Sat Mar 03 11:19:16 2007 DO NOT EDIT MANUALLY! */ @@ -25,6 +25,7 @@ static const MD5Table md5table[] = { { "04687cdf7f975a89d2474929f7b80946", "indy3", "FM-TOWNS", "", 7552, Common::EN_ANY, Common::kPlatformFMTowns }, { "0557df19f046a84c2fdc63507c6616cb", "farm", "HE 72", "Demo", -1, Common::NL_NLD, Common::kPlatformWindows }, { "055ffe4f47753e47594ac67823220c54", "puttrace", "HE 99", "", -1, Common::DE_DEU, Common::kPlatformUnknown }, + { "0650e8ab1432564607cd651c0fa3f344", "loom", "PC-Engine", "", -1, Common::EN_ANY, Common::kPlatformPCEngine }, { "06b187468113f9ae5a400b148a847fac", "atlantis", "", "Floppy", 12075, Common::EN_ANY, Common::kPlatformMacintosh }, { "06c3cf4f31daad8b1cd93153491db9e6", "pajama3", "", "", -1, Common::NL_NLD, Common::kPlatformMacintosh }, { "07433205acdca3bc553d0e731588b35f", "airport", "", "", -1, Common::EN_ANY, Common::kPlatformWindows }, diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index e107bca6aa..9c7d8b6a7c 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1572,7 +1572,8 @@ void ScummEngine::setupMusic(int midi) { // Init iMuse if (_game.version >= 7) { // Setup for digital iMuse is performed in another place - } else if (_game.platform == Common::kPlatformApple2GS || _game.platform == Common::kPlatformC64) { + } else if (_game.platform == Common::kPlatformApple2GS || _game.platform == Common::kPlatformC64 || + _game.platform == Common::kPlatformPCEngine) { // TODO _musicEngine = NULL; } else if (_game.platform == Common::kPlatformNES) { |