Add more opcode differences in C64 maniac.
svn-id: r18187
This commit is contained in:
parent
d5f4a56e11
commit
feca9840b8
2 changed files with 108 additions and 33 deletions
|
@ -403,31 +403,38 @@ protected:
|
||||||
virtual void clearStateCommon(byte type);
|
virtual void clearStateCommon(byte type);
|
||||||
|
|
||||||
/* Version 2 script opcodes */
|
/* Version 2 script opcodes */
|
||||||
void o_unknown13();
|
void o_isGreaterEqual();
|
||||||
void o_loadActor();
|
void o_stopScript();
|
||||||
|
void o_getDist();
|
||||||
|
void o_isNotEqual();
|
||||||
void o_loadSound();
|
void o_loadSound();
|
||||||
|
void o_putActorAtObject();
|
||||||
|
void o_unfreezeScripts();
|
||||||
|
void o_unknown13();
|
||||||
|
void o_clearState08();
|
||||||
void o_move();
|
void o_move();
|
||||||
|
void o_loadActor();
|
||||||
|
void o_freezeScript();
|
||||||
|
void o_walkActorToObject();
|
||||||
|
void o_isLessEqual();
|
||||||
|
void o_subtract();
|
||||||
|
void o_isLess();
|
||||||
|
void o_increment();
|
||||||
void o_isEqual();
|
void o_isEqual();
|
||||||
void o_loadRoom();
|
void o_loadRoom();
|
||||||
void o_unknown4D();
|
|
||||||
void o_loadScript();
|
void o_loadScript();
|
||||||
|
void o_unknown4D();
|
||||||
void o_unknown53();
|
void o_unknown53();
|
||||||
|
void o_add();
|
||||||
void o_cursorCommand();
|
void o_cursorCommand();
|
||||||
void o_lights();
|
void o_lights();
|
||||||
void o_getObjectOwner();
|
void o_getObjectOwner();
|
||||||
void o_add();
|
|
||||||
void o_subtract();
|
|
||||||
void o_isNotEqual();
|
|
||||||
void o_isGreater();
|
void o_isGreater();
|
||||||
void o_isGreaterEqual();
|
void o_pickupObject();
|
||||||
void o_isLess();
|
|
||||||
void o_isLessEqual();
|
|
||||||
void o_unknown93();
|
void o_unknown93();
|
||||||
void o_freezeScript();
|
void o_setState08();
|
||||||
void o_unfreezeScript();
|
void o_unfreezeScript();
|
||||||
void o_getDist();
|
void o_decrement();
|
||||||
void o_putActorAtObject();
|
|
||||||
void o_walkActorToObject();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class ScummEngine_v6 : public ScummEngine {
|
class ScummEngine_v6 : public ScummEngine {
|
||||||
|
|
|
@ -42,7 +42,7 @@ void ScummEngine_c64::setupOpcodes() {
|
||||||
OPCODE(o5_getActorRoom),
|
OPCODE(o5_getActorRoom),
|
||||||
/* 04 */
|
/* 04 */
|
||||||
OPCODE(o_isGreaterEqual),
|
OPCODE(o_isGreaterEqual),
|
||||||
OPCODE(o2_drawObject),
|
OPCODE(o_stopScript),
|
||||||
OPCODE(o_getDist),
|
OPCODE(o_getDist),
|
||||||
OPCODE(o5_getActorRoom),
|
OPCODE(o5_getActorRoom),
|
||||||
/* 08 */
|
/* 08 */
|
||||||
|
@ -56,7 +56,7 @@ void ScummEngine_c64::setupOpcodes() {
|
||||||
OPCODE(o_putActorAtObject),
|
OPCODE(o_putActorAtObject),
|
||||||
OPCODE(o2_ifNotState08),
|
OPCODE(o2_ifNotState08),
|
||||||
/* 10 */
|
/* 10 */
|
||||||
OPCODE(o5_breakHere),
|
OPCODE(o_unfreezeScripts),
|
||||||
OPCODE(o2_animateActor),
|
OPCODE(o2_animateActor),
|
||||||
OPCODE(o2_panCameraTo),
|
OPCODE(o2_panCameraTo),
|
||||||
OPCODE(o_unknown13),
|
OPCODE(o_unknown13),
|
||||||
|
@ -64,7 +64,7 @@ void ScummEngine_c64::setupOpcodes() {
|
||||||
OPCODE(o5_print),
|
OPCODE(o5_print),
|
||||||
OPCODE(o2_actorFromPos),
|
OPCODE(o2_actorFromPos),
|
||||||
OPCODE(o5_getRandomNr),
|
OPCODE(o5_getRandomNr),
|
||||||
OPCODE(o2_clearState02),
|
OPCODE(o_clearState08),
|
||||||
/* 18 */
|
/* 18 */
|
||||||
OPCODE(o5_jumpRelative),
|
OPCODE(o5_jumpRelative),
|
||||||
OPCODE(o2_doSentence),
|
OPCODE(o2_doSentence),
|
||||||
|
@ -114,7 +114,7 @@ void ScummEngine_c64::setupOpcodes() {
|
||||||
OPCODE(o5_stopSound),
|
OPCODE(o5_stopSound),
|
||||||
OPCODE(o2_setActorElevation),
|
OPCODE(o2_setActorElevation),
|
||||||
OPCODE(o2_walkActorTo),
|
OPCODE(o2_walkActorTo),
|
||||||
OPCODE(o2_ifNotState01),
|
OPCODE(o2_ifState02),
|
||||||
/* 40 */
|
/* 40 */
|
||||||
OPCODE(o2_cutscene),
|
OPCODE(o2_cutscene),
|
||||||
OPCODE(o2_putActor),
|
OPCODE(o2_putActor),
|
||||||
|
@ -123,7 +123,7 @@ void ScummEngine_c64::setupOpcodes() {
|
||||||
/* 44 */
|
/* 44 */
|
||||||
OPCODE(o_isLess),
|
OPCODE(o_isLess),
|
||||||
OPCODE(o2_drawObject),
|
OPCODE(o2_drawObject),
|
||||||
OPCODE(o5_increment),
|
OPCODE(o_increment),
|
||||||
OPCODE(o2_getActorX),
|
OPCODE(o2_getActorX),
|
||||||
/* 48 */
|
/* 48 */
|
||||||
OPCODE(o_isEqual),
|
OPCODE(o_isEqual),
|
||||||
|
@ -144,21 +144,21 @@ void ScummEngine_c64::setupOpcodes() {
|
||||||
OPCODE(o5_setObjectName),
|
OPCODE(o5_setObjectName),
|
||||||
OPCODE(o2_actorFromPos),
|
OPCODE(o2_actorFromPos),
|
||||||
OPCODE(o5_getActorMoving),
|
OPCODE(o5_getActorMoving),
|
||||||
OPCODE(o2_setState02),
|
OPCODE(o_clearState08),
|
||||||
/* 58 */
|
/* 58 */
|
||||||
OPCODE(o2_beginOverride),
|
OPCODE(o2_beginOverride),
|
||||||
OPCODE(o2_doSentence),
|
OPCODE(o2_doSentence),
|
||||||
OPCODE(o_add),
|
OPCODE(o_add),
|
||||||
OPCODE(o2_setBitVar),
|
OPCODE(o2_setBitVar),
|
||||||
/* 5C */
|
/* 5C */
|
||||||
OPCODE(o2_dummy),
|
OPCODE(o5_startSound),
|
||||||
OPCODE(o2_ifClassOfIs),
|
OPCODE(o2_ifClassOfIs),
|
||||||
OPCODE(o2_walkActorTo),
|
OPCODE(o2_walkActorTo),
|
||||||
OPCODE(o2_ifNotState02),
|
OPCODE(o2_ifNotState02),
|
||||||
/* 60 */
|
/* 60 */
|
||||||
OPCODE(o_cursorCommand),
|
OPCODE(o_cursorCommand),
|
||||||
OPCODE(o2_putActor),
|
OPCODE(o2_putActor),
|
||||||
OPCODE(o2_stopScript),
|
OPCODE(o_stopScript),
|
||||||
OPCODE(o5_getActorFacing),
|
OPCODE(o5_getActorFacing),
|
||||||
/* 64 */
|
/* 64 */
|
||||||
OPCODE(o2_loadRoomWithEgo),
|
OPCODE(o2_loadRoomWithEgo),
|
||||||
|
@ -216,7 +216,7 @@ void ScummEngine_c64::setupOpcodes() {
|
||||||
OPCODE(o_putActorAtObject),
|
OPCODE(o_putActorAtObject),
|
||||||
OPCODE(o2_ifNotState08),
|
OPCODE(o2_ifNotState08),
|
||||||
/* 90 */
|
/* 90 */
|
||||||
OPCODE(o5_getObjectOwner),
|
OPCODE(o_pickupObject),
|
||||||
OPCODE(o2_animateActor),
|
OPCODE(o2_animateActor),
|
||||||
OPCODE(o2_panCameraTo),
|
OPCODE(o2_panCameraTo),
|
||||||
OPCODE(o_unknown93),
|
OPCODE(o_unknown93),
|
||||||
|
@ -224,7 +224,7 @@ void ScummEngine_c64::setupOpcodes() {
|
||||||
OPCODE(o5_print),
|
OPCODE(o5_print),
|
||||||
OPCODE(o2_actorFromPos),
|
OPCODE(o2_actorFromPos),
|
||||||
OPCODE(o5_getRandomNr),
|
OPCODE(o5_getRandomNr),
|
||||||
OPCODE(o2_clearState02),
|
OPCODE(o_setState08),
|
||||||
/* 98 */
|
/* 98 */
|
||||||
OPCODE(o2_restart),
|
OPCODE(o2_restart),
|
||||||
OPCODE(o2_doSentence),
|
OPCODE(o2_doSentence),
|
||||||
|
@ -234,7 +234,7 @@ void ScummEngine_c64::setupOpcodes() {
|
||||||
OPCODE(o5_startSound),
|
OPCODE(o5_startSound),
|
||||||
OPCODE(o2_ifClassOfIs),
|
OPCODE(o2_ifClassOfIs),
|
||||||
OPCODE(o2_walkActorTo),
|
OPCODE(o2_walkActorTo),
|
||||||
OPCODE(o2_ifState02),
|
OPCODE(o2_ifNotState04),
|
||||||
/* A0 */
|
/* A0 */
|
||||||
OPCODE(o5_stopObjectCode),
|
OPCODE(o5_stopObjectCode),
|
||||||
OPCODE(o2_putActor),
|
OPCODE(o2_putActor),
|
||||||
|
@ -242,7 +242,7 @@ void ScummEngine_c64::setupOpcodes() {
|
||||||
OPCODE(o2_getActorY),
|
OPCODE(o2_getActorY),
|
||||||
/* A4 */
|
/* A4 */
|
||||||
OPCODE(o2_loadRoomWithEgo),
|
OPCODE(o2_loadRoomWithEgo),
|
||||||
OPCODE(o2_drawObject),
|
OPCODE(o5_loadRoom),
|
||||||
OPCODE(o5_setVarRange),
|
OPCODE(o5_setVarRange),
|
||||||
OPCODE(o2_getActorY),
|
OPCODE(o2_getActorY),
|
||||||
/* A8 */
|
/* A8 */
|
||||||
|
@ -254,7 +254,7 @@ void ScummEngine_c64::setupOpcodes() {
|
||||||
OPCODE(o2_drawSentence),
|
OPCODE(o2_drawSentence),
|
||||||
OPCODE(o5_putActorInRoom),
|
OPCODE(o5_putActorInRoom),
|
||||||
OPCODE(o2_waitForMessage),
|
OPCODE(o2_waitForMessage),
|
||||||
OPCODE(o2_ifNotState04),
|
OPCODE(o2_ifNotState08),
|
||||||
/* B0 */
|
/* B0 */
|
||||||
OPCODE(o_loadActor),
|
OPCODE(o_loadActor),
|
||||||
OPCODE(o2_getBitVar),
|
OPCODE(o2_getBitVar),
|
||||||
|
@ -264,7 +264,7 @@ void ScummEngine_c64::setupOpcodes() {
|
||||||
OPCODE(o_getDist),
|
OPCODE(o_getDist),
|
||||||
OPCODE(o2_findObject),
|
OPCODE(o2_findObject),
|
||||||
OPCODE(o_walkActorToObject),
|
OPCODE(o_walkActorToObject),
|
||||||
OPCODE(o2_setState01),
|
OPCODE(o2_setState04),
|
||||||
/* B8 */
|
/* B8 */
|
||||||
OPCODE(o_isLessEqual),
|
OPCODE(o_isLessEqual),
|
||||||
OPCODE(o2_doSentence),
|
OPCODE(o2_doSentence),
|
||||||
|
@ -283,7 +283,7 @@ void ScummEngine_c64::setupOpcodes() {
|
||||||
/* C4 */
|
/* C4 */
|
||||||
OPCODE(o_isLess),
|
OPCODE(o_isLess),
|
||||||
OPCODE(o2_drawObject),
|
OPCODE(o2_drawObject),
|
||||||
OPCODE(o5_decrement),
|
OPCODE(o_decrement),
|
||||||
OPCODE(o2_getActorX),
|
OPCODE(o2_getActorX),
|
||||||
/* C8 */
|
/* C8 */
|
||||||
OPCODE(o_isEqual),
|
OPCODE(o_isEqual),
|
||||||
|
@ -304,21 +304,21 @@ void ScummEngine_c64::setupOpcodes() {
|
||||||
OPCODE(o5_setObjectName),
|
OPCODE(o5_setObjectName),
|
||||||
OPCODE(o2_actorFromPos),
|
OPCODE(o2_actorFromPos),
|
||||||
OPCODE(o5_getActorMoving),
|
OPCODE(o5_getActorMoving),
|
||||||
OPCODE(o2_setState02),
|
OPCODE(o_setState08),
|
||||||
/* D8 */
|
/* D8 */
|
||||||
OPCODE(o5_printEgo),
|
OPCODE(o5_printEgo),
|
||||||
OPCODE(o2_doSentence),
|
OPCODE(o2_doSentence),
|
||||||
OPCODE(o_add),
|
OPCODE(o_add),
|
||||||
OPCODE(o2_setBitVar),
|
OPCODE(o2_setBitVar),
|
||||||
/* DC */
|
/* DC */
|
||||||
OPCODE(o2_dummy),
|
OPCODE(o5_startSound),
|
||||||
OPCODE(o2_ifClassOfIs),
|
OPCODE(o2_ifClassOfIs),
|
||||||
OPCODE(o2_walkActorTo),
|
OPCODE(o2_walkActorTo),
|
||||||
OPCODE(o2_ifNotState02),
|
OPCODE(o2_ifNotState04),
|
||||||
/* E0 */
|
/* E0 */
|
||||||
OPCODE(o2_cursorCommand),
|
OPCODE(o2_cursorCommand),
|
||||||
OPCODE(o2_putActor),
|
OPCODE(o2_putActor),
|
||||||
OPCODE(o2_stopScript),
|
OPCODE(o_stopScript),
|
||||||
OPCODE(o5_getActorFacing),
|
OPCODE(o5_getActorFacing),
|
||||||
/* E4 */
|
/* E4 */
|
||||||
OPCODE(o2_loadRoomWithEgo),
|
OPCODE(o2_loadRoomWithEgo),
|
||||||
|
@ -344,7 +344,7 @@ void ScummEngine_c64::setupOpcodes() {
|
||||||
OPCODE(o_getDist),
|
OPCODE(o_getDist),
|
||||||
OPCODE(o2_findObject),
|
OPCODE(o2_findObject),
|
||||||
OPCODE(o_walkActorToObject),
|
OPCODE(o_walkActorToObject),
|
||||||
OPCODE(o2_clearState01),
|
OPCODE(o2_setState04),
|
||||||
/* F8 */
|
/* F8 */
|
||||||
OPCODE(o_isGreater),
|
OPCODE(o_isGreater),
|
||||||
OPCODE(o2_doSentence),
|
OPCODE(o2_doSentence),
|
||||||
|
@ -403,11 +403,47 @@ void ScummEngine_c64::ifNotStateCommon(byte type) {
|
||||||
ignoreScriptWord();
|
ignoreScriptWord();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScummEngine_c64::o_setState08() {
|
||||||
|
int obj = getVarOrDirectWord(PARAM_1);
|
||||||
|
putState(obj, getState(obj) | 0x08);
|
||||||
|
markObjectRectAsDirty(obj);
|
||||||
|
clearDrawObjectQueue();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScummEngine_c64::o_clearState08() {
|
||||||
|
int obj = getVarOrDirectWord(PARAM_1);
|
||||||
|
putState(obj, getState(obj) & ~0x08);
|
||||||
|
markObjectRectAsDirty(obj);
|
||||||
|
clearDrawObjectQueue();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScummEngine_c64::o_stopScript() {
|
||||||
|
int script;
|
||||||
|
|
||||||
|
if (_opcode == 0x05) {
|
||||||
|
script = 0;
|
||||||
|
} else {
|
||||||
|
script = getVarOrDirectByte(PARAM_1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (script == 0)
|
||||||
|
script = vm.slot[_currentScript].number;
|
||||||
|
|
||||||
|
if (_currentScript != 0 && vm.slot[_currentScript].number == script)
|
||||||
|
stopObjectCode();
|
||||||
|
else
|
||||||
|
stopScript(script);
|
||||||
|
}
|
||||||
|
|
||||||
void ScummEngine_c64::o_loadSound() {
|
void ScummEngine_c64::o_loadSound() {
|
||||||
int resid = fetchScriptByte();
|
int resid = fetchScriptByte();
|
||||||
ensureResourceLoaded(rtSound, resid);
|
ensureResourceLoaded(rtSound, resid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScummEngine_c64::o_unfreezeScripts() {
|
||||||
|
unfreezeScripts();
|
||||||
|
}
|
||||||
|
|
||||||
void ScummEngine_c64::o_move() {
|
void ScummEngine_c64::o_move() {
|
||||||
getResultPos();
|
getResultPos();
|
||||||
setResult(getVarOrDirectByte(PARAM_1));
|
setResult(getVarOrDirectByte(PARAM_1));
|
||||||
|
@ -553,6 +589,16 @@ void ScummEngine_c64::o_subtract() {
|
||||||
_scummVars[_resultVarNumber] -= a;
|
_scummVars[_resultVarNumber] -= a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScummEngine_c64::o_increment() {
|
||||||
|
int var = getVarOrDirectByte(PARAM_1);
|
||||||
|
setResult(readVar(var) + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScummEngine_c64::o_decrement() {
|
||||||
|
int var = getVarOrDirectByte(PARAM_1);
|
||||||
|
setResult(readVar(var) - 1);
|
||||||
|
}
|
||||||
|
|
||||||
void ScummEngine_c64::o_unknown93() {
|
void ScummEngine_c64::o_unknown93() {
|
||||||
debug(0, "o_unknown93 (Actor %d)", fetchScriptByte());
|
debug(0, "o_unknown93 (Actor %d)", fetchScriptByte());
|
||||||
}
|
}
|
||||||
|
@ -579,6 +625,28 @@ void ScummEngine_c64::o_getDist() {
|
||||||
setResult(r);
|
setResult(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScummEngine_c64::o_pickupObject() {
|
||||||
|
int obj = fetchScriptByte();
|
||||||
|
|
||||||
|
if (obj < 1) {
|
||||||
|
error("pickupObject received invalid index %d (script %d)", obj, vm.slot[_currentScript].number);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getObjectIndex(obj) == -1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (whereIsObject(obj) == WIO_INVENTORY) /* Don't take an */
|
||||||
|
return; /* object twice */
|
||||||
|
|
||||||
|
addObjectToInventory(obj, _roomResource);
|
||||||
|
markObjectRectAsDirty(obj);
|
||||||
|
putOwner(obj, VAR(VAR_EGO));
|
||||||
|
putState(obj, getState(obj) | 0xA);
|
||||||
|
clearDrawObjectQueue();
|
||||||
|
|
||||||
|
runInventoryScript(1);
|
||||||
|
}
|
||||||
|
|
||||||
void ScummEngine_c64::o_putActorAtObject() {
|
void ScummEngine_c64::o_putActorAtObject() {
|
||||||
int obj, x, y;
|
int obj, x, y;
|
||||||
Actor *a;
|
Actor *a;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue