SCUMM HE: Moved remnants of Moonabse to HE100

This commit is contained in:
Eugene Sandulenko 2016-05-26 21:53:23 +02:00
parent 36526cb27b
commit dcc388cbaa
9 changed files with 45 additions and 34 deletions

View File

@ -454,9 +454,6 @@ protected:
MoviePlayer *_moviePlay;
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 {

View File

@ -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);
}

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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) {

View File

@ -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);

View File

@ -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);

View File

@ -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;