Revert last change, was wrong opcode.

Add a few more HE 7 opcodes

svn-id: r14813
This commit is contained in:
Travis Howell 2004-08-28 14:05:33 +00:00
parent 0e203f6ccd
commit b0be0f0452
7 changed files with 68 additions and 68 deletions

View File

@ -928,6 +928,9 @@ static int compareDrawOrder(const void* a, const void* b)
}
void ScummEngine::processActors() {
if (_skipProcessActors)
return;
int numactors = 0;
// TODO : put this actors as a member array. It never has to grow or shrink

View File

@ -623,6 +623,7 @@ protected:
void o7_getActorRoom();
void o7_resourceRoutines();
void o7_quitPauseRestart();
void o7_kernelSetFunctions();
void o7_unknownED();
void o7_stringLen();
void o7_unknownEF();
@ -690,7 +691,6 @@ protected:
void o72_wordArrayIndexedWrite();
void o72_compareStackList();
void o72_unknown1C();
void o72_unknown26();
void o72_unknown50();
void o72_wordArrayInc();
void o72_objectX();
@ -704,6 +704,7 @@ protected:
void o72_unknown62();
void o72_getArrayDimSize();
void o72_getNumFreeArrays();
void o72_pickupObject();
void o72_arrayOps();
void o72_dimArray();
void o72_dim2dimArray();

View File

@ -778,16 +778,6 @@ void ScummEngine_v6he::o6_kernelSetFunctions() {
case 5:
//Used before mini games in 3DO versions, seems safe to ignore.
break;
case 21:
_skipDrawObject = 1;
break;
case 22:
_skipDrawObject = 0;
break;
case 23:
_charset->clearCharsetMask();
_fullRedraw = 1;
break;
default:
warning("o6_kernelSetFunctions: default case %d (param count %d)", args[0], num);
break;

View File

@ -93,7 +93,7 @@ void ScummEngine_v72he::setupOpcodes() {
/* 24 */
OPCODE(o6_invalid),
OPCODE(o6_invalid),
OPCODE(o72_unknown26),
OPCODE(o6_invalid),
OPCODE(o6_invalid),
/* 28 */
OPCODE(o6_invalid),
@ -211,7 +211,7 @@ void ScummEngine_v72he::setupOpcodes() {
OPCODE(o6_animateActor),
OPCODE(o6_doSentence),
/* 84 */
OPCODE(o7_pickupObject),
OPCODE(o72_pickupObject),
OPCODE(o6_loadRoomWithEgo),
OPCODE(o6_invalid),
OPCODE(o6_getRandomNumber),
@ -297,7 +297,7 @@ void ScummEngine_v72he::setupOpcodes() {
OPCODE(o6_distPtPt),
/* C8 */
OPCODE(o6_kernelGetFunctions),
OPCODE(o6_kernelSetFunctions),
OPCODE(o7_kernelSetFunctions),
OPCODE(o6_delayFrames),
OPCODE(o6_pickOneOf),
/* CC */
@ -563,8 +563,11 @@ void ScummEngine_v72he::o72_compareStackList() {
}
void ScummEngine_v72he::o72_unknown1C() {
// For Pajame Sam 2
// Maybe HE 7.3?
// HE 90+ specific
if (_heversion < 90)
error("Invalid opcode '%x' at %x", _opcode, _scriptPointer - _scriptOrgPointer);
// For Pajame Sam 2 demo
// Incomplete
int value = fetchScriptByte();
value -= 46;
@ -580,55 +583,6 @@ void ScummEngine_v72he::o72_unknown1C() {
warning("o72_unknown1C stub (%d)", value);
}
void ScummEngine_v72he::o72_unknown26() {
// Maybe HE 7.3?
// Incomplete
int args[16];
int subOp = fetchScriptByte();
switch (subOp) {
case 30:
case 31:
case 32:
case 33:
case 34:
case 35:
case 36:
case 37:
case 38:
case 39:
case 43:
case 52:
case 63:
case 68:
case 82:
case 92:
case 97:
case 98:
case 124:
pop();
break;
case 42:
case 198:
pop();
pop();
break;
case 45:
pop();
pop();
pop();
break;
case 125:
getStackList(args, ARRAYSIZE(args));
pop();
break;
default:
error("o72_unknown26: Unknown case %d", subOp);
}
push(0);
warning("o72_unknown26 stub (%d)", subOp);
}
void ScummEngine_v72he::o72_wordArrayWrite() {
int a = pop();
writeArray(fetchScriptWord(), 0, pop(), a);
@ -815,6 +769,19 @@ void ScummEngine_v72he::o72_getNumFreeArrays() {
push (num);
}
void ScummEngine_v72he::o72_pickupObject() {
int obj, room;
room = pop();
obj = pop();
if (room == 0)
room = getObjectRoom(obj);
addObjectToInventory(obj, room);
putOwner(obj, VAR(VAR_EGO));
runInventoryScript(obj);
}
void ScummEngine_v72he::o72_arrayOps() {
byte subOp = fetchScriptByte();
int array = 0;

View File

@ -297,7 +297,7 @@ void ScummEngine_v7he::setupOpcodes() {
OPCODE(o6_distPtPt),
/* C8 */
OPCODE(o6_kernelGetFunctions),
OPCODE(o6_kernelSetFunctions),
OPCODE(o7_kernelSetFunctions),
OPCODE(o6_delayFrames),
OPCODE(o6_pickOneOf),
/* CC */
@ -538,7 +538,6 @@ void ScummEngine_v7he::o7_pickupObject() {
runInventoryScript(obj); /* Difference */
}
void ScummEngine_v7he::o7_getActorRoom() {
int act = pop();
@ -720,6 +719,45 @@ void ScummEngine_v7he::o7_unknownED() {
warning("stub o7_unknownED (%d, %d, %d)", c, b, a);
}
void ScummEngine_v7he::o7_kernelSetFunctions() {
int args[29];
int num;
num = getStackList(args, ARRAYSIZE(args));
switch (args[0]) {
case 1:
// Used to restore images when decorating cake in
// Fatty Bear's Birthday Surprise
virtScreenLoad(args[1], args[2], args[3], args[4], args[5]);
break;
case 20:
// Clear/stop unknown animation queue
break;
case 21:
_skipDrawObject = 1;
break;
case 22:
_skipDrawObject = 0;
break;
case 23:
_charset->clearCharsetMask();
_fullRedraw = 1;
break;
case 24:
_skipProcessActors = 1;
_fullRedraw = 1;
break;
case 25:
_skipProcessActors = 0;
_fullRedraw = 1;
break;
default:
error("o6_kernelSetFunctions: default case %d (param count %d)", args[0], num);
break;
}
}
void ScummEngine_v7he::o7_stringLen() {
int id, len;
byte *addr;

View File

@ -654,6 +654,7 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS
_V1_talkingActor = 0;
_skipDrawObject = 0;
_skipProcessActors = 0;
_heSndSoundId = 0;
_heSndOffset = 0;
_heSndTimer = 0;

View File

@ -1044,7 +1044,7 @@ public:
byte _roomPalette[256];
byte *_shadowPalette;
int _heSndSoundFreq, _heSndOffset, _heSndTimer, _heSndSoundId, _heSndLoop;
bool _skipDrawObject;
bool _skipDrawObject, _skipProcessActors;
int _timers[4];
protected: