diff options
author | Torbjörn Andersson | 2014-03-04 07:08:59 +0100 |
---|---|---|
committer | Torbjörn Andersson | 2014-03-04 07:08:59 +0100 |
commit | d980584cc5ffab51bd79fa1e3cb369ca69c74104 (patch) | |
tree | 05fbbab5471ba3157960911f0908f0a85afe9fa3 | |
parent | 7cc8d4184a11410ba8f3f96fa51462eb4119df36 (diff) | |
parent | dcac9c1986abd40e0b9669577fa04baed199ea2a (diff) | |
download | scummvm-rg350-d980584cc5ffab51bd79fa1e3cb369ca69c74104.tar.gz scummvm-rg350-d980584cc5ffab51bd79fa1e3cb369ca69c74104.tar.bz2 scummvm-rg350-d980584cc5ffab51bd79fa1e3cb369ca69c74104.zip |
Merge pull request #441 from eriktorbjorn/feeble-loyalty
Possible fix for bug #6525, AGOS: FF - Loyalty Rating never changes in 4 CD version
-rw-r--r-- | engines/agos/agos.h | 3 | ||||
-rw-r--r-- | engines/agos/detection_tables.h | 4 | ||||
-rw-r--r-- | engines/agos/intern.h | 21 | ||||
-rw-r--r-- | engines/agos/script_ff.cpp | 69 |
4 files changed, 84 insertions, 13 deletions
diff --git a/engines/agos/agos.h b/engines/agos/agos.h index c5b41649ba..5e49fce5ff 100644 --- a/engines/agos/agos.h +++ b/engines/agos/agos.h @@ -1937,6 +1937,7 @@ public: void off_listSaveGames(); void off_checkCD(); void off_screenTextBox(); + void off_b2Set(); void off_isAdjNoun(); void off_hyperLinkOn(); void off_hyperLinkOff(); @@ -1979,6 +1980,8 @@ protected: virtual uint16 readUint16Wrapper(const void *src); virtual uint32 readUint32Wrapper(const void *src); + void setLoyaltyRating(byte rating); + void playVideo(const char *filename, bool lastSceneUsed = false); void stopInteractiveVideo(); diff --git a/engines/agos/detection_tables.h b/engines/agos/detection_tables.h index 26c2e7e90d..77fc88c6bb 100644 --- a/engines/agos/detection_tables.h +++ b/engines/agos/detection_tables.h @@ -2622,7 +2622,7 @@ static const AGOSGameDescription gameDescriptions[] = { GType_FF, GID_FEEBLEFILES, - GF_OLD_BUNDLE | GF_TALKIE | GF_PACKED + GF_OLD_BUNDLE | GF_TALKIE | GF_PACKED | GF_BROKEN_FF_RATING }, // The Feeble Files - English Windows 4CD @@ -2645,7 +2645,7 @@ static const AGOSGameDescription gameDescriptions[] = { GType_FF, GID_FEEBLEFILES, - GF_OLD_BUNDLE | GF_TALKIE + GF_OLD_BUNDLE | GF_TALKIE | GF_BROKEN_FF_RATING }, // The Feeble Files - French Windows 4CD diff --git a/engines/agos/intern.h b/engines/agos/intern.h index 8b7ab32315..3f5c8c519b 100644 --- a/engines/agos/intern.h +++ b/engines/agos/intern.h @@ -246,16 +246,17 @@ enum SubObjectFlags { }; enum GameFeatures { - GF_TALKIE = 1 << 0, - GF_OLD_BUNDLE = 1 << 1, - GF_CRUNCHED = 1 << 2, - GF_CRUNCHED_GAMEPC = 1 << 3, - GF_ZLIBCOMP = 1 << 4, - GF_32COLOR = 1 << 5, - GF_EGA = 1 << 6, - GF_PLANAR = 1 << 7, - GF_DEMO = 1 << 8, - GF_PACKED = 1 << 9 + GF_TALKIE = 1 << 0, + GF_OLD_BUNDLE = 1 << 1, + GF_CRUNCHED = 1 << 2, + GF_CRUNCHED_GAMEPC = 1 << 3, + GF_ZLIBCOMP = 1 << 4, + GF_32COLOR = 1 << 5, + GF_EGA = 1 << 6, + GF_PLANAR = 1 << 7, + GF_DEMO = 1 << 8, + GF_PACKED = 1 << 9, + GF_BROKEN_FF_RATING = 1 << 10 }; enum GameFileTypes { diff --git a/engines/agos/script_ff.cpp b/engines/agos/script_ff.cpp index d942a88e9a..e4fadcf360 100644 --- a/engines/agos/script_ff.cpp +++ b/engines/agos/script_ff.cpp @@ -243,7 +243,7 @@ void AGOSEngine_Feeble::setupOpcodes() { /* 164 */ OPCODE(oe2_getDollar2), OPCODE(off_isAdjNoun), - OPCODE(oe2_b2Set), + OPCODE(off_b2Set), OPCODE(oe2_b2Clear), /* 168 */ OPCODE(oe2_b2Zero), @@ -296,6 +296,39 @@ void AGOSEngine_Feeble::executeOpcode(int opcode) { (this->*op) (); } +void AGOSEngine_Feeble::setLoyaltyRating(byte rating) { + // WORKAROUND: The 4CD version of The Feeble File is missing the parts + // of the script that set the loyalty rating. This approximates the + // script from the 2CD version. See bug #6525. + + switch (rating) { + case 1: + // Kicking vending machine: Possibility of Undesirable Character Flaws + writeVariable(120, 1); + break; + case 2: + // Confessing: Confirmed Minor Character Flaws + writeVariable(120, 2); + break; + case 3: + // Being sent to Cygnus Alpha: Suspected Subversive Activity + writeVariable(120, 3); + break; + case 4: + // Escaping from Cygnus Alpha: Confirmed Subversive Activity + writeVariable(120, 4); + break; + case 5: + // Being brought before Filbert: Confirmed Treasonous Activity + writeVariable(120, 5); + break; + case 6: + // Arriving at rebel base: Freedom Fighters Operative + writeVariable(120, 6); + break; + } +} + // ----------------------------------------------------------------------- // Feeble Files Opcodes // ----------------------------------------------------------------------- @@ -467,6 +500,34 @@ void AGOSEngine_Feeble::off_isAdjNoun() { setScriptCondition(false); } +void AGOSEngine_Feeble::off_b2Set() { + // 166: set bit2 + uint bit = getVarOrByte(); + _bitArrayTwo[bit / 16] |= (1 << (bit & 15)); + + if (getFeatures() & GF_BROKEN_FF_RATING) { + switch (bit) { + case 152: + setLoyaltyRating(1); + break; + case 153: + setLoyaltyRating(2); + break; + case 240: + setLoyaltyRating(3); + break; + case 251: + setLoyaltyRating(4); + break; + case 253: + setLoyaltyRating(6); + break; + default: + break; + } + } +} + void AGOSEngine_Feeble::off_hyperLinkOn() { // 171: oracle hyperlink on hyperLinkOn(getVarOrWord()); @@ -565,6 +626,12 @@ void AGOSEngine_Feeble::off_loadVideo() { assert(_moviePlayer); _moviePlayer->load(); + + if (getFeatures() & GF_BROKEN_FF_RATING) { + if (strcmp((const char *)filename, "Statue1.smk") == 0) { + setLoyaltyRating(5); + } + } } void AGOSEngine_Feeble::off_playVideo() { |