Difference between revisions of "SCUMM/V5 opcodes"

Jump to navigation Jump to search
14,251 bytes added ,  13:13, 28 February 2009
Added a Table of Parameters section; missing complex operations such as expressions, anything with sub-opcodes. Omitted comparisons for now.
m (SCUMM V5 opcodes moved to SCUMM/V5 opcodes: subpage)
(Added a Table of Parameters section; missing complex operations such as expressions, anything with sub-opcodes. Omitted comparisons for now.)
Line 388: Line 388:




All material © 2000-2002 David Given, unless where stated otherwise.
All material © 2000-2002 David Given, unless where stated otherwise.
 
 
=Table of Parameters=
 
This is a work in progress and is missing opcodes.
 
This table shows a summary of the opcodes and their parameters in a concise fashion. The information has been gleaned from the descumm source code, so some instruction names might not match those listed above.
 
Currently it is missing:
comparisons (lessThan, greaterThanEqual, equalZero etc)
drawObject
do_resource
do_if_state_code (comparisons)
do_print_ego
do_varset_code
do_unconditional_jump
loadRoomWithEgo
do_cursor_command
doSentence
do_expr_code
do_load_code_to_string (sub-opcode of 0x27)
do_actorops
do_pseudoRoom(buf)
do_room_ops(buf)
do_verbops(buf, opcode)
setVarRange
do_matrix_ops(buf, opcode)
Some instructions listed here are actually sub-opcodes, i.e. "WaitForCamera" is actually the "Wait" opcode with a sub-opcode representing "For Camera".
 
Argument types:
* V = variable
* B = byte
* W = word
* L = list
* J = jump (used by all boolean expressions, comparisons)
* D = delay; 24-bit constant (only used by delay, funnily enough)
* A = ASCII (0-terminated string?); used by "setObjectName"
* V|B or V|W = either a variable or a byte/word
* None, if it does not take that argument.
 
{| border="1" style="text-align:center" width=100% cellpadding=2
! Instruction
! Returns a Value
! Arg 1
! Arg 2
! Arg 3
|-
|align="left" |actorFollowCamera
|style="color:silver; background:whitesmoke" |False
|V|B
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |actorFromPos
|True
|V|W
|V|W
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |animateCostume
|style="color:silver; background:whitesmoke" |False
|V|B
|V|B
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |beginOverride
|style="color:silver; background:whitesmoke" |False
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |breakHere
|style="color:silver; background:whitesmoke" |False
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |chainScript
|style="color:silver; background:whitesmoke" |False
|V|B
|L
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |classOfIs
|style="color:silver; background:whitesmoke" |False
|V|W
|L
|J
|-
|align="left" |CopyString
|style="color:silver; background:whitesmoke" |False
|V|B
|V|B
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |CreateString
|style="color:silver; background:whitesmoke" |False
|V|B
|V|B
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |cutscene
|style="color:silver; background:whitesmoke" |False
|L
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |debug?
|style="color:silver; background:whitesmoke" |False
|V|W
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |delay
|style="color:silver; background:whitesmoke" |False
|D
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |delayVariable
|style="color:silver; background:whitesmoke" |False
|V
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |deleteVerbs
|style="color:silver; background:whitesmoke" |False
|V|B
|V|B
|V|B
|-
|align="left" |dummy
|style="color:silver; background:whitesmoke" |False
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |endCutscene
|style="color:silver; background:whitesmoke" |False
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |endOverride
|style="color:silver; background:whitesmoke" |False
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |faceActor
|style="color:silver; background:whitesmoke" |False
|V|B
|V|W
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |findInventory
|True
|V|B
|V|B
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |findObject
|True
|V|W
|V|W
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |freezeScripts
|style="color:silver; background:whitesmoke" |False
|V|B
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |getActorCostume
|True
|V|B
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |getActorElevation
|True
|V|B
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |getActorFacing
|True
|V|B
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |getActorMoving
|True
|V|B
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |getActorRoom
|True
|V|B
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |getActorScale
|True
|V|B
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |getActorWalkBox
|True
|V|B
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |getActorWidth
|True
|V|B
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |getActorX
|style="color:silver; background:whitesmoke" |False
|V|W
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |getActorY
|style="color:silver; background:whitesmoke" |False
|V|W
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |getClosestObjActor
|True
|V|W
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |getDist
|True
|V|W
|V|W
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |getInventoryCount
|True
|V|B
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |getObjectOwner
|True
|V|W
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |getObjectState
|True
|V|W
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |getRandomNr
|True
|V|B
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |GetStringChar
|True
|V|B
|V|B
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |getStringWidth
|True
|V|B
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |getVerbEntryPoint
|True
|V|W
|V|W
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |isActorInBox
|style="color:silver; background:whitesmoke" |False
|V|B
|V|B
|J
|-
|align="left" |isScriptRunning
|True
|V|B
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |isSoundRunning
|True
|V|B
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |lights
|style="color:silver; background:whitesmoke" |False
|V|B
|B
|B
|-
|align="left" |loadRoom
|style="color:silver; background:whitesmoke" |False
|V|B
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |oldRoomEffect-fadein
|style="color:silver; background:whitesmoke" |False
|V|W
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |oldRoomEffect-set
|style="color:silver; background:whitesmoke" |False
|V|W
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |panCameraTo
|style="color:silver; background:whitesmoke" |False
|V|W
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |pickupObject
|style="color:silver; background:whitesmoke" |False
|V|W
|V|B
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |putActor
|style="color:silver; background:whitesmoke" |False
|V|B
|V|W
|V|W
|-
|align="left" |putActorAtObject
|style="color:silver; background:whitesmoke" |False
|V|B
|V|W
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |putActorInRoom
|style="color:silver; background:whitesmoke" |False
|V|B
|V|B
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |restoreVerbs
|style="color:silver; background:whitesmoke" |False
|V|B
|V|B
|V|B
|-
|align="left" |saveLoadGame
|True
|V|B
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |saveVerbs
|style="color:silver; background:whitesmoke" |False
|V|B
|V|B
|V|B
|-
|align="left" |setCameraAt
|style="color:silver; background:whitesmoke" |False
|V|W
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |setClass
|style="color:silver; background:whitesmoke" |False
|V|W
|L
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |setObjectName
|style="color:silver; background:whitesmoke" |False
|V|W
|A
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |setOwnerOf
|style="color:silver; background:whitesmoke" |False
|V|W
|V|B
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |setState
|style="color:silver; background:whitesmoke" |False
|V|W
|V|B
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |SetStringChar
|style="color:silver; background:whitesmoke" |False
|V|B
|V|B
|V|B
|-
|align="left" |soundKludge
|style="color:silver; background:whitesmoke" |False
|L
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |startMusic
|style="color:silver; background:whitesmoke" |False
|V|B
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |startObject
|style="color:silver; background:whitesmoke" |False
|V|W
|V|B
|L
|-
|align="left" |startScript
|style="color:silver; background:whitesmoke" |False
|V|B
|L
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |startSound
|style="color:silver; background:whitesmoke" |False
|V|B
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |stopMusic
|style="color:silver; background:whitesmoke" |False
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |stopObjectCode
|style="color:silver; background:whitesmoke" |False
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |stopObjectScript
|style="color:silver; background:whitesmoke" |False
|V|W
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |stopScript
|style="color:silver; background:whitesmoke" |False
|V|B
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |stopSound
|style="color:silver; background:whitesmoke" |False
|V|B
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |systemOps
|style="color:silver; background:whitesmoke" |False
|B
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |WaitForActor
|style="color:silver; background:whitesmoke" |False
|V|B
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |WaitForCamera
|style="color:silver; background:whitesmoke" |False
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |WaitForMessage
|style="color:silver; background:whitesmoke" |False
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |WaitForSentence
|style="color:silver; background:whitesmoke" |False
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|style="color:silver; background:whitesmoke" |None
|-
|align="left" |walkActorTo
|style="color:silver; background:whitesmoke" |False
|V|B
|V|W
|V|W
|-
|align="left" |walkActorToActor
|style="color:silver; background:whitesmoke" |False
|V|B
|V|B
|B
|-
|align="left" |walkActorToObject
|style="color:silver; background:whitesmoke" |False
|V|B
|V|W
|style="color:silver; background:whitesmoke" |None
|}
126

edits

Navigation menu