-
Notifications
You must be signed in to change notification settings - Fork 20
Scumm 6 functions
An almost complete list of the bultin functions in scumm. A couple are still missing as they are not yet usable in ScummC for some reason. Nearly all need a better description.
I renamed many functions compared to the name found in ScummVM and other references in order to bring a little more consistence in the naming schema and make some name more descriptive. Any comments or suggestion is more than welcome.
OP Code: 0x5E
The 2 first bits of flags are used: bit 0 mean freeze resistant, and bit 1 recursive. Freeze resistant mean that the script won't be freezed by "normal" freezeUnfreeze() calls. If recursive is not set, then any running instance of the script is stopped before the script is started.
OP Code: 0x5F
Same as calling startScript with flags set to 0.
OP Code: 0xBF
Same as calling startScript with flags set to 2.
OP Code: 0x6A
Unfreeze all frozen thread if a == 0. If a < 0x80 it freeze all freezable threads. If a >= 0x80 it freeze all threads including the unfreezable.
Freezing is a nestable operation, a thread which is frozen twice must be thawed twice before it becomes runnable again.
OP Code: 0x6C
Break out of the current script letting other scripts execute.
OP Code: 0xCA
Break a script X times.
OP Code: 0x77
Stop an object script.
OP Code: 0x7C
Stop a script.
OP Code: 0x8B
Check if a script is running.
OP Code: 0xA9A8
Break the current script until the actor stop moving.
OP Code: 0xA9A9
Break the script as long a message is displayed (check VAR_HAVE_MSG).
OP Code: 0xA9AA
Break the current script until the camera finished moving.
OP Code: 0xA9AB
Break the current script until the sentence script is finished.
OP Code: 0xA9E2
Break the current script until the actor animation is finished ??
OP Code: 0x9AE8
Break the current script until the actor finished turning. WARNING: ScummVM have a dirty hack bcs of some problems in the dig. See scumm/script_v6.cpp for more details. If the actor have an id such that actor % 45 == 0 the hack will kick in and the current actor will be used instead.
OP Code: 0xB0, 0xB1, 0xB2
Break the current script for some times. A tick is 1/60th of a second.
OP Code: 0xB3
Stop the sentence script.
OP Code: 0xC9 [ 0x09 ]
Stop all script except the current one.
OP Code: 0xD5
Stop all running script, then start a new one. flags are the same as for startScript.
OP Code: 0xD8
Check if the verb script from an object owned by the room is running. This opcode is not supported by the LEC interpreter.
OP Code: 0x6B90, 0x6B91
Enable/Disable the mouse cursor.
OP Code: 0x6B92, 0x6B93
Enable/Disable user input.
OP Code: 0x6B94-0x6B97
These are a bit different, they use ++ and -- instead of setting to 0 or 1. Dunno what they are good for.
OP Code: 0x6B99
Use the given object as cursor.
OP Code: 0x6B9A
Set the cursor hotspot coordinate.
OP Code: 0x6BD6
Set the transparent color for the cursor.
OP Code: 0x6B9C
Set the charset used for text.
OP Code: 0x6B9D
Set the colormap used for the charset, it need 16 entries.
OP Code: 0x78
Pan the camera to show column x.
OP Code: 0x7A
Set camera to show column x.
OP Code: 0x79
Make the camera automatically follow the given actor.
OP Code: 0xC9 [ 0x04 ]
Set the cursor from a part of the view.
OP Code: 0xC9 [ 0x6E ]
OP Code: 0x7B
Start the given room.
WARNING: In scummvm this function is named loadRoom. However it is clashing with the ressource functions. So I renamed this one startRoom which anyway better reflect what it do.
OP Code: 0x85
Load a room then walk the actor to the given object ?? If x is not -1 walk to x, y ??
WARNING: In scummvm this function is named loadRoomWithEgo, I renamed it to match the startRoom() function.
OP Code: 0x99
Set the given flags for on the box listed. The flags are the same as those stored in the BOXD structure. For reference:
- 0x08 : X flip
- 0x10 : Y flip
- 0x20 : Ignore scale / Player only
- 0x40 : Locked
- 0x80 : Invisible
To disable/enable a box blocking/allowing actors to go throuh it you want to set the Invisible flag. When this is done createBoxMatrix() must be called for the changes to take effect.
OP Code: 0x9A
Recreate the room box matrix of the current room. The box matrix store the paht between the box, in other word how to get from bax A to box B.
OP Code: 0xC8 [ 0x73 ]
OP Code: 0xC8 [ 0x74 ]
Check if a point is inside a box.
OP Code: 0xC8 [ 0xD7 ]
Get the flags of a box.
OP Code: 0xE4
Switch the room to an alternative box set. This mean room can have several box set, that's new to me as in 0.6.1 that op code did nothing.
OP Code: 0x9CAF
Set a palette entry.
OP Code: 0x9CB0,0x9CB1
Start, stop the good old shaking effect.
OP Code: 0x9CB3
Equivalent to setRoomRGBIntensity(scale,scale,scale,start,end). This will generaly be used to darken the image and such kind of effect.
OP Code: 0x9CB6
Modify the rgb intensity of the palette elements from start
to end
.
The scaling is as follow: newRed = red * rScale / 0xFF.
OP Code: 0x9CB7
Setup the shadow palette. Entries are defined with: r = ((palR/4)*rScale)/256 where palR is the red value of the color in the current palette.
OP Code: 0x9CBA
Do some tricks with palette, dunno what. It seems resID must a palette.
OP Code: 0x9CBB
Set the delay betwen palette rotation steps.
OP Code: 0x9CD5
Set the current room palette.
OP Code: 0x9CAC
Set the area that will be visible. Internaly it just set VAR_CAMERA_MIN_X and VAR_CAMERA_MAX_X but it also clamp their value screenWidth/2 and roomWidth-(screenWidth/2).
OP Code: 0x9CAE
Setup the room image size and position. The height (bottom-top) MUST match the height of the room image otherwise the rendering go havoc.
OP Code: 0x9CB5
Set the effect that will be used on the next room switching. The effect parameter store in fact 2 effect a closing and an openning one. The higest byte define the closing effect and the lowest byte define the opening effect. So for ex. scrennEffect(0x8082) would first do the dissolve then the scroll.
-
0x01: box closing effect with the image
-
0x02: new image slide from the top left
-
0x03: new image slide from the bottom right
-
0x04: old image slide to the top left
-
0x05: box opening with the image
-
0x06: new image slide from the left and a bit above
-
0x80: disolve
-
0x81: black screen
-
0x82: scroll from the left
-
0x83: scroll from the right
-
0x84: scrool from the top
-
0x85: scrool from the bottom
-
0x86: fine dissolve
-
0x87: columns dissolve
OP Code: 0xA1
Set the listed pseudo room to point to room. pseudo rooms must be greater or equal to 0x80.
OP Code: 0xC9 [ 0x05 ], 0xC9 [ 0x06 ]
Perform a fade-in or fade-out affect like on room transition.
OP Code: 0xC9 [ 0x6C ]
end )
OP Code: 0xC9 [ 0x70 ]
OP Code: 0xDD
Return an array with all object in the room. ScummVM have a warning if room is not the current room. Dunno why. This OP code is not supported by the LEC interpreter for dott.
OP Code: 0x9CB3
Really dunno what that do.
Note that objects and actors share the same address space. Actors have address es up to 0xE (0xF is used to represent the room). This mean that some of the following functions are also usable with actors.
OP Code: 0x60
Execute the code attached to an abject verb. Flags are the same as for scripts: bit 0 freeze resistant, bit 1 recursive.
OP Code: 0xBE
Same as calling startObject with flags set to 2.
OP Code: 0x61
Force a redraw. If state is 0 it's set to 1, probably to be sure it really draw something.
OP Code: 0x62
Same as drawObject but at a given position.
OP Code: 0x6D
Check if an object match the given class combination. If the class number is ored with 0x80 then the object must belong to the class, otherwise it musn't belong to it. For ex isObjectOfClass(obj,[ Openable + 128, Pickable]) will return 1 if the object is Openable and not Pickable. Note that we use + here because the LEC interpreter doesn't support bitwise or. As classes number only range up to 32 using + is ok anyway.
OP Code: 0x6E
Set the classes an object belong to. As for isObjectOfClass() the higest bit of the classes indicate if the object belong to the class or not. 0 have a special effect it reset the class of the object at the same index (inside the room). That must be checked against the LEC interpreter.
OP Code: 0x6F, 0x70
Get/Set the state of an object.
OP Code: 0x72, 0x71
Get/Set the owner of an object. Owner should be an actor, but can be 0.
OP Code: 0x84
Make VAR_EGO the owner of the object, set the object as untouchable, turn it into state 1 and run the inventory script. It's generaly just what is needed to pick an object from the room.
OP Code: 0x8D, 0x8E
Get the object/actor X or Y coordinate.
OP Code: 0x8F
Get the direction of an object, that is in which direction actors standing in front of it should look.
OP Code: 0x97
Change the name of an object.
OP Code: 0xA0
Find the object at the given position.
OP Code: 0xA3
Return the offset at which the code for the given verb is found. Mostly useful to find out if an object implement a verb or not.
OP Code: 0xC8 [ 0xCF ], 0xC8 [ 0D0 ]
Get the position of an object in the current room.
OP Code: 0xC8 [ 0xD1 ], 0xC8 [ 0D2 ]
Get the size of an object in the current room.
OP Code: 0xC9 [ 0x77 ]
OP Code: 0xCD
Dunno really what this function is about. It basically just set the object state, optionaly setting the object position to x*8,y*8 if x != -1.
OP Code: 0xED
Get the object direction in a "new" format ??
OP Code: 0x9B77
Create an FlObject effectively loading an object from another room in the current one.
OP Code: 0x9DC5
Set an actor as the current one.
OP Code: 0x9D53
Reset the actor and play it's init anim ??
OP Code: 0x9DD9
Like actorInit() but it directly go to anim 2 (the walk anim by default).
OP Code: 0x9D58
Set the name of the current actor.
OP Code: 0x7D
Make an actor walk to an object. It will go at distance pixel away from the object, where distance is only horizontal.
OP Code: 0x7E
Make an actor walk to the given position.
OP Code: 0x7F
Give an actor a new position. If room == 0xFF, it use the room where the actor currently is.
OP Code: 0x80
Put an actor next to an object, eventually in another room ??
OP Code: 0x81
Make the actor face the given object or actor.
OP Code: 0x9DE5
Stop the current actor and make it stand.
OP Code: 0x9DE6
Set the direction of the current actor.
OP Code: 0x9DE7
Make the actor turn to the given direction. The direction is in degree (0 is north, 90 east, 180 south and 270 west). This doesn't seems to be supported by the LEC interpreter.
OP Code: 0x9DD7, 0x9DD8
Probably change the way the current actor is turning on himself.
OP Code: 0x9DE9, 0x9DEA
Freeze, unfreeze the current actor.
OP Code: 0x9D4D
Set the walking spped of the current actor. The higher the value the slowver it is.
OP Code: 0x8A
Check if the actor is moving ??
OP Code: 0x9D5F
Allow the current actor to go anywhere ??
OP Code: 0x9D60
Force the actor to stay in the boxes.
OP Code: 0xA2, 0x9D54
Get the elevation of the given actor. Set the elevation of the current actor.
OP Code: 0x91, 0x9D4C
Get the costume weared by an actor. Set the costume of the current actor.
OP Code: 0x82
Make the actor play the given anim.
OP Code: 0x9D61
Set the current actor animation speed.
OP Code: 0x9D4F
Change the frame used for the walk anim of the current actor. Default to 2.
OP Code: 0x9D50
Change the frames used for starting, stoping a talking sequence. Default to 4 and 5.
OP Code: 0x9D51
Set the anim used when the current actor is standing. Default to 3 .
OP Code: 0x9D59
Set the anim used when initing the current actor. Default to 1.
OP Code: 0x9D55
Reset the current actor anims to the defaults.
OP Code: 0xD2, 0x9DC6
Get/Set the value of an actor animation variable.
OP Code: 0xAB
Get the actor's first anim counter. Dunno what that is.
OP Code: 0x9D4E
Set the sounds used by the costume of the current actor.
OP Code: 0x8C
Get the room in which the actor is ??
OP Code: 0x90
Is the actor following walke boxes ??
OP Code: 0x9D56
Set the palette of the current actor ??
OP Code: 0x9D57
Set the color to be used for text said by the current actor.
OP Code: 0xA8, 0x9D5B
Get the actor width. Set the current actor width. Dunno really what's that for.
OP Code: 0x9D5C
Set the current actor scaling factor.
OP Code: 0x9D5D
Disable z clipping on the current actor.
OP Code: 0x9DE1
Enable / disable z clipping of the current actor.
OP Code: 0x9D62
Set the current actor shadow mode. Dunne what's that is.
OP Code: 0x9D63
Set the offset to use to place the text of the current actor.
OP Code: 0xEC, 0x9DE3
Get the layer of an actor, set the layer of the current actor.
OP Code: 0x9DE4
Set the walk script for the current actor.
OP Code: 0x9DEB
Set the talk script for the current actor.
OP Code: 0x9F
Get the actor at the given position.
OP Code: 0xAA
Get the X scale factor of the actor.
OP Code: 0xAF
Check if an actor is inside a box.
OP Code: 0xBA
Make the actor (or ego) say something. egoSay(s) is equivalent to actorSay(VAR_EGO,s).
OP Code: 0xC8 [ 0xD4 ]
Get the current frame of an actor.
OP Code: 0xC9 [ 0x6B ]
Set the actor scaling.
OP Code: 0xC9 [ 0x6F ]
OP Code: 0xD1
End all talkings ??
OP Code: 0x92
Find the object idx (first, second, etc) in the owner inventory.
OP Code: 0x93
Get the number of object owned by owner.
OP Code: 0x83
Prepare a sentence. The sentence script is then called with verb, objA and objB as argument. objB might be 0.
OP Code: 0x94
Find the verb at the given coordinate.
OP Code: 0x9EC4
Set the current verb.
OP Code: 0x9E7C
Set the object image to be used with the current verb. The object must be in the ressource room. To use object from other rooms use verbSetObject().
OP Code: 0x9E7D
Set the name of the current verb.
OP Code: 0x9E7E
Set the color of the current verb.
OP Code: 0x9E7F
Set the highlight color of the current verb.
OP Code: 0x9E80
Set the position of the current verb.
OP Code: 0x9E81, 0x9E82
Enable, disable the current verb.
OP Code: 0x9E83
Destroy the current verb.
OP Code: 0x9E84
Initialize the current verb.
OP Code: 0x9E85
Set the dimmed color for the current verb.
OP Code: 0x9E86
Set the current verb as dimmed.
OP Code: 0x9E87
Set the key binded to the current verb ??
OP Code: 0x9E88
Set the current verb as centered.
OP Code: 0x9E89
Set the current verb name's from an array. This function need the array address as argument.
OP Code: 0x9E8B
Set the current verb image using an object from any room.
OP Code: 0x9E8C
Set the background color for the current verb.
OP Code: 0x9EFF
Redraw the current verb.
OP Code: 0xA58D,0xA58E
Save/restore the verbs fromVerb to toVerb in to/from the given save slot.
OP Code: 0xA58F
Destroy a verb save slot.
OP Code: 0xC8 [ 0xD5 ], 0xC8 [ 0xD6 ]
Get the position of a verb.
OP Code: 0x69
Stop all sounds ??
OP Code: 0x74
Play the given sound ??
OP Code: 0x75
Stop the sound (or is the argument something else ?)
OP Code: 0x76
Same as start sound ??
OP Code: 0x98
Check if the given sound is running ??
OP Code: 0xC9 [ 0x7C ]
OP Code: 0xAC
The main gateway to imuse. This should be abstracted.
loadScript( script ), loadSound( sound ), loadCostume( cost ), loadRoom( room ), loadCharset( chset)
OP Code: 0x9B64-0x9B67, 0x9B75
Ensure that a ressource is loaded.
nukeScript( script ), nukeSound( sound ), nukeCostume( cost ), nukeRoom( room ), nukeCharset( chset )
OP Code: 0x9B68-09B6B, 0x9B76
Free a ressource.
OP Code: 0x9B6C-0x9B6F
Lock a ressource in memory. So it's still avaible even after leaving the room.
OP Code: 0x9B70-0x9B73
Unlock a ressource.
OP Code: 0xC9 [ 0x68 ]
Destroy the FlObjects with address between first and last.
OP Code: 0xAE9E
Restart the game without any confirmation.
OP Code: 0xAE9F
Set the game in paused mode.
OP Code: 0xAEA0
Quit the game without any confirmation.
The print function are avaible in 6 versions:
- print: 0xB4XX
- cursorPrint: 0xB5XX
- dbgPrint: 0xB6XX
- sysPrint: 0xB7XX
- actorPrint: 0xB8XX
- egoPrint: 0xB9XX
All functions are identical in each varient except actorPrintBegin which take the actor as argument (all other *PrintBegin don't take any argument. Taking printAt as example the other varient are: cursorPrintAt, dbgPrintAt, sysPrintAt, actorPrintAt and egoPrintAt.
OP Code: 0xXX41
Set the position where a string should be printed.
OP Code: 0xXX42
Set the color in which the string will be printed.
OP Code: 0xXX43
Set some clipping ???
OP Code: 0xXX47
Set the string to be left aligned ??
OP Code: 0xXX45
Set the string to be centered ??
OP Code: 0xXX48
Set the string to be displayed above an actor ??
OP Code: 0xXX4A
The actor saying it will mumble ??
OP Code: 0xXX4B
Print a string.
OP Code: 0xXXFE, 0xXXFF
Start/End a print context.
OP Code: 0x87
Return a random number betwen 0 and max. VAR_RANDOM_NR is also set with the returned value.
OP Code: 0x88
Return a random number betwen min and max. Also set VAR_RANDOM_NR.
OP Code: 0xA6
Draw a box, surprised ?
OP Code: 0xAD
Check if val exist in the list.
OP Code: 0xC4
Return the basolute value of val.
OP Code: 0xC5
Get the distance between two objects.
OP Code: 0xC6
Get the distance between an object and a point.
OP Code: 0xC7
Get the distance between two points.
OP Code: 0xC8 [ 0x71 ]
Get the value of a pixel from the screen, probably only available in S&M
OP Code: 0xC8 [ 0xCE ]
Get the best matching palette entry for the given RGB value.
OP Code: 0xC8 [ 0xD3 ]
Get the state of a key.
OP Code: 0xC9 [ 0x78 ]
Swap two colors in the palette.
OP Code: 0xC9 [ 0x7B ]
Overwrite a color from the palette with another.
OP Code: 0xCB
Pick element idx in the list. The engine will spit an error if idx is out of range, dunno if that lead to a shutdown, but probably.
OP Code: 0xCC
Like pickOneOf but it return default if idx is out of range.
OP Code: 0xD0
Get the current date and time. The result is set in the folowing variables: VAR_TIMEDATE_YEAR, VAR_TIMEDATE_MONTH, VAR_TIMEDATE_DAY, VAR_TIMEDATE_HOUR and VAR_TIMEDATE_MINUTE.
OP Code: 0xD4
Shuffle the array element between index min and max.