diff options
author | Matthew Hoops | 2012-06-08 19:45:31 -0400 |
---|---|---|
committer | Matthew Hoops | 2012-06-08 19:45:31 -0400 |
commit | f22661e4b931609609fb785b503c1e534bfe14d7 (patch) | |
tree | 0815485af02ecc179fbe68a09fe337323eb7a4fc | |
parent | c735b2acda10dcf2225a38cb50a69c840b6662bc (diff) | |
download | scummvm-rg350-f22661e4b931609609fb785b503c1e534bfe14d7.tar.gz scummvm-rg350-f22661e4b931609609fb785b503c1e534bfe14d7.tar.bz2 scummvm-rg350-f22661e4b931609609fb785b503c1e534bfe14d7.zip |
SCUMM: Stub off other football2002 u32 opcodes
-rw-r--r-- | engines/scumm/detection_tables.h | 2 | ||||
-rw-r--r-- | engines/scumm/he/logic/football.cpp | 100 | ||||
-rw-r--r-- | engines/scumm/he/logic_he.cpp | 3 | ||||
-rw-r--r-- | engines/scumm/he/logic_he.h | 1 | ||||
-rw-r--r-- | engines/scumm/scumm.h | 1 |
5 files changed, 94 insertions, 13 deletions
diff --git a/engines/scumm/detection_tables.h b/engines/scumm/detection_tables.h index 452a6f0960..c84681e266 100644 --- a/engines/scumm/detection_tables.h +++ b/engines/scumm/detection_tables.h @@ -384,7 +384,7 @@ static const GameSettings gameVariantsTable[] = { // Added the use of bink videos {"Baseball2003", 0, 0, GID_BASEBALL2003, 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)}, + {"football2002", 0, 0, GID_FOOTBALL2002, 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 diff --git a/engines/scumm/he/logic/football.cpp b/engines/scumm/he/logic/football.cpp index 87efd7cfb2..73f9161d95 100644 --- a/engines/scumm/he/logic/football.cpp +++ b/engines/scumm/he/logic/football.cpp @@ -35,17 +35,16 @@ public: LogicHEfootball(ScummEngine_v90he *vm) : LogicHE(vm) {} int versionID(); - int32 dispatch(int op, int numArgs, int32 *args); + virtual int32 dispatch(int op, int numArgs, int32 *args); -private: +protected: int lineEquation3D(int32 *args); - int translateWorldToScreen(int32 *args); + virtual int translateWorldToScreen(int32 *args); int fieldGoalScreenTranslation(int32 *args); - int translateScreenToWorld(int32 *args); + virtual int translateScreenToWorld(int32 *args); int nextPoint(int32 *args); int computePlayerBallIntercepts(int32 *args); int computeTwoCircleIntercepts(int32 *args); - int largestFreeBlock(); }; int LogicHEfootball::versionID() { @@ -84,11 +83,6 @@ int32 LogicHEfootball::dispatch(int op, int numArgs, int32 *args) { res = computeTwoCircleIntercepts(args); break; - case 1028: - // Backyard Football 2002 only - res = largestFreeBlock(); - break; - case 8221968: // Someone had a fun and used his birthday as opcode number res = getFromArray(args[0], args[1], args[2]); @@ -288,8 +282,86 @@ int LogicHEfootball::computeTwoCircleIntercepts(int32 *args) { return 1; } -int LogicHEfootball::largestFreeBlock() { - // Backyard Football 2002 only +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) { + // TODO: Get list of playbook files + error("STUB: LogicHEfootball2002::getPlaybookFiles()"); + 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); @@ -300,4 +372,8 @@ 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/scumm.h b/engines/scumm/scumm.h index 8c0070b5f5..c8cf096a19 100644 --- a/engines/scumm/scumm.h +++ b/engines/scumm/scumm.h @@ -241,6 +241,7 @@ enum ScummGameId { GID_PUTTRACE, GID_FUNSHOP, // Used for all three funshops GID_FOOTBALL, + GID_FOOTBALL2002, GID_SOCCER, GID_SOCCERMLS, GID_SOCCER2004, |