diff options
author | Eugene Sandulenko | 2016-05-26 21:53:23 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-05-26 21:53:23 +0200 |
commit | dcc388cbaa84909e2974738685618e696f95c952 (patch) | |
tree | 8f344aeebca2b581961ef46dfc4bc5da6782255b /engines | |
parent | 36526cb27baa79ce50d16158a904eae96453693e (diff) | |
download | scummvm-rg350-dcc388cbaa84909e2974738685618e696f95c952.tar.gz scummvm-rg350-dcc388cbaa84909e2974738685618e696f95c952.tar.bz2 scummvm-rg350-dcc388cbaa84909e2974738685618e696f95c952.zip |
SCUMM HE: Moved remnants of Moonabse to HE100
Diffstat (limited to 'engines')
-rw-r--r-- | engines/scumm/he/intern_he.h | 26 | ||||
-rw-r--r-- | engines/scumm/he/logic/moonbase_logic.cpp | 29 | ||||
-rw-r--r-- | engines/scumm/he/logic_he.cpp | 2 | ||||
-rw-r--r-- | engines/scumm/he/logic_he.h | 2 | ||||
-rw-r--r-- | engines/scumm/he/moonbase/ai_main.h | 6 | ||||
-rw-r--r-- | engines/scumm/he/wiz_he.cpp | 6 | ||||
-rw-r--r-- | engines/scumm/scumm.h | 2 | ||||
-rw-r--r-- | engines/scumm/scumm_v2.h | 1 | ||||
-rw-r--r-- | engines/scumm/vars.cpp | 5 |
9 files changed, 45 insertions, 34 deletions
diff --git a/engines/scumm/he/intern_he.h b/engines/scumm/he/intern_he.h index cce76319f8..7f7babc604 100644 --- a/engines/scumm/he/intern_he.h +++ b/engines/scumm/he/intern_he.h @@ -455,9 +455,6 @@ protected: Sprite *_sprite; public: - Moonbase *_moonbase; - -public: ScummEngine_v90he(OSystem *syst, const DetectorResult &dr); ~ScummEngine_v90he(); @@ -553,15 +550,8 @@ protected: byte VAR_NUM_PALETTES; byte VAR_NUM_UNK; -public: // FIXME. TODO. Should be protected. Used by Moonbase byte VAR_U32_VERSION; byte VAR_U32_ARRAY_UNK; - byte VAR_U32_USER_VAR_A; - byte VAR_U32_USER_VAR_B; - byte VAR_U32_USER_VAR_C; - byte VAR_U32_USER_VAR_D; - byte VAR_U32_USER_VAR_E; - byte VAR_U32_USER_VAR_F; }; class ScummEngine_v99he : public ScummEngine_v90he { @@ -585,17 +575,25 @@ protected: }; class ScummEngine_v100he : public ScummEngine_v99he { +friend class AI; + protected: ResType _heResType; int32 _heResId; byte _debugInputBuffer[256]; + +public: + Moonbase *_moonbase; + public: ScummEngine_v100he(OSystem *syst, const DetectorResult &dr); ~ScummEngine_v100he(); virtual void resetScumm(); + virtual void setupScummVars(); + protected: virtual void setupOpcodes(); @@ -641,6 +639,14 @@ protected: void o100_getSpriteInfo(); void o100_getWizData(); void o100_getVideoData(); + +protected: + byte VAR_U32_USER_VAR_A; + byte VAR_U32_USER_VAR_B; + byte VAR_U32_USER_VAR_C; + byte VAR_U32_USER_VAR_D; + byte VAR_U32_USER_VAR_E; + byte VAR_U32_USER_VAR_F; }; class ScummEngine_vCUPhe : public Engine { diff --git a/engines/scumm/he/logic/moonbase_logic.cpp b/engines/scumm/he/logic/moonbase_logic.cpp index ce5009f72e..9d9561abd1 100644 --- a/engines/scumm/he/logic/moonbase_logic.cpp +++ b/engines/scumm/he/logic/moonbase_logic.cpp @@ -33,7 +33,7 @@ namespace Scumm { */ class LogicHEmoonbase : public LogicHE { public: - LogicHEmoonbase(ScummEngine_v90he *vm) : LogicHE(vm) {} + LogicHEmoonbase(ScummEngine_v100he *vm) : LogicHE(vm) { _vm1 = vm; } int versionID(); @@ -53,12 +53,15 @@ private: void op_ai_reset(int op, int numArgs, int32 *args); void op_ai_set_type(int op, int numArgs, int32 *args); void op_ai_clean_up(int op, int numArgs, int32 *args); + +private: + ScummEngine_v100he *_vm1; }; int LogicHEmoonbase::versionID() { - if (_vm->_game.features & GF_DEMO) + if (_vm1->_game.features & GF_DEMO) return -100; - else if (strcmp(_vm->_game.variant, "1.1") == 0) + else if (strcmp(_vm1->_game.variant, "1.1") == 0) return 110; else return 100; @@ -184,9 +187,9 @@ void LogicHEmoonbase::op_dos_command(int op, int numArgs, int32 *args) { void LogicHEmoonbase::op_set_fow_sentinel(int32 *args) { debug(2, "op_set_fow_sentinel(%d, %d, %d)", args[0], args[1], args[2]); - _vm->_moonbase->_fowSentinelImage = args[0]; - _vm->_moonbase->_fowSentinelState = args[1]; - _vm->_moonbase->_fowSentinelConditionBits = args[2]; + _vm1->_moonbase->_fowSentinelImage = args[0]; + _vm1->_moonbase->_fowSentinelState = args[1]; + _vm1->_moonbase->_fowSentinelConditionBits = args[2]; } void LogicHEmoonbase::op_set_fow_information(int op, int numArgs, int32 *args) { @@ -200,7 +203,7 @@ void LogicHEmoonbase::op_set_fow_information(int op, int numArgs, int32 *args) { debug(2, "%s", str.c_str()); - _vm->_moonbase->setFOWInfo( + _vm1->_moonbase->setFOWInfo( args[0], // array args[1], // array down dimension args[2], // array across dimension @@ -217,7 +220,7 @@ void LogicHEmoonbase::op_set_fow_information(int op, int numArgs, int32 *args) { int LogicHEmoonbase::op_set_fow_image(int op, int numArgs, int32 *args) { debug(2, "op_set_fow_image(%d)", args[0]); - return _vm->_moonbase->setFOWImage(args[0]) ? 1 : 0; + return _vm1->_moonbase->setFOWImage(args[0]) ? 1 : 0; } void LogicHEmoonbase::op_ai_test_kludge(int op, int numArgs, int32 *args) { @@ -227,25 +230,25 @@ void LogicHEmoonbase::op_ai_test_kludge(int op, int numArgs, int32 *args) { int LogicHEmoonbase::op_ai_master_control_program(int op, int numArgs, int32 *args) { warning("op_ai_master_control_program()"); - return _vm->_moonbase->_ai->masterControlProgram(numArgs, args); + return _vm1->_moonbase->_ai->masterControlProgram(numArgs, args); } void LogicHEmoonbase::op_ai_reset(int op, int numArgs, int32 *args) { warning("op_ai_reset())"); - _vm->_moonbase->_ai->resetAI(); + _vm1->_moonbase->_ai->resetAI(); } void LogicHEmoonbase::op_ai_set_type(int op, int numArgs, int32 *args) { warning("op_ai_set_type()"); - _vm->_moonbase->_ai->setAIType(numArgs, args); + _vm1->_moonbase->_ai->setAIType(numArgs, args); } void LogicHEmoonbase::op_ai_clean_up(int op, int numArgs, int32 *args) { warning("op_ai_clean_up()"); - _vm->_moonbase->_ai->cleanUpAI(); + _vm1->_moonbase->_ai->cleanUpAI(); } -LogicHE *makeLogicHEmoonbase(ScummEngine_v90he *vm) { +LogicHE *makeLogicHEmoonbase(ScummEngine_v100he *vm) { return new LogicHEmoonbase(vm); } diff --git a/engines/scumm/he/logic_he.cpp b/engines/scumm/he/logic_he.cpp index 366cd3be26..33f5c40464 100644 --- a/engines/scumm/he/logic_he.cpp +++ b/engines/scumm/he/logic_he.cpp @@ -102,7 +102,7 @@ LogicHE *LogicHE::makeLogicHE(ScummEngine_v90he *vm) { return makeLogicHEbasketball(vm); case GID_MOONBASE: - return makeLogicHEmoonbase(vm); + return makeLogicHEmoonbase((ScummEngine_v100he *)vm); default: return new LogicHE(vm); diff --git a/engines/scumm/he/logic_he.h b/engines/scumm/he/logic_he.h index cd547f1616..5002ee9434 100644 --- a/engines/scumm/he/logic_he.h +++ b/engines/scumm/he/logic_he.h @@ -65,7 +65,7 @@ LogicHE *makeLogicHEfootball2002(ScummEngine_v90he *vm); LogicHE *makeLogicHEsoccer(ScummEngine_v90he *vm); LogicHE *makeLogicHEbaseball2001(ScummEngine_v90he *vm); LogicHE *makeLogicHEbasketball(ScummEngine_v90he *vm); -LogicHE *makeLogicHEmoonbase(ScummEngine_v90he *vm); +LogicHE *makeLogicHEmoonbase(ScummEngine_v100he *vm); } // End of namespace Scumm diff --git a/engines/scumm/he/moonbase/ai_main.h b/engines/scumm/he/moonbase/ai_main.h index 619ff1610a..b750ed0e21 100644 --- a/engines/scumm/he/moonbase/ai_main.h +++ b/engines/scumm/he/moonbase/ai_main.h @@ -28,7 +28,7 @@ namespace Scumm { -class ScummEngine_v90he; +class ScummEngine_v100he; enum { TERRAIN_TYPE_GOOD = 0, @@ -83,7 +83,7 @@ enum { class AI { public: - AI(ScummEngine_v90he *vm) : _vm(vm) {} + AI(ScummEngine_v100he *vm) : _vm(vm) {} void resetAI(); void cleanUpAI(); @@ -191,7 +191,7 @@ public: Common::Array<int> lastXCoord[5]; Common::Array<int> lastYCoord[5]; - ScummEngine_v90he *_vm; + ScummEngine_v100he *_vm; }; } // End of namespace Scumm diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp index 0ebfe67245..428960f673 100644 --- a/engines/scumm/he/wiz_he.cpp +++ b/engines/scumm/he/wiz_he.cpp @@ -1573,8 +1573,8 @@ uint8 *Wiz::drawWizImage(int resNum, int state, int maskNum, int maskState, int } if (_vm->_game.id == GID_MOONBASE && - ((ScummEngine_v90he *)_vm)->_moonbase->isFOW(resNum, state, conditionBits)) { - ((ScummEngine_v90he *)_vm)->_moonbase->renderFOW(dst, dstPitch, dstType, cw, ch, flags); + ((ScummEngine_v100he *)_vm)->_moonbase->isFOW(resNum, state, conditionBits)) { + ((ScummEngine_v100he *)_vm)->_moonbase->renderFOW(dst, dstPitch, dstType, cw, ch, flags); x1 = 0; y1 = 0; width = rScreen.width(); @@ -1814,7 +1814,7 @@ void Wiz::copy555WizImage(uint8 *dst, uint8 *wizd, int dstPitch, int dstType, uint32 compID = READ_LE_UINT32(wizd); if (compID == 0x12340102) { - ((ScummEngine_v90he *)_vm)->_moonbase->blitT14WizImage(dst, dstw, dsth, dstPitch, clipBox, wizd, srcx, srcy, rawROP, paramROP); + ((ScummEngine_v100he *)_vm)->_moonbase->blitT14WizImage(dst, dstw, dsth, dstPitch, clipBox, wizd, srcx, srcy, rawROP, paramROP); } else if (compID == 0x12340802) { warning("Distorion codec"); } else if (compID == 0x12340902) { diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h index a3fa329728..f9758aec33 100644 --- a/engines/scumm/scumm.h +++ b/engines/scumm/scumm.h @@ -700,8 +700,6 @@ protected: void ignoreScriptWord() { fetchScriptWord(); } void ignoreScriptByte() { fetchScriptByte(); } void push(int a); - -public: // TODO. FIXME should be protected. Used by Moonbase int pop(); virtual int readVar(uint var); virtual void writeVar(uint var, int value); diff --git a/engines/scumm/scumm_v2.h b/engines/scumm/scumm_v2.h index 763bbc061c..2a9e7a96e6 100644 --- a/engines/scumm/scumm_v2.h +++ b/engines/scumm/scumm_v2.h @@ -78,7 +78,6 @@ protected: void getResultPosIndirect(); virtual void getResultPos(); -public: // TODO. FIXME. Should be protected. Used by Moonbase virtual int readVar(uint var); virtual void writeVar(uint var, int value); diff --git a/engines/scumm/vars.cpp b/engines/scumm/vars.cpp index 5254aa4af2..e5ba4a68ee 100644 --- a/engines/scumm/vars.cpp +++ b/engines/scumm/vars.cpp @@ -340,6 +340,11 @@ void ScummEngine_v90he::setupScummVars() { VAR_NUM_PALETTES = 130; VAR_NUM_UNK = 131; } +} + +void ScummEngine_v100he::setupScummVars() { + ScummEngine_v90he::setupScummVars(); + if (_game.id == GID_MOONBASE) { VAR_U32_USER_VAR_A = 108; VAR_U32_USER_VAR_B = 109; |