aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/cursor.cpp4
-rw-r--r--engines/scumm/detection.cpp9
-rw-r--r--engines/scumm/detection_tables.h12
-rw-r--r--engines/scumm/he/intern_he.h8
-rw-r--r--engines/scumm/he/logic/football.cpp169
-rw-r--r--engines/scumm/he/logic_he.cpp3
-rw-r--r--engines/scumm/he/logic_he.h1
-rw-r--r--engines/scumm/he/script_v100he.cpp13
-rw-r--r--engines/scumm/he/script_v60he.cpp2
-rw-r--r--engines/scumm/he/script_v90he.cpp14
-rw-r--r--engines/scumm/he/sound_he.cpp2
-rw-r--r--engines/scumm/script.cpp8
-rw-r--r--engines/scumm/scumm-md5.h11
-rw-r--r--engines/scumm/scumm.cpp7
-rw-r--r--engines/scumm/scumm.h2
15 files changed, 213 insertions, 52 deletions
diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp
index 42f11498d9..88681898f5 100644
--- a/engines/scumm/cursor.cpp
+++ b/engines/scumm/cursor.cpp
@@ -121,13 +121,13 @@ void ScummEngine::updateCursor() {
CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height,
_cursor.hotspotX, _cursor.hotspotY,
(_game.platform == Common::kPlatformNES ? _grabbedCursor[63] : transColor),
- (_game.heversion == 70 ? 2 : 1),
+ (_game.heversion == 70 ? true : false),
&format);
#else
CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height,
_cursor.hotspotX, _cursor.hotspotY,
(_game.platform == Common::kPlatformNES ? _grabbedCursor[63] : transColor),
- (_game.heversion == 70 ? 2 : 1));
+ (_game.heversion == 70 ? true : false));
#endif
}
diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp
index cd878b49ae..ebf1a2675c 100644
--- a/engines/scumm/detection.cpp
+++ b/engines/scumm/detection.cpp
@@ -1079,6 +1079,14 @@ Common::Error ScummMetaEngine::createInstance(OSystem *syst, Engine **engine) co
debug(1, "Using MD5 '%s'", res.md5.c_str());
}
+ // We don't support the "Lite" version off puttzoo iOS because it contains
+ // the full game.
+ if (!strcmp(res.game.gameid, "puttzoo") && !strcmp(res.extra, "Lite")) {
+ GUIErrorMessage("The Lite version of Putt-Putt Saves the Zoo iOS is not supported to avoid piracy.\n"
+ "The full version is available for purchase from the iTunes Store.");
+ return Common::kUnsupportedGameidError;
+ }
+
// If the GUI options were updated, we catch this here and update them in the users config
// file transparently.
Common::updateGameGUIOptions(res.game.guioptions, getGameGUIOptionsDescriptionLanguage(res.language));
@@ -1127,6 +1135,7 @@ Common::Error ScummMetaEngine::createInstance(OSystem *syst, Engine **engine) co
case 200:
*engine = new ScummEngine_vCUPhe(syst, res);
break;
+ case 101:
case 100:
*engine = new ScummEngine_v100he(syst, res);
break;
diff --git a/engines/scumm/detection_tables.h b/engines/scumm/detection_tables.h
index f48b40dd48..be1b90e356 100644
--- a/engines/scumm/detection_tables.h
+++ b/engines/scumm/detection_tables.h
@@ -382,14 +382,16 @@ static const GameSettings gameVariantsTable[] = {
{"pjgames", 0, 0, GID_HEGAME, 6, 100, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK, GUIO3(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT)},
// Added the use of bink videos
- {"Baseball2003", 0, 0, GID_HEGAME, 6, 100, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK, GUIO3(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT)},
- {"basketball", 0, 0, GID_BASKETBALL, 6, 100, MDT_NONE, GF_USE_KEY| GF_16BIT_COLOR, UNK, GUIO3(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT)},
- {"football2002", 0, 0, GID_FOOTBALL, 6, 100, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK, GUIO3(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT)},
{"Soccer2004", 0, 0, GID_SOCCER2004, 6, 100, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK, GUIO3(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT)},
// U32 code required, for testing only
{"moonbase", 0, 0, GID_MOONBASE, 6, 100, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK, GUIO3(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT)},
{"moonbase", "Demo", 0, GID_MOONBASE, 6, 100, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR | GF_DEMO, UNK, GUIO3(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT)},
+
+ // HE100 games, which use older o72_debugInput code
+ {"Baseball2003", 0, 0, GID_BASEBALL2003, 6, 101, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK, GUIO3(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT)},
+ {"basketball", 0, 0, GID_BASKETBALL, 6, 101, MDT_NONE, GF_USE_KEY| GF_16BIT_COLOR, UNK, GUIO3(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT)},
+ {"football2002", 0, 0, GID_FOOTBALL2002, 6, 101, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK, GUIO3(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT)},
#endif
// The following are meant to be generic HE game variants and as such do
@@ -407,6 +409,7 @@ static const GameSettings gameVariantsTable[] = {
{"", "HE 98.5", 0, GID_HEGAME, 6, 98, MDT_NONE, GF_USE_KEY | GF_HE_985, UNK, GUIO3(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT)},
{"", "HE 99", 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY, UNK, GUIO3(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT)},
{"", "HE 100", 0, GID_HEGAME, 6, 100, MDT_NONE, GF_USE_KEY, UNK, GUIO3(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT)},
+ {"", "HE 101", 0, GID_HEGAME, 6, 100, MDT_NONE, GF_USE_KEY, UNK, GUIO3(GUIO_NOLAUNCHLOAD, GUIO_NOMIDI, GUIO_NOASPECT)},
#endif
{NULL, NULL, 0, 0, 0, MDT_NONE, 0, 0, UNK, 0}
};
@@ -704,7 +707,8 @@ static const GameFilenamePattern gameFilenamesTable[] = {
{ "freddi4", "Freddi 4 Demo", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
{ "freddi4", "FreddiGS", kGenHEPC, Common::DE_DEU, UNK, 0 },
{ "freddi4", "FreddiGS", kGenHEMac, Common::DE_DEU, Common::kPlatformMacintosh, 0 },
- { "freddi4", "FreddiHRBG", kGenHEPC, UNK_LANG, UNK, 0 },
+ { "freddi4", "FreddiHRBG", kGenHEPC, Common::EN_GRB, UNK, 0 },
+ { "freddi4", "FreddiHRBG", kGenHEMac, Common::EN_GRB, Common::kPlatformMacintosh, 0 },
{ "freddi4", "FreddiMini", kGenHEPC, UNK_LANG, UNK, 0 },
{ "freddi4", "Malice4", kGenHEMac, Common::FR_FRA, Common::kPlatformMacintosh, 0 },
{ "freddi4", "MaliceMRC", kGenHEPC, Common::FR_FRA, UNK, 0 },
diff --git a/engines/scumm/he/intern_he.h b/engines/scumm/he/intern_he.h
index cdc5faa084..fc5e4bcdf0 100644
--- a/engines/scumm/he/intern_he.h
+++ b/engines/scumm/he/intern_he.h
@@ -187,6 +187,8 @@ public:
Wiz *_wiz;
+ virtual int setupStringArray(int size);
+
protected:
virtual void setupOpcodes();
@@ -201,7 +203,6 @@ protected:
virtual void clearDrawQueues();
int getStringCharWidth(byte chr);
- virtual int setupStringArray(int size);
void appendSubstring(int dst, int src, int len2, int len);
void adjustRect(Common::Rect &rect);
@@ -258,6 +259,9 @@ public:
virtual void resetScumm();
+ virtual byte *getStringAddress(ResId idx);
+ virtual int setupStringArray(int size);
+
protected:
virtual void setupOpcodes();
@@ -265,7 +269,6 @@ protected:
virtual void resetScummVars();
virtual void readArrayFromIndexFile();
- virtual byte *getStringAddress(ResId idx);
virtual void readMAXS(int blockSize);
virtual void redrawBGAreas();
@@ -280,7 +283,6 @@ protected:
void copyArray(int array1, int a1_dim2start, int a1_dim2end, int a1_dim1start, int a1_dim1end,
int array2, int a2_dim2start, int a2_dim2end, int a2_dim1start, int a2_dim1end);
void copyArrayHelper(ArrayHeader *ah, int idx2, int idx1, int len1, byte **data, int *size, int *num);
- virtual int setupStringArray(int size);
int readFileToArray(int slot, int32 size);
void writeFileFromArray(int slot, int32 resID);
diff --git a/engines/scumm/he/logic/football.cpp b/engines/scumm/he/logic/football.cpp
index f86f97eaf7..f67e07c475 100644
--- a/engines/scumm/he/logic/football.cpp
+++ b/engines/scumm/he/logic/football.cpp
@@ -20,6 +20,8 @@
*
*/
+#include "common/savefile.h"
+
#include "scumm/he/intern_he.h"
#include "scumm/he/logic_he.h"
@@ -35,16 +37,16 @@ public:
LogicHEfootball(ScummEngine_v90he *vm) : LogicHE(vm) {}
int versionID();
- int32 dispatch(int op, int numArgs, int32 *args);
-
-private:
- int op_1004(int32 *args);
- int op_1006(int32 *args);
- int op_1007(int32 *args);
- int op_1010(int32 *args);
- int op_1022(int32 *args);
- int op_1023(int32 *args);
- int op_1024(int32 *args);
+ virtual int32 dispatch(int op, int numArgs, int32 *args);
+
+protected:
+ int lineEquation3D(int32 *args);
+ virtual int translateWorldToScreen(int32 *args);
+ int fieldGoalScreenTranslation(int32 *args);
+ virtual int translateScreenToWorld(int32 *args);
+ int nextPoint(int32 *args);
+ int computePlayerBallIntercepts(int32 *args);
+ int computeTwoCircleIntercepts(int32 *args);
};
int LogicHEfootball::versionID() {
@@ -56,31 +58,31 @@ int32 LogicHEfootball::dispatch(int op, int numArgs, int32 *args) {
switch (op) {
case 1004:
- res = op_1004(args);
+ res = lineEquation3D(args);
break;
case 1006:
- res = op_1006(args);
+ res = translateWorldToScreen(args);
break;
case 1007:
- res = op_1007(args);
+ res = fieldGoalScreenTranslation(args);
break;
case 1010:
- res = op_1010(args);
+ res = translateScreenToWorld(args);
break;
case 1022:
- res = op_1022(args);
+ res = nextPoint(args);
break;
case 1023:
- res = op_1023(args);
+ res = computePlayerBallIntercepts(args);
break;
case 1024:
- res = op_1024(args);
+ res = computeTwoCircleIntercepts(args);
break;
case 8221968:
@@ -123,8 +125,8 @@ int32 LogicHEfootball::dispatch(int op, int numArgs, int32 *args) {
return res;
}
-int LogicHEfootball::op_1004(int32 *args) {
- // Identical to LogicHEsoccer::op_1004
+int LogicHEfootball::lineEquation3D(int32 *args) {
+ // Identical to soccer's 1004 opcode
double res, a2, a4, a5;
a5 = ((double)args[4] - (double)args[1]) / ((double)args[5] - (double)args[2]);
@@ -141,8 +143,8 @@ int LogicHEfootball::op_1004(int32 *args) {
return 1;
}
-int LogicHEfootball::op_1006(int32 *args) {
- // This seems to be more or less the inverse of op_1010
+int LogicHEfootball::translateWorldToScreen(int32 *args) {
+ // This is more or less the inverse of translateScreenToWorld
const double a1 = args[1];
double res;
@@ -167,7 +169,7 @@ int LogicHEfootball::op_1006(int32 *args) {
return 1;
}
-int LogicHEfootball::op_1007(int32 *args) {
+int LogicHEfootball::fieldGoalScreenTranslation(int32 *args) {
double res, temp;
temp = (double)args[1] * 0.32;
@@ -188,8 +190,8 @@ int LogicHEfootball::op_1007(int32 *args) {
return 1;
}
-int LogicHEfootball::op_1010(int32 *args) {
- // This seems to be more or less the inverse of op_1006
+int LogicHEfootball::translateScreenToWorld(int32 *args) {
+ // This is more or less the inverse of translateWorldToScreen
double a1 = (640.0 - (double)args[1] - 26.0) / 1.1588235e-1;
// 2.9411764e-4 = 1/3400
@@ -205,7 +207,7 @@ int LogicHEfootball::op_1010(int32 *args) {
return 1;
}
-int LogicHEfootball::op_1022(int32 *args) {
+int LogicHEfootball::nextPoint(int32 *args) {
double res;
double var10 = args[4] - args[1];
double var8 = args[5] - args[2];
@@ -226,7 +228,7 @@ int LogicHEfootball::op_1022(int32 *args) {
return 1;
}
-int LogicHEfootball::op_1023(int32 *args) {
+int LogicHEfootball::computePlayerBallIntercepts(int32 *args) {
double var10, var18, var20, var28, var30, var30_;
double argf[7];
@@ -272,7 +274,8 @@ int LogicHEfootball::op_1023(int32 *args) {
return 1;
}
-int LogicHEfootball::op_1024(int32 *args) {
+int LogicHEfootball::computeTwoCircleIntercepts(int32 *args) {
+ // Looks like this was just dummied out
writeScummVar(108, 0);
writeScummVar(109, 0);
writeScummVar(110, 0);
@@ -281,8 +284,120 @@ int LogicHEfootball::op_1024(int32 *args) {
return 1;
}
+class LogicHEfootball2002 : public LogicHEfootball {
+public:
+ LogicHEfootball2002(ScummEngine_v90he *vm) : LogicHEfootball(vm) {}
+
+ int32 dispatch(int op, int numArgs, int32 *args);
+
+private:
+ int translateWorldToScreen(int32 *args);
+ int translateScreenToWorld(int32 *args);
+ int getDayOfWeek();
+ int initScreenTranslations();
+ int getPlaybookFiles(int32 *args);
+ int largestFreeBlock();
+};
+
+int32 LogicHEfootball2002::dispatch(int op, int numArgs, int32 *args) {
+ int32 res = 0;
+
+ switch (op) {
+ case 1025:
+ res = getDayOfWeek();
+ break;
+
+ case 1026:
+ res = initScreenTranslations();
+ break;
+
+ case 1027:
+ res = getPlaybookFiles(args);
+ break;
+
+ case 1028:
+ res = largestFreeBlock();
+ break;
+
+ case 1029:
+ // Clean-up off heap
+ // Dummied in the Windows U32
+ res = 1;
+ break;
+
+ case 1516:
+ // Start auto LAN game
+ break;
+
+ default:
+ res = LogicHEfootball::dispatch(op, numArgs, args);
+ break;
+ }
+
+ return res;
+}
+
+int LogicHEfootball2002::translateWorldToScreen(int32 *args) {
+ // TODO: Implement modified 2002 version
+ return LogicHEfootball::translateWorldToScreen(args);
+}
+
+int LogicHEfootball2002::translateScreenToWorld(int32 *args) {
+ // TODO: Implement modified 2002 version
+ return LogicHEfootball::translateScreenToWorld(args);
+}
+
+int LogicHEfootball2002::getDayOfWeek() {
+ // TODO: Get day of week, store in var 108
+ return 1;
+}
+
+int LogicHEfootball2002::initScreenTranslations() {
+ // TODO: Set values used by translateWorldToScreen/translateScreenToWorld
+ return 1;
+}
+
+int LogicHEfootball2002::getPlaybookFiles(int32 *args) {
+ // Get the pattern and then skip over the directory prefix ("*\" or "*:")
+ Common::String pattern = (const char *)_vm->getStringAddress(args[0] & ~0x33539000) + 2;
+
+ // Prepare a buffer to hold the file names
+ char buffer[1000];
+ buffer[0] = 0;
+
+ // Get the list of file names that match the pattern and iterate over it
+ Common::StringArray fileList = _vm->getSaveFileManager()->listSavefiles(pattern);
+
+ for (uint32 i = 0; i < fileList.size() && strlen(buffer) < 970; i++) {
+ // Isolate the base part of the filename and concatenate it to our buffer
+ Common::String fileName = Common::String(fileList[i].c_str(), fileList[i].size() - (pattern.size() - 1));
+ strcat(buffer, fileName.c_str());
+ strcat(buffer, ">"); // names separated by '>'
+ }
+
+ // Now store the result in an array
+ int array = _vm->setupStringArray(strlen(buffer));
+ strcpy((char *)_vm->getStringAddress(array), buffer);
+
+ // And store the array index in variable 108
+ writeScummVar(108, array);
+
+ return 1;
+}
+
+int LogicHEfootball2002::largestFreeBlock() {
+ // The Windows version always sets the variable to this
+ // The Mac version actually checks for the largest free block
+ writeScummVar(108, 100000000);
+ return 1;
+}
+
LogicHE *makeLogicHEfootball(ScummEngine_v90he *vm) {
return new LogicHEfootball(vm);
}
+LogicHE *makeLogicHEfootball2002(ScummEngine_v90he *vm) {
+ return new LogicHEfootball2002(vm);
+}
+
} // End of namespace Scumm
diff --git a/engines/scumm/he/logic_he.cpp b/engines/scumm/he/logic_he.cpp
index a76c393e13..0f9454ba28 100644
--- a/engines/scumm/he/logic_he.cpp
+++ b/engines/scumm/he/logic_he.cpp
@@ -87,6 +87,9 @@ LogicHE *LogicHE::makeLogicHE(ScummEngine_v90he *vm) {
case GID_FOOTBALL:
return makeLogicHEfootball(vm);
+ case GID_FOOTBALL2002:
+ return makeLogicHEfootball2002(vm);
+
case GID_SOCCER:
case GID_SOCCERMLS:
case GID_SOCCER2004:
diff --git a/engines/scumm/he/logic_he.h b/engines/scumm/he/logic_he.h
index 893dc81b87..93c0569a4f 100644
--- a/engines/scumm/he/logic_he.h
+++ b/engines/scumm/he/logic_he.h
@@ -61,6 +61,7 @@ protected:
LogicHE *makeLogicHErace(ScummEngine_v90he *vm);
LogicHE *makeLogicHEfunshop(ScummEngine_v90he *vm);
LogicHE *makeLogicHEfootball(ScummEngine_v90he *vm);
+LogicHE *makeLogicHEfootball2002(ScummEngine_v90he *vm);
LogicHE *makeLogicHEsoccer(ScummEngine_v90he *vm);
LogicHE *makeLogicHEbaseball2001(ScummEngine_v90he *vm);
LogicHE *makeLogicHEbasketball(ScummEngine_v90he *vm);
diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp
index 56ea10f507..a2eb42214b 100644
--- a/engines/scumm/he/script_v100he.cpp
+++ b/engines/scumm/he/script_v100he.cpp
@@ -876,6 +876,7 @@ void ScummEngine_v100he::o100_floodFill() {
_floodFillParams.box.top = 0;
_floodFillParams.box.right = 639;
_floodFillParams.box.bottom = 479;
+ adjustRect(_floodFillParams.box);
break;
case 6:
_floodFillParams.y = pop();
@@ -886,6 +887,7 @@ void ScummEngine_v100he::o100_floodFill() {
_floodFillParams.box.right = pop();
_floodFillParams.box.top = pop();
_floodFillParams.box.left = pop();
+ adjustRect(_floodFillParams.box);
break;
case 20:
_floodFillParams.flags = pop();
@@ -1345,6 +1347,7 @@ void ScummEngine_v100he::o100_wizImageOps() {
_wizParams.fillColor = pop();
_wizParams.box2.top = _wizParams.box2.bottom = pop();
_wizParams.box2.left = _wizParams.box2.right = pop();
+ adjustRect(_wizParams.box2);
break;
case 135:
_wizParams.processFlags |= kWPFDstResNum;
@@ -1358,6 +1361,7 @@ void ScummEngine_v100he::o100_wizImageOps() {
_wizParams.box2.right = pop();
_wizParams.box2.top = pop();
_wizParams.box2.left = pop();
+ adjustRect(_wizParams.box2);
break;
case 137:
_wizParams.processFlags |= kWPFFillColor | kWPFClipBox2;
@@ -1365,6 +1369,7 @@ void ScummEngine_v100he::o100_wizImageOps() {
_wizParams.fillColor = pop();
_wizParams.box2.top = _wizParams.box2.bottom = pop();
_wizParams.box2.left = _wizParams.box2.right = pop();
+ adjustRect(_wizParams.box2);
break;
case 138:
_wizParams.processFlags |= kWPFFillColor | kWPFClipBox2;
@@ -1374,6 +1379,7 @@ void ScummEngine_v100he::o100_wizImageOps() {
_wizParams.box2.right = pop();
_wizParams.box2.top = pop();
_wizParams.box2.left = pop();
+ adjustRect(_wizParams.box2);
break;
default:
error("o100_wizImageOps: Unknown case %d", subOp);
@@ -2339,6 +2345,13 @@ void ScummEngine_v100he::o100_writeFile() {
}
void ScummEngine_v100he::o100_debugInput() {
+ // Backyard Baseball 2003 / Basketball / Football 2002
+ // use older o72_debugInput code
+ if (_game.heversion == 101) {
+ ScummEngine_v72he::o72_debugInput();
+ return;
+ }
+
byte subOp = fetchScriptByte();
switch (subOp) {
diff --git a/engines/scumm/he/script_v60he.cpp b/engines/scumm/he/script_v60he.cpp
index dbeee567bf..5e359385b6 100644
--- a/engines/scumm/he/script_v60he.cpp
+++ b/engines/scumm/he/script_v60he.cpp
@@ -124,8 +124,6 @@ int ScummEngine_v60he::convertFilePath(byte *dst, int dstSize) {
} else if (dst[0] == '.' && dst[1] == '/') { // Game Data Path
// The default game data path is set to './' by ScummVM
r = 2;
- } else if (dst[2] == 'b' && dst[5] == 'k') { // Backyard Basketball INI
- r = 13;
} else if (dst[0] == '*' && dst[1] == '/') { // Save Game Path (Windows HE72 - HE100)
// The default save game path is set to '*/' by ScummVM
r = 2;
diff --git a/engines/scumm/he/script_v90he.cpp b/engines/scumm/he/script_v90he.cpp
index 0beebdb7a1..1ea9960a18 100644
--- a/engines/scumm/he/script_v90he.cpp
+++ b/engines/scumm/he/script_v90he.cpp
@@ -244,6 +244,7 @@ void ScummEngine_v90he::o90_wizImageOps() {
_wizParams.box2.right = pop();
_wizParams.box2.top = pop();
_wizParams.box2.left = pop();
+ adjustRect(_wizParams.box2);
break;
case 134: // HE99+
_wizParams.processFlags |= kWPFFillColor | kWPFClipBox2;
@@ -253,6 +254,7 @@ void ScummEngine_v90he::o90_wizImageOps() {
_wizParams.box2.right = pop();
_wizParams.box2.top = pop();
_wizParams.box2.left = pop();
+ adjustRect(_wizParams.box2);
break;
case 135: // HE99+
_wizParams.processFlags |= kWPFFillColor | kWPFClipBox2;
@@ -260,6 +262,7 @@ void ScummEngine_v90he::o90_wizImageOps() {
_wizParams.fillColor = pop();
_wizParams.box2.top = _wizParams.box2.bottom = pop();
_wizParams.box2.left = _wizParams.box2.right = pop();
+ adjustRect(_wizParams.box2);
break;
case 136: // HE99+
_wizParams.processFlags |= kWPFFillColor | kWPFClipBox2;
@@ -267,6 +270,7 @@ void ScummEngine_v90he::o90_wizImageOps() {
_wizParams.fillColor = pop();
_wizParams.box2.top = _wizParams.box2.bottom = pop();
_wizParams.box2.left = _wizParams.box2.right = pop();
+ adjustRect(_wizParams.box2);
break;
case 137: // HE99+
_wizParams.processFlags |= kWPFDstResNum;
@@ -1488,6 +1492,7 @@ void ScummEngine_v90he::o90_floodFill() {
_floodFillParams.box.top = 0;
_floodFillParams.box.right = 639;
_floodFillParams.box.bottom = 479;
+ adjustRect(_floodFillParams.box);
break;
case 65:
_floodFillParams.y = pop();
@@ -1501,6 +1506,7 @@ void ScummEngine_v90he::o90_floodFill() {
_floodFillParams.box.right = pop();
_floodFillParams.box.top = pop();
_floodFillParams.box.left = pop();
+ adjustRect(_floodFillParams.box);
break;
case 255:
floodFill(&_floodFillParams, this);
@@ -1666,7 +1672,7 @@ void ScummEngine_v90he::o90_getPolygonOverlap() {
{
Common::Rect r2;
_sprite->getSpriteBounds(args2[0], false, r2);
- Common::Rect r1(args1[0], args1[1], args1[2], args1[3]);
+ Common::Rect r1(args1[0], args1[1], args1[2] + 1, args1[3] + 1);
if (r2.isValidRect() == false) {
push(0);
break;
@@ -1711,7 +1717,7 @@ void ScummEngine_v90he::o90_getPolygonOverlap() {
{
Common::Rect r2;
_sprite->getSpriteBounds(args2[0], true, r2);
- Common::Rect r1(args1[0], args1[1], args1[2], args1[3]);
+ Common::Rect r1(args1[0], args1[1], args1[2] + 1, args1[3] + 1);
if (r2.isValidRect() == false) {
push(0);
break;
@@ -2373,8 +2379,8 @@ void ScummEngine_v90he::o90_kernelSetFunctions() {
case 2001:
_logicHE->dispatch(args[1], num - 2, (int32 *)&args[2]);
break;
- case 201102:
- // Used in puttzoo iOS
+ case 201102: // Used in puttzoo iOS
+ case 20111014: // Used in spyfox iOS
break;
default:
error("o90_kernelSetFunctions: default case %d (param count %d)", args[0], num);
diff --git a/engines/scumm/he/sound_he.cpp b/engines/scumm/he/sound_he.cpp
index 1007d2a7b0..f94b74ac45 100644
--- a/engines/scumm/he/sound_he.cpp
+++ b/engines/scumm/he/sound_he.cpp
@@ -65,7 +65,7 @@ void SoundHE::addSoundToQueue(int sound, int heOffset, int heChannel, int heFlag
if (_vm->VAR_LAST_SOUND != 0xFF)
_vm->VAR(_vm->VAR_LAST_SOUND) = sound;
- if ((_vm->_game.heversion <= 99 && (heFlags & 16)) || (_vm->_game.heversion == 100 && (heFlags & 8))) {
+ if ((_vm->_game.heversion <= 99 && (heFlags & 16)) || (_vm->_game.heversion >= 100 && (heFlags & 8))) {
playHESound(sound, heOffset, heChannel, heFlags);
return;
} else {
diff --git a/engines/scumm/script.cpp b/engines/scumm/script.cpp
index 39420ee974..d8c4948ea8 100644
--- a/engines/scumm/script.cpp
+++ b/engines/scumm/script.cpp
@@ -250,7 +250,7 @@ void ScummEngine::stopScript(int script) {
if (vm.nest[i].number == script &&
(vm.nest[i].where == WIO_GLOBAL || vm.nest[i].where == WIO_LOCAL)) {
nukeArrays(vm.nest[i].slot);
- vm.nest[i].number = 0xFF;
+ vm.nest[i].number = 0;
vm.nest[i].slot = 0xFF;
vm.nest[i].where = 0xFF;
}
@@ -284,7 +284,7 @@ void ScummEngine::stopObjectScript(int script) {
if (vm.nest[i].number == script &&
(vm.nest[i].where == WIO_ROOM || vm.nest[i].where == WIO_INVENTORY || vm.nest[i].where == WIO_FLOBJECT)) {
nukeArrays(vm.nest[i].slot);
- vm.nest[i].number = 0xFF;
+ vm.nest[i].number = 0;
vm.nest[i].slot = 0xFF;
vm.nest[i].where = 0xFF;
}
@@ -318,7 +318,7 @@ void ScummEngine::runScriptNested(int script) {
nest = &vm.nest[vm.numNestedScripts];
if (_currentScript == 0xFF) {
- nest->number = 0xFF;
+ nest->number = 0;
nest->where = 0xFF;
} else {
// Store information about the currently running script
@@ -338,7 +338,7 @@ void ScummEngine::runScriptNested(int script) {
if (vm.numNestedScripts != 0)
vm.numNestedScripts--;
- if (nest->number != 0xFF) {
+ if (nest->number) {
// Try to resume the script which called us, if its status has not changed
// since it invoked us. In particular, we only resume it if it hasn't been
// stopped in the meantime, and if it did not already move on.
diff --git a/engines/scumm/scumm-md5.h b/engines/scumm/scumm-md5.h
index f719f7df19..0814e3bfe1 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 Mon May 28 18:17:29 2012
+ This file was generated by the md5table tool on Fri Jun 15 09:16:45 2012
DO NOT EDIT MANUALLY!
*/
@@ -174,7 +174,7 @@ static const MD5Table md5table[] = {
{ "3ae7f002d9256b8bdf76aaf8a3a069f8", "freddi", "HE 100", "", 34837, Common::EN_GRB, Common::kPlatformWii },
{ "3af61c5edf8e15b43dbafd285b2e9777", "puttcircus", "", "Demo", -1, Common::HE_ISR, Common::kPlatformWindows },
{ "3b301b7892f883ce42ab4be6a274fea6", "samnmax", "Floppy", "Floppy", -1, Common::EN_ANY, Common::kPlatformPC },
- { "3b832f4a90740bf22e9b8ed42ca0128c", "freddi4", "HE 99", "", -1, Common::EN_GRB, Common::kPlatformWindows },
+ { "3b832f4a90740bf22e9b8ed42ca0128c", "freddi4", "HE 99", "", -1, Common::EN_GRB, Common::kPlatformUnknown },
{ "3c4c471342bd95505a42334367d8f127", "puttmoon", "HE 70", "", 12161, Common::RU_RUS, Common::kPlatformWindows },
{ "3cce1913a3bc586b51a75c3892ff18dd", "indy3", "VGA", "VGA", -1, Common::RU_RUS, Common::kPlatformPC },
{ "3d219e7546039543307b55a91282bf18", "funpack", "", "", -1, Common::EN_ANY, Common::kPlatformPC },
@@ -215,6 +215,7 @@ static const MD5Table md5table[] = {
{ "4dbff3787aedcd96b0b325f2d92d7ad9", "maze", "HE 100", "Updated", -1, Common::EN_USA, Common::kPlatformUnknown },
{ "4dc780f1bc587a193ce8a97652791438", "loom", "EGA", "EGA", -1, Common::EN_ANY, Common::kPlatformAmiga },
{ "4e5867848ee61bc30d157e2c94eee9b4", "PuttTime", "HE 90", "Demo", 18394, Common::EN_USA, Common::kPlatformUnknown },
+ { "4e859d3ef1e146b41e7d93c35cd6cc62", "puttzoo", "HE 100", "Lite", -1, Common::EN_ANY, Common::kPlatformIOS },
{ "4edbf9d03550f7ba01e7f34d69b678dd", "spyfox", "HE 98.5", "Demo", -1, Common::NL_NLD, Common::kPlatformUnknown },
{ "4f04b321a95d4315ce6d65f8e1dd0368", "maze", "HE 80", "", -1, Common::EN_USA, Common::kPlatformUnknown },
{ "4f138ac6f9b2ac5a41bc68b2c3296064", "freddi4", "HE 99", "", -1, Common::FR_FRA, Common::kPlatformWindows },
@@ -226,7 +227,7 @@ static const MD5Table md5table[] = {
{ "4fe6a2e8df3c4536b278fdd2fbcb181e", "pajama3", "", "Mini Game", -1, Common::EN_ANY, Common::kPlatformWindows },
{ "5057fb0e99e5aa29df1836329232f101", "freddi2", "HE 80", "", -1, Common::UNK_LANG, Common::kPlatformWindows },
{ "507bb360688dc4180fdf0d7597352a69", "freddi", "HE 73", "", 26402, Common::SE_SWE, Common::kPlatformWindows },
- { "50b831f11b8c4b83784cf81f4dcc69ea", "spyfox", "HE 100", "", -1, Common::EN_ANY, Common::kPlatformWii },
+ { "50b831f11b8c4b83784cf81f4dcc69ea", "spyfox", "HE 101", "", -1, Common::EN_ANY, Common::kPlatformWii },
{ "50fcdc982a25063b78ad46bf389b8e8d", "tentacle", "Floppy", "Floppy", -1, Common::IT_ITA, Common::kPlatformPC },
{ "51305e929e330e24a75a0351c8f9975e", "freddi2", "HE 99", "Updated", -1, Common::EN_USA, Common::kPlatformUnknown },
{ "513f91a9dbe8d5490b39e56a3ac5bbdf", "pajama2", "HE 98.5", "", -1, Common::NL_NLD, Common::kPlatformUnknown },
@@ -333,7 +334,7 @@ static const MD5Table md5table[] = {
{ "7766c9487f9d53a8cb0edabda5119c3d", "puttputt", "HE 60", "", 8022, Common::EN_ANY, Common::kPlatformPC },
{ "77f5c9cc0986eb729c1a6b4c8823bbae", "zakloom", "FM-TOWNS", "Demo", 7520, Common::EN_ANY, Common::kPlatformFMTowns },
{ "780e4a0ae2ff17dc296f4a79543b44f8", "puttmoon", "", "", -1, Common::UNK_LANG, Common::kPlatformPC },
- { "782393c5934ecd0b536eaf5fd541bd26", "pajama", "HE 100", "Updated", -1, Common::EN_ANY, Common::kPlatformWindows },
+ { "782393c5934ecd0b536eaf5fd541bd26", "pajama", "HE 101", "Updated", -1, Common::EN_ANY, Common::kPlatformWindows },
{ "784b499c98d07260a30952685758636b", "pajama3", "", "Demo", 13911, Common::DE_DEU, Common::kPlatformWindows },
{ "78bd5f036ea35a878b74e4f47941f784", "freddi4", "HE 99", "", -1, Common::RU_RUS, Common::kPlatformWindows },
{ "78c07ca088526d8d4446a4c2cb501203", "freddi3", "HE 99", "", -1, Common::FR_FRA, Common::kPlatformUnknown },
@@ -493,7 +494,7 @@ static const MD5Table md5table[] = {
{ "c0039ad982999c92d0de81910d640fa0", "freddi", "HE 71", "", -1, Common::NL_NLD, Common::kPlatformWindows },
{ "c13225cb1bbd3bc9fe578301696d8021", "monkey", "SEGA", "", -1, Common::EN_ANY, Common::kPlatformSegaCD },
{ "c20848f53c2d48bfacdc840993843765", "freddi2", "HE 80", "Demo", -1, Common::NL_NLD, Common::kPlatformUnknown },
- { "c225bec1b6c0798a2b8c89ac226dc793", "pajama", "HE 100", "", -1, Common::EN_ANY, Common::kPlatformWii },
+ { "c225bec1b6c0798a2b8c89ac226dc793", "pajama", "HE 101", "", -1, Common::EN_ANY, Common::kPlatformWii },
{ "c24c490373aeb48fbd54caa8e7ae376d", "loom", "No AdLib", "EGA", -1, Common::DE_DEU, Common::kPlatformAtariST },
{ "c25755b08a8d0d47695e05f1e2111bfc", "freddi4", "", "Demo", -1, Common::EN_USA, Common::kPlatformUnknown },
{ "c30ef068add4277104243c31ce46c12b", "monkey2", "", "", -1, Common::FR_FRA, Common::kPlatformAmiga },
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index fc46f88df4..d0f46f3e56 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1917,6 +1917,13 @@ void ScummEngine::syncSoundSettings() {
if (VAR_CHARINC != 0xFF)
VAR(VAR_CHARINC) = _defaultTalkDelay;
}
+
+ // Backyard Baseball 2003 uses a unique subtitle variable,
+ // rather than VAR_SUBTITLES
+ if (_game.id == GID_BASEBALL2003) {
+ _scummVars[632] = ConfMan.getBool("subtitles");
+ }
+
}
void ScummEngine::setTalkSpeed(int talkspeed) {
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index cacf8c214e..c8cf096a19 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -241,10 +241,12 @@ enum ScummGameId {
GID_PUTTRACE,
GID_FUNSHOP, // Used for all three funshops
GID_FOOTBALL,
+ GID_FOOTBALL2002,
GID_SOCCER,
GID_SOCCERMLS,
GID_SOCCER2004,
GID_BASEBALL2001,
+ GID_BASEBALL2003,
GID_BASKETBALL,
GID_MOONBASE,
GID_HECUP // CUP demos