diff options
-rwxr-xr-x | configure | 9 | ||||
-rw-r--r-- | engines/sci/detection.cpp | 3 | ||||
-rw-r--r-- | engines/sci/detection_tables.h | 22 | ||||
-rw-r--r-- | engines/sci/engine/features.cpp | 8 | ||||
-rw-r--r-- | engines/sci/engine/kernel_tables.h | 2 | ||||
-rw-r--r-- | engines/sci/engine/kpathing.cpp | 11 | ||||
-rw-r--r-- | engines/sci/engine/workarounds.cpp | 3 | ||||
-rw-r--r-- | engines/sci/sci.h | 1 | ||||
-rw-r--r-- | engines/sci/sound/soundcmd.cpp | 6 | ||||
-rw-r--r-- | engines/wintermute/base/base_game.cpp | 3 | ||||
-rw-r--r-- | engines/wintermute/base/font/base_font_truetype.cpp | 5 | ||||
-rw-r--r-- | engines/wintermute/utils/string_util.cpp | 12 | ||||
-rw-r--r-- | engines/wintermute/video/video_theora_player.cpp | 31 | ||||
-rw-r--r-- | graphics/scaler/aspect.cpp | 18 |
14 files changed, 105 insertions, 29 deletions
@@ -2525,10 +2525,13 @@ if test -n "$_host"; then # Use -O3 on the OpenPandora for non-debug builds. _optimization_level=-O3 fi + define_in_config_if_yes yes 'USE_ARM_NEON_ASPECT_CORRECTOR' CXXFLAGS="$CXXFLAGS -march=armv7-a" CXXFLAGS="$CXXFLAGS -mtune=cortex-a8" + CXXFLAGS="$CXXFLAGS -mfloat-abi=softfp" CXXFLAGS="$CXXFLAGS -mfpu=neon" - ASFLAGS="$ASFLAGS -mfloat-abi=soft" + CXXFLAGS="$CXXFLAGS -fsingle-precision-constant" + ASFLAGS="$ASFLAGS -mfloat-abi=softfp" _backend="openpandora" _build_hq_scalers=yes _vkeybd=no @@ -2977,7 +2980,7 @@ PLUGIN_LDFLAGS += -Wl,-T$(srcdir)/backends/plugins/ds/plugin.ld -mthumb-interwo freebsd*) _plugin_prefix="lib" _plugin_suffix=".so" - CXXFLAGS="$CXXFLAGS -fpic" + CXXFLAGS="$CXXFLAGS -fPIC" _mak_plugins=' PLUGIN_EXTRA_DEPS = PLUGIN_LDFLAGS += -shared @@ -3021,7 +3024,7 @@ POST_OBJS_FLAGS := -Wl,-no-whole-archive linux*) _plugin_prefix="lib" _plugin_suffix=".so" - CXXFLAGS="$CXXFLAGS -fpic" + CXXFLAGS="$CXXFLAGS -fPIC" LIBS="$LIBS -ldl" _mak_plugins=' PLUGIN_EXTRA_DEPS = diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp index 8695d97621..ebad3d039a 100644 --- a/engines/sci/detection.cpp +++ b/engines/sci/detection.cpp @@ -103,6 +103,7 @@ static const PlainGameDescriptor s_sciGameTitles[] = { {"pq4", "Police Quest IV: Open Season"}, // floppy is SCI2, CD SCI2.1 {"qfg4", "Quest for Glory IV: Shadows of Darkness"}, // floppy is SCI2, CD SCI2.1 // === SCI2.1 games ======================================================== + {"chest", "Inside the Chest"}, // aka Behind the Developer's Shield {"gk2", "The Beast Within: A Gabriel Knight Mystery"}, // TODO: Inside The Chest/Behind the Developer's Shield {"kq7", "King's Quest VII: The Princeless Bride"}, @@ -132,6 +133,7 @@ static const GameIdStrToEnum s_gameIdStrToEnum[] = { { "astrochicken", GID_ASTROCHICKEN }, { "camelot", GID_CAMELOT }, { "castlebrain", GID_CASTLEBRAIN }, + { "chest", GID_CHEST }, { "christmas1988", GID_CHRISTMAS1988 }, { "christmas1990", GID_CHRISTMAS1990 }, { "christmas1992", GID_CHRISTMAS1992 }, @@ -208,6 +210,7 @@ struct OldNewIdTableEntry { }; static const OldNewIdTableEntry s_oldNewTable[] = { + { "archive", "chest", SCI_VERSION_NONE }, { "arthur", "camelot", SCI_VERSION_NONE }, { "brain", "castlebrain", SCI_VERSION_1_MIDDLE }, // Amiga { "brain", "castlebrain", SCI_VERSION_1_LATE }, diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h index b978f40aba..8e8b818854 100644 --- a/engines/sci/detection_tables.h +++ b/engines/sci/detection_tables.h @@ -129,6 +129,16 @@ static const struct ADGameDescription SciGameDescriptions[] = { AD_LISTEND}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) }, + // Castle of Dr. Brain - English DOS 5.25" Floppy VGA 1.1 (from rnjacobs, bug report #3578286) + {"castlebrain", "", { + {"resource.map", 0, "a1deac2647ad09472c63656bfb950a4d", 2739}, + {"resource.000", 0, "27ec5fa09cd12a7fd16e86d96a2ed245", 347071}, + {"resource.001", 0, "13e81e1839cd7b216d2bb5615c1ca160", 356812}, + {"resource.002", 0, "583d348c908f89f94f8551d7fe0a2eca", 991752}, + {"resource.003", 0, "6c3d1bb26ad532c94046bc9ac49b5ff4", 728315}, + AD_LISTEND}, + Common::EN_ANY, Common::kPlatformPC, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) }, + // Castle of Dr. Brain - English DOS Floppy 1.1 {"castlebrain", "", { {"resource.map", 0, "f77728304c70017c54793eb6ca648174", 2745}, @@ -162,6 +172,16 @@ static const struct ADGameDescription SciGameDescriptions[] = { AD_LISTEND}, Common::ES_ESP, Common::kPlatformPC, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) }, +#ifdef ENABLE_SCI32 + // Inside the Chest / Behind the Developer's Shield + // SCI interpreter version 2.000.000 + {"chest", "", { + {"resource.map", 0, "9dd015e79cac4f91e7de805448f39775", 1912}, + {"resource.000", 0, "e4efcd042f86679dd4e1834bb3a38edb", 3770943}, + AD_LISTEND}, + Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO3(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_FB01_MIDI) }, +#endif + // Christmas Card 1988 - English DOS // SCI interpreter version 0.000.294 {"christmas1988", "", { @@ -268,7 +288,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.006", 0, "08050329aa113a9f14ed99cbfe3536ec", 232942}, {"resource.007", 0, "64f342463f6f35ba71b3509ef696ae3f", 267702}, AD_LISTEND}, - Common::EN_ANY, Common::kPlatformPC, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) }, + Common::EN_ANY, Common::kPlatformPC, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) }, // Conquests of Camelot - English Amiga (from www.back2roots.org) // Executable scanning reports "1.002.030" diff --git a/engines/sci/engine/features.cpp b/engines/sci/engine/features.cpp index 22c0a1479d..49e2bfc79f 100644 --- a/engines/sci/engine/features.cpp +++ b/engines/sci/engine/features.cpp @@ -466,6 +466,14 @@ bool GameFeatures::autoDetectSci21KernelType() { // 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 + + // HACK: The Inside the Chest Demo doesn't have sounds at all, but + // it's using a SCI2 kernel + if (g_sci->getGameId() == GID_CHEST) { + _sci21KernelType = SCI_VERSION_2; + return true; + } + warning("autoDetectSci21KernelType(): Sound object not loaded, assuming a SCI2.1 table"); _sci21KernelType = SCI_VERSION_2_1; return true; diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h index b6b36c47e7..d0c9b9b1cf 100644 --- a/engines/sci/engine/kernel_tables.h +++ b/engines/sci/engine/kernel_tables.h @@ -94,7 +94,7 @@ static const SciKernelMapSubEntry kDoSound_subops[] = { { SIG_SOUNDSCI0, 7, MAP_CALL(DoSoundResumeAfterRestore), "", NULL }, { SIG_SOUNDSCI0, 8, MAP_CALL(DoSoundMasterVolume), "(i)", NULL }, { SIG_SOUNDSCI0, 9, MAP_CALL(DoSoundUpdate), "o", NULL }, - { SIG_SOUNDSCI0, 10, MAP_CALL(DoSoundFade), "o", kDoSoundFade_workarounds }, + { SIG_SOUNDSCI0, 10, MAP_CALL(DoSoundFade), "[o0]", kDoSoundFade_workarounds }, { SIG_SOUNDSCI0, 11, MAP_CALL(DoSoundGetPolyphony), "", NULL }, { SIG_SOUNDSCI0, 12, MAP_CALL(DoSoundStopAll), "", NULL }, { SIG_SOUNDSCI1EARLY, 0, MAP_CALL(DoSoundMasterVolume), NULL, NULL }, diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp index 4061795f82..b839ac51c3 100644 --- a/engines/sci/engine/kpathing.cpp +++ b/engines/sci/engine/kpathing.cpp @@ -1366,7 +1366,16 @@ static void AStar(PathfindingState *s) { // other, while we apply a penalty to paths traversing it. // This difference might lead to problems, but none are // known at the time of writing. - if (s->pointOnScreenBorder(vertex->v)) + + // WORKAROUND: This check fails in QFG1VGA, room 81 (bug report #3568452). + // However, it is needed in other SCI1.1 games, such as LB2. Therefore, we + // add this workaround for that scene in QFG1VGA, until our algorithm matches + // better what SSCI is doing. With this workaround, QFG1VGA no longer freezes + // in that scene. + bool qfg1VgaWorkaround = (g_sci->getGameId() == GID_QFG1VGA && + g_sci->getEngineState()->currentRoomNumber() == 81); + + if (s->pointOnScreenBorder(vertex->v) && !qfg1VgaWorkaround) new_dist += 10000; if (new_dist < vertex->costG) { diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp index 9fa0368784..db510c2545 100644 --- a/engines/sci/engine/workarounds.cpp +++ b/engines/sci/engine/workarounds.cpp @@ -243,9 +243,6 @@ const SciWorkaroundEntry kDisposeScript_workarounds[] = { // gameID, room,script,lvl, object-name, method-name, call,index, workaround const SciWorkaroundEntry kDoSoundFade_workarounds[] = { - { GID_CAMELOT, -1, 989, 0, "rmMusic", "fade", -1, 0, { WORKAROUND_IGNORE, 0 } }, // gets called frequently with a NULL reference (i.e. 0:0) - bug #3035149 - { GID_KQ1, -1, 989, 0, "gameSound", "fade", -1, 0, { WORKAROUND_IGNORE, 0 } }, // gets called in several scenes (e.g. graham cracker) with 0:0 - { GID_KQ4, -1, 989, 0, "mySound", "", -1, 0, { WORKAROUND_IGNORE, 0 } }, // gets called in the demo when trying to open the non-existent menu with 0:0 - bug #3036942 { GID_KQ5, 213, 989, 0, "globalSound3", "fade", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // english floppy: when bandits leave the secret temple, parameter 4 is an object - bug #3037594 { GID_KQ6, 105, 989, 0, "globalSound", "fade", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // floppy: during intro, parameter 4 is an object { GID_KQ6, 460, 989, 0, "globalSound2", "fade", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // after pulling the black widow's web on the isle of wonder, parameter 4 is an object - bug #3034567 diff --git a/engines/sci/sci.h b/engines/sci/sci.h index 3441e26c01..3b9844b326 100644 --- a/engines/sci/sci.h +++ b/engines/sci/sci.h @@ -110,6 +110,7 @@ enum SciGameId { GID_ASTROCHICKEN, GID_CAMELOT, GID_CASTLEBRAIN, + GID_CHEST, GID_CHRISTMAS1988, GID_CHRISTMAS1990, GID_CHRISTMAS1992, diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp index 5d32f40f18..7782ab4e48 100644 --- a/engines/sci/sound/soundcmd.cpp +++ b/engines/sci/sound/soundcmd.cpp @@ -340,6 +340,12 @@ reg_t SoundCommandParser::kDoSoundMasterVolume(int argc, reg_t *argv, reg_t acc) reg_t SoundCommandParser::kDoSoundFade(int argc, reg_t *argv, reg_t acc) { reg_t obj = argv[0]; + // The object can be null in several SCI0 games (e.g. Camelot, KQ1, KQ4, MUMG). + // Check bugs #3035149, #3036942 and #3578335. + // In this case, we just ignore the call. + if (obj.isNull() && argc == 1) + return acc; + MusicEntry *musicSlot = _music->getSlot(obj); if (!musicSlot) { debugC(kDebugLevelSound, "kDoSound(fade): Slot not found (%04x:%04x)", PRINT_REG(obj)); diff --git a/engines/wintermute/base/base_game.cpp b/engines/wintermute/base/base_game.cpp index f0b1171ca4..b6886b7a33 100644 --- a/engines/wintermute/base/base_game.cpp +++ b/engines/wintermute/base/base_game.cpp @@ -64,6 +64,7 @@ #include "engines/wintermute/ui/ui_window.h" #include "engines/wintermute/wintermute.h" #include "engines/wintermute/platform_osystem.h" +#include "base/version.h" #include "common/config-manager.h" #include "common/savefile.h" #include "common/textconsole.h" @@ -489,7 +490,7 @@ void BaseGame::DEBUG_DebugEnable(const char *filename) { LOG(0, "********** DEBUG LOG OPENED %02d-%02d-%02d (Release Build) *****************", hours, mins, secs); #endif - LOG(0, "%s ver %d.%d.%d%s, Compiled on " __DATE__ ", " __TIME__, DCGF_NAME, DCGF_VER_MAJOR, DCGF_VER_MINOR, DCGF_VER_BUILD, DCGF_VER_SUFFIX); + LOG(0, "%s - %s ver %d.%d.%d%s ", gScummVMFullVersion, DCGF_NAME, DCGF_VER_MAJOR, DCGF_VER_MINOR, DCGF_VER_BUILD, DCGF_VER_SUFFIX); AnsiString platform = BasePlatform::getPlatformName(); LOG(0, "Platform: %s", platform.c_str()); diff --git a/engines/wintermute/base/font/base_font_truetype.cpp b/engines/wintermute/base/font/base_font_truetype.cpp index 3219918e6d..f236329fcd 100644 --- a/engines/wintermute/base/font/base_font_truetype.cpp +++ b/engines/wintermute/base/font/base_font_truetype.cpp @@ -159,6 +159,11 @@ void BaseFontTT::drawText(const byte *text, int x, int y, int width, TTextAlign // TODO: Why do we still insist on Widestrings everywhere? /* if (_gameRef->_textEncoding == TEXT_UTF8) text = StringUtil::Utf8ToWide((char *)Text); else text = StringUtil::AnsiToWide((char *)Text);*/ + // HACK: J.U.L.I.A. uses CP1252, we need to fix that, + // And we still don't have any UTF8-support. + if (_gameRef->_textEncoding != TEXT_UTF8) { + textStr = StringUtil::ansiToWide((char *)text); + } if (maxLength >= 0 && textStr.size() > (uint32)maxLength) { textStr = Common::String(textStr.c_str(), (uint32)maxLength); diff --git a/engines/wintermute/utils/string_util.cpp b/engines/wintermute/utils/string_util.cpp index 2c3be8c2f5..7b3b0e1297 100644 --- a/engines/wintermute/utils/string_util.cpp +++ b/engines/wintermute/utils/string_util.cpp @@ -148,11 +148,11 @@ Utf8String StringUtil::wideToUtf8(const WideString &WideStr) { // Currently this only does Ansi->ISO 8859, and only for carets. char simpleAnsiToWide(const AnsiString &str, uint32 &offset) { - char c = str[offset]; + byte c = str[offset]; - if (c == 92) { + if (c == 146) { offset++; - return '\''; + return 39; // Replace right-quote with apostrophe } else { offset++; return c; @@ -162,11 +162,11 @@ char simpleAnsiToWide(const AnsiString &str, uint32 &offset) { ////////////////////////////////////////////////////////////////////////// WideString StringUtil::ansiToWide(const AnsiString &str) { // TODO: This function gets called a lot, so warnings like these drown out the usefull information - /*Common::String converted = ""; + Common::String converted = ""; uint32 index = 0; while (index != str.size()) { converted += simpleAnsiToWide(str, index); - }*/ + } // using default os locale! /* setlocale(LC_CTYPE, ""); @@ -176,7 +176,7 @@ WideString StringUtil::ansiToWide(const AnsiString &str) { WideString ResultString(wstr); delete[] wstr; return ResultString;*/ - return WideString(str); + return WideString(converted); } ////////////////////////////////////////////////////////////////////////// diff --git a/engines/wintermute/video/video_theora_player.cpp b/engines/wintermute/video/video_theora_player.cpp index 0f8bc018ea..d14c807e11 100644 --- a/engines/wintermute/video/video_theora_player.cpp +++ b/engines/wintermute/video/video_theora_player.cpp @@ -151,7 +151,32 @@ bool VideoTheoraPlayer::initialize(const Common::String &filename, const Common: ////////////////////////////////////////////////////////////////////////// bool VideoTheoraPlayer::resetStream() { - warning("VidTheoraPlayer::resetStream - stubbed"); + warning("VidTheoraPlayer::resetStream - hacked"); + // HACK: Just reopen the same file again. + if (_theoraDecoder) { + _theoraDecoder->close(); + } + delete _theoraDecoder; + _theoraDecoder = NULL; + + _file = BaseFileManager::getEngineInstance()->openFile(_filename, true, false); + if (!_file) { + return STATUS_FAILED; + } + +#if defined (USE_THEORADEC) + _theoraDecoder = new Video::TheoraDecoder(); +#else + return STATUS_FAILED; +#endif + _theoraDecoder->loadStream(_file); + + if (!_theoraDecoder->isVideoLoaded()) { + return STATUS_FAILED; + } + + return play(_playbackType, _posX, _posY, false, false, _looping, 0, _playZoom); + // End of hack. #if 0 // Stubbed for now, as theora isn't seekable if (_sound) { _sound->Stop(); @@ -265,8 +290,10 @@ bool VideoTheoraPlayer::update() { if (_theoraDecoder) { if (_theoraDecoder->endOfVideo() && _looping) { - warning("Should loop movie %s", _filename.c_str()); + warning("Should loop movie %s, hacked for now", _filename.c_str()); _theoraDecoder->rewind(); + //HACK: Just reinitialize the same video again: + return resetStream(); } else if (_theoraDecoder->endOfVideo() && !_looping) { debugC(kWintermuteDebugLog, "Finished movie %s", _filename.c_str()); _state = THEORA_STATE_FINISHED; diff --git a/graphics/scaler/aspect.cpp b/graphics/scaler/aspect.cpp index 327e7c5e89..92d6c5777e 100644 --- a/graphics/scaler/aspect.cpp +++ b/graphics/scaler/aspect.cpp @@ -23,11 +23,7 @@ #include "graphics/scaler/intern.h" #include "graphics/scaler/aspect.h" -#ifdef OPENPANDORA -#define NEON_ASPECT_CORRECTOR -#endif - -#ifdef NEON_ASPECT_CORRECTOR +#ifdef USE_ARM_NEON_ASPECT_CORRECTOR #include <arm_neon.h> #endif @@ -62,7 +58,7 @@ static inline void interpolate5Line(uint16 *dst, const uint16 *srcA, const uint1 #if ASPECT_MODE == kVeryFastAndGoodAspectMode -#ifdef NEON_ASPECT_CORRECTOR +#ifdef USE_ARM_NEON_ASPECT_CORRECTOR template<typename ColorMask> static void interpolate5LineNeon(uint16 *dst, const uint16 *srcA, const uint16 *srcB, int width, int k1, int k2) { @@ -97,31 +93,31 @@ static void interpolate5LineNeon(uint16 *dst, const uint16 *srcA, const uint16 * width -= 4; } } -#endif +#endif // USE_ARM_NEON_ASPECT_CORRECTOR template<typename ColorMask, int scale> static void interpolate5Line(uint16 *dst, const uint16 *srcA, const uint16 *srcB, int width) { if (scale == 1) { -#ifdef NEON_ASPECT_CORRECTOR +#ifdef USE_NEON_ASPECT_CORRECTOR int width4 = width & ~3; interpolate5LineNeon<ColorMask>(dst, srcA, srcB, width4, 7, 1); srcA += width4; srcB += width4; dst += width4; width -= width4; -#endif +#endif // USE_ARM_NEON_ASPECT_CORRECTOR while (width--) { *dst++ = interpolate16_7_1<ColorMask>(*srcB++, *srcA++); } } else { -#ifdef NEON_ASPECT_CORRECTOR +#ifdef USE_ARM_NEON_ASPECT_CORRECTOR int width4 = width & ~3; interpolate5LineNeon<ColorMask>(dst, srcA, srcB, width4, 5, 3); srcA += width4; srcB += width4; dst += width4; width -= width4; -#endif +#endif // USE_ARM_NEON_ASPECT_CORRECTOR while (width--) { *dst++ = interpolate16_5_3<ColorMask>(*srcB++, *srcA++); } |