![]() |
V5 opcode list
V5 opcode list The following conventions are used in the encoding descriptions.
actorFollowCamera$52actorFromPos$15actorFollowCamera$52actorFromPos$15actorSet$13actorSetClass$5Dadd$5A; one parameter, uses resultEncodingopcode result value[p16]Operationresult := result + value The variable pointed to by result is read, value is added to it, and the result written back. and$17; one parameter, uses resultEncodingopcode result value[p16]Operationresult := result and value The variable pointed to by result is read, logically ANDed with value, and the result written back. animateActor$11arrayOp$27; parameters depend on auxiliary opcodeEncodingopcode $01 array[p8]opcode $02 dest[p8] src[p8]opcode $03 array[p8] index[p8] data[p8]opcode $04 result array[p8] index[p8]opcode $05 array[p8] size[p8]OperationMiscellaneous actions on Arrays (referred to by resource number).
breakHere$80; no parametersEncodingopcodeOperationDeschedules the currently running thread. Execution continues at the next instruction when the thread's next timeslot comes around.chainScript$42; one parameter plus varargsEncodingopcode script[p8] args[v16]...OperationReplaces the currently running script with another one. The current script is terminated immediately and the new script, resource number script, is executed in the same thread. The new script has its local variables initialised to the list args. Uninitialised variables have undefined values.cursorCommand$2CcutScene$40debug$6B; one parameter, no resultEncodingopcode param[p16]OperationPasses the parameter to the interpreter's debugger. What this does is entirely platform-specific (and may do nothing).decrement$C6; no parameters, uses resultEncodingopcode resultOperationresult := result - 1 Reads the variable pointed to by result, decrements it, and writes it back. delay$2E; one constant parameterEncodingopcode param[24]OperationSuspends the current thread for the appropriate number of 1/60ths of a second. Yes, that really is a 24-bit LE constant. delayVariable$2E; one constant parameterEncodingopcode pointer[16]Operationpointer is dereferenced and the current thread suspended for that number of 1/60ths of a second. Note that pointer is an inline constant, not a parameter. divide$5B; one parameter, uses resultEncodingopcode result value[p16]Operationresult := result / value The variable pointed to by result is read, divided by value, and the result written back. If value is zero, the result is undefined (and the interpeter may halt with an error). doSentence$19drawBox$3F; two parameters, does not use result, supplementary opcode byte with three more subsequent parametersEncodingopcode left[p16] top[p16] auxopcode[8] right[p16] bottom[p16] colour[p8]OperationDraws a solid box on the backbuffer from (left, top)-(right, bottom) in the colour colour. The only part of auxopcode that is relevant are the parameter bits. The rest of the opcode is ignored. drawObject$05dummy$67endCutScene$C0equalZero$28expression$ACfaceActor$09findInventory$3DfindObject$35freezeScripts$60getActorCostume$71getActorElevation$06getActorFacing$63getActorMoving$56getActorRoom$03getActorScale$3BgetActorWalkBox$7BgetActorWidth$6CgetActorX$43getActorY$23getAnimCounter$22getClosestObjActor$66getDist$34getInventoryCount$31getObjectOwner$10getObjectState$0FgetRandomNumber$16getScriptRunning$68getVerbEntryPoint$0BifClassOfIs$1Dincrement$46; no parameters, uses resultEncodingopcode resultOperationresult := result + 1 Reads the variable pointed to by result, increments it, and writes it back. isActorInBox$1FisEqual$48isGreater$78isGreaterEqual$04isLess$44isNotEqual$08isSoundRunning$7CjumpRelative$18; non-standard encodingEncodingopcode target[16]OperationPC := PC + target The inline constant target is read as a signed word and added to the program counter after the instruction has been read. Therefore, if target is zero, the instruction will do nothing; if target is -3, an infinite loop will result. lessOrEqual$38lights$70loadRoom$72loadRoomWithEgo$24matrixOp$30move$1Amultiply$1BnotEqualZero$A8or$57; one parameter, uses resultEncodingopcode result value[p16]Operationresult := result and value The variable pointed to by result is read, logically ORed with value, and the result written back. overRide$58panCameraTo$12pickupObject$25$14printEgo$D8pseudoRoom$CCputActor$01putActorAtObject$0EputActorInRoom$2DquitPauseRestart$98resourceRoutines$0CroomOp$33saveRestoreVerbs$ABsetCameraAt$32setObjectName$54setOwnerOf$29setState$07setVarRange$26soundKludge$4CstartMusic$02startObject$37startScript$0A; one parameter plus varargs, extra encoding in opcodeEncodingopcode script[p8] args[v16]...OperationSpawns a new thread running the code in script script. The new script has its local variables initialised to the list args. Uninitialised variables have undefined values. The opcode carries extra information:
If the Q bit is set, the new thread is marked as quick. If the F bit is set, the thread is marked as unfreezable. The P1 bit is the parameter bit for script, as usual. startSound$1CstopMusic$20stopObjectCode$00stopObjectScript$6EstopScript$62stopSound$3Csubtract$3AanimateActor$11wait$AEwalkActorTo$1EwalkActorToActor$0DwalkActorToObject$36All material © 2000-2002 David Given, unless where stated otherwise. |