Difference between revisions of "SCUMM/V5 opcodes"

Jump to navigation Jump to search
200 bytes added ,  10:38, 29 October 2006
Now using the opcode names (by which this list is sorted, after all) as section headers, not the meaningless hex values
(initial V5 opcodes page from website)
 
(Now using the opcode names (by which this list is sorted, after all) as section headers, not the meaningless hex values)
Line 25: Line 25:




==$52==
==actorFollowCamera ($52)==
actorFollowCamera


==$15==
==actorFromPos ($15)==
actorFromPos


==$13==
==actorSet ($13)==
actorSet


==$5D==
==actorSetClass ($5D)==
actorSetClass


==$5A==
==add ($5A)==
add


===Encoding===
===Encoding===
Line 48: Line 43:
The variable pointed to by result is read, value is added to it, and the result written back.
The variable pointed to by result is read, value is added to it, and the result written back.


==$17==
==and ($17)==
and


one parameter, uses result
one parameter, uses result
Line 61: Line 55:
The variable pointed to by result is read, logically ANDed with value, and the result written back.
The variable pointed to by result is read, logically ANDed with value, and the result written back.


==$11==
==animateActor ($11)==
animateActor


==$27==
==arrayOp ($27)==
arrayOp


parameters depend on auxilary opcode
parameters depend on auxilary opcode
Line 94: Line 86:
|}
|}


==$80==
==breakHere ($80)==
breakHere


no parameters
no parameters
Line 105: Line 96:
Deschedules the currently running thread. Execution continues at the next instruction when the thread's next timeslot comes around.
Deschedules the currently running thread. Execution continues at the next instruction when the thread's next timeslot comes around.


==$42==
==chainScript ($42)==
chainScript


one parameter plus varargs
one parameter plus varargs
Line 116: Line 106:
Replaces 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.
Replaces 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.


==$2C==
==cursorCommand ($2C)==
cursorCommand


==$40==
==cutScene ($40)==
cutScene


==$6B==
==debug ($6B)==
debug


one parameter, no result
one parameter, no result
Line 133: Line 120:
Passes the parameter to the interpreter's debugger. What this does is entirely platform-specific (and may do nothing).
Passes the parameter to the interpreter's debugger. What this does is entirely platform-specific (and may do nothing).


==$C6==
==decrement ($C6)==
decrement


no parameters, uses result
no parameters, uses result
Line 146: Line 132:
Reads the variable pointed to by result, decrements it, and writes it back.  
Reads the variable pointed to by result, decrements it, and writes it back.  


==$2E==
==delay ($2E)==
delay


one constant parameter
one constant parameter
Line 157: Line 142:
Suspends the current thread for the appropriate number of 1/60ths of a second. Yes, that really is a 24-bit LE constant.
Suspends the current thread for the appropriate number of 1/60ths of a second. Yes, that really is a 24-bit LE constant.


==$2E==
==delayVariable ($2E)==
delayVariable


one constant parameter
one constant parameter
Line 168: Line 152:
pointer 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.
pointer 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.


==$5B==
==divide ($5B)==
divide


one parameter, uses result
one parameter, uses result
Line 181: Line 164:
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).  
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).  


==$19==
==doSentence ($19)==
doSentence


==$3F==
==drawBox ($3F)==
drawBox


two parameters, does not use result, supplementary opcode byte with three more subsequent parameters
two parameters, does not use result, supplementary opcode byte with three more subsequent parameters
Line 197: Line 178:
The only part of auxopcode that is relevant are the parameter bits. The rest of the opcode is ignored.  
The only part of auxopcode that is relevant are the parameter bits. The rest of the opcode is ignored.  


==$05==
==drawObject ($05)==
drawObject


==$67==
==dummy ($67)==
dummy


==$C0==
==endCutScene ($C0)==
endCutScene


==$28==
==equalZero ($28)==
equalZero


==$AC==
==expression ($AC)==
expression


==$09==
==faceActor ($09)==
faceActor


==$3D==
==findInventory ($3D)==
findInventory


==$35==
==findObject ($35)==
findObject


==$60==
==freezeScripts ($60)==
freezeScripts


==$71==
==getActorCostume ($71)==
getActorCostume


==$06==
==getActorElevation ($06)==
getActorElevation


==$63==
==getActorFacing ($63)==
getActorFacing


==$56==
==getActorMoving ($56)==
getActorMoving


==$03==
==getActorRoom ($03)==
getActorRoom


==$3B==
==getActorScale ($3B)==
getActorScale


==$7B==
==getActorWalkBox ($7B)==
getActorWalkBox


==$6C==
==getActorWidth ($6C)==
getActorWidth


==$43==
==getActorX ($43)==
getActorX


==$23==
==getActorY ($23)==
getActorY


==$22==
==getAnimCounter ($22)==
getAnimCounter


==$66==
==getClosestObjActor ($66)==
getClosestObjActor


==$34==
==getDist ($34)==
getDist


==$31==
==getInventoryCount ($31)==
getInventoryCount


==$10==
==getObjectOwner ($10)==
getObjectOwner


==$0F==
==getObjectState ($0F)==
getObjectState


==$16==
==getRandomNumber ($16)==
getRandomNumber


==$68==
==getScriptRunning ($68)==
getScriptRunning


==$0B==
==getVerbEntryPoint ($0B)==
getVerbEntryPoint


==$1D==
==ifClassOfIs ($1D)==
ifClassOfIs


==$46==
==increment ($46)==
increment


no parameters, uses result
no parameters, uses result
Line 297: Line 248:
Reads the variable pointed to by result, increments it, and writes it back.  
Reads the variable pointed to by result, increments it, and writes it back.  


==$1F==
==isActorInBox ($1F)==
isActorInBox


==$48==
==isEqual ($48)==
isEqual


==$78==
==isGreater ($78)==
isGreater


==$04==
==isGreaterEqual ($04)==
isGreaterEqual


==$44==
==isLess ($44)==
isLess


==$08==
==isNotEqual ($08)==
isNotEqual


==$7C==
==isSoundRunning ($7C)==
isSoundRunning


==$18==
==jumpRelative ($18)==
jumpRelative


non-standard encoding
non-standard encoding
Line 331: Line 274:
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.  
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.  


==$38==
==lessOrEqual ($38)==
lessOrEqual


==$70==
==lights ($70)==
lights


==$72==
==loadRoom ($72)==
loadRoom


==$24==
==loadRoomWithEgo ($24)==
loadRoomWithEgo


==$30==
==matrixOp ($30)==
matrixOp


==$1A==
==move ($1A)==
move


==$1B==
==multiply ($1B)==
multiply


==$A8==
==notEqualZero ($A8)==
notEqualZero


==$57==
==or ($57)==
or


one parameter, uses result
one parameter, uses result
Line 368: Line 302:
The variable pointed to by result is read, logically ORed with value, and the result written back.  
The variable pointed to by result is read, logically ORed with value, and the result written back.  


==$58==
==overRide ($58)==
overRide


==$12==
==panCameraTo ($12)==
panCameraTo


==$25==
==pickupObject ($25)==
pickupObject


==$14==
==print ($14)==
print


==$D8==
==printEgo ($D8)==
printEgo


==$CC==
==pseudoRoom ($CC)==
pseudoRoom


==$01==
==putActor ($01)==
putActor


==$0E==
==putActorAtObject ($0E)==
putActorAtObject


==$2D==
==putActorInRoom ($2D)==
putActorInRoom


==$98==
==quitPauseRestart ($98)==
quitPauseRestart


==$0C==
==resourceRoutines ($0C)==
resourceRoutines


==$33==
==roomOp ($33)==
roomOp


==$AB==
==saveRestoreVerbs ($AB)==
saveRestoreVerbs


==$32==
==setCameraAt ($32)==
setCameraAt


==$54==
==setObjectName ($54)==
setObjectName


==$29==
==setOwnerOf ($29)==
setOwnerOf


==$07==
==setState ($07)==
setState


==$26==
==setVarRange ($26)==
setVarRange


==$4C==
==soundKludge ($4C)==
soundKludge


==$01==
==startMusic ($01)==
startMusic


==$37==
==startObject ($37)==
startObject


==$0A==
==startScript ($0A)==
startScript


one parameter plus varargs, extra encoding in opcode
one parameter plus varargs, extra encoding in opcode
Line 451: Line 363:
|}
|}


==$1C==
==startSound ($1C)==
startSound


==$20==
==stopMusic ($20)==
stopMusic


==$00==
==stopObjectCode ($00)==
stopObjectCode


==$6E==
==stopObjectScript ($6E)==
stopObjectScript


==$62==
==stopScript ($62)==
stopScript


==$3C==
==stopSound ($3C)==
stopSound


==$3A==
==subtract ($3A)==
subtract


==$11==
==animateActor ($11)==
animateActor


==$AE==
==wait ($AE)==
wait


==$1E==
==walkActorTo ($1E)==
walkActorTo


==$0D==
==walkActorToActor ($0D)==
walkActorToActor


==$36==
==walkActorToObject ($36)==
walkActorToObject




All material © 2000-2002 David Given, unless where stated otherwise.
All material © 2000-2002 David Given, unless where stated otherwise.
1,079

edits

Navigation menu