Open main menu

Difference between revisions of "SCUMM/V5 opcodes"

32 bytes removed ,  03:00, 23 January 2011
m
colour -> color
(Correct opcode for drawObject, some entries to do with aux opcode values.)
m (colour -> color)
Line 73: Line 73:
  $0A
  $0A
  $0B index[p8] value[p8]
  $0B index[p8] value[p8]
  $0C colour[p8]
  $0C color[p8]
  $0D name[c]... $00
  $0D name[c]... $00
  $0E initframe[p8]
  $0E initframe[p8]
Line 114: Line 114:
|$0A||SO_ANIMATION_DEFAULT||Initializes the actor's animation frames.<br>Init frame = 1<br>Walk frame = 2<br>Stand frame = 3<br>Talk start frame = 4<br>Talk stop frame = 5
|$0A||SO_ANIMATION_DEFAULT||Initializes the actor's animation frames.<br>Init frame = 1<br>Walk frame = 2<br>Stand frame = 3<br>Talk start frame = 4<br>Talk stop frame = 5
|-
|-
|$0B||SO_PALETTE||Sets the colour at the given index to a new value (another entry in the colour lookup table/CLUT). Index must be between 0 and 31 (the number of colours in a costume).
|$0B||SO_PALETTE||Sets the color at the given index to a new value (another entry in the color lookup table/CLUT). Index must be between 0 and 31 (the number of colors in a costume).
|-
|-
|$0C||SO_TALK_COLOR||Sets the actor's talk colour.
|$0C||SO_TALK_COLOR||Sets the actor's talk color.
|-
|-
|$0D||SO_ACTOR_NAME||Sets the actor's name to the given null-terminated string.
|$0D||SO_ACTOR_NAME||Sets the actor's name to the given null-terminated string.
Line 261: Line 261:
  $0C cursor[p8]
  $0C cursor[p8]
  $0D charset[p8]
  $0D charset[p8]
  $0E colours[v16]...
  $0E colors[v16]...


===Operation===
===Operation===
Line 294: Line 294:
|$0D||SO_CHARSET_SET||Initializes the given character set.
|$0D||SO_CHARSET_SET||Initializes the given character set.
|-
|-
|$0E||SO_CHARSET_COLORS||Initializes the character set data & colours to the given arguments? Must have 16 arguments?
|$0E||SO_CHARSET_COLORS||Initializes the character set data & colors to the given arguments? Must have 16 arguments?
|}
|}


Line 379: Line 379:


===Encoding===
===Encoding===
  opcode left[p16] top[p16] auxopcode[8] right[p16] bottom[p16] colour[p8]
  opcode left[p16] top[p16] auxopcode[8] right[p16] bottom[p16] color[p8]


===Operation===
===Operation===
Draws a solid box on the backbuffer from (left, top) to (right, bottom) in the given colour.
Draws a solid box on the backbuffer from (left, top) to (right, bottom) in the given color.


The only part of auxopcode that is relevant are the parameter bits. The rest of the opcode is ignored. However, the aux opcode's initial value is $05.
The only part of auxopcode that is relevant are the parameter bits. The rest of the opcode is ignored. However, the aux opcode's initial value is $05.
Line 1,039: Line 1,039:
sub-opcodes
sub-opcodes
  $00 xpos[p16] ypos[p16]
  $00 xpos[p16] ypos[p16]
  $01 colour[p8]
  $01 color[p8]
  $02 right[p16]
  $02 right[p16]
  $03 width[p16] height[p16]
  $03 width[p16] height[p16]
Line 1,057: Line 1,057:
|$00||SO_AT||Sets the position of the text that follows.
|$00||SO_AT||Sets the position of the text that follows.
|-
|-
|$01||SO_COLOR||Sets the colour of the text.
|$01||SO_COLOR||Sets the color of the text.
|-
|-
|$02||SO_CLIPPED||Clips the text's right-hand side (for wrapping?).
|$02||SO_CLIPPED||Clips the text's right-hand side (for wrapping?).
Line 1,225: Line 1,225:
  $06
  $06
  $07 scale1[p8] y1[p8] aux scale2[p8] y2[p8] aux slot[p8]
  $07 scale1[p8] y1[p8] aux scale2[p8] y2[p8] aux slot[p8]
  $08 scale[p8] startcolour[p8] endcolour[p8]
  $08 scale[p8] startcolor[p8] endcolor[p8]
  $09 loadflag[p8] loadslot[p8]
  $09 loadflag[p8] loadslot[p8]
  $0A effect[p16]
  $0A effect[p16]
  $0B redscale[p16] greenscale[p16] bluescale[p16] aux startcolour[p8] endcolour[p8]
  $0B redscale[p16] greenscale[p16] bluescale[p16] aux startcolor[p8] endcolor[p8]
  $0C redscale[p16] greenscale[p16] bluescale[p16] aux startcolour[p8] endcolour[p8]
  $0C redscale[p16] greenscale[p16] bluescale[p16] aux startcolor[p8] endcolor[p8]
  $0D resID[p8] filename[c]... $00
  $0D resID[p8] filename[c]... $00
  $0E resID[p8] filename[c]... $00
  $0E resID[p8] filename[c]... $00
Line 1,268: Line 1,268:
|$0F||SO_ROOM_TRANSFORM||Manipulates palettes, strings?
|$0F||SO_ROOM_TRANSFORM||Manipulates palettes, strings?
|-
|-
|$10||SO_CYCLE_SPEED||Starts colour cycling with delay? colIndex is between 0 and 16
|$10||SO_CYCLE_SPEED||Starts color cycling with delay? colIndex is between 0 and 16
|}
|}


Line 1,276: Line 1,276:


Small header games (V3 and V4) include an extra sub-opcode, $02 (SO_ROOM_COLOR), which adjusts the room's palette:
Small header games (V3 and V4) include an extra sub-opcode, $02 (SO_ROOM_COLOR), which adjusts the room's palette:
  opcode $02 colour[p16] index[p16]
  opcode $02 color[p16] index[p16]
  ... or for V3 games ...
  ... or for V3 games ...
  opcode colour[p16] index[p16] $02
  opcode color[p16] index[p16] $02


In small header games, sub-opcode $04 (SO_ROOM_PALETTE) affects the shadow palette, and only accepts two arguments, a "room colour slot" (palette entry? between 0 and 256) and an index:
In small header games, sub-opcode $04 (SO_ROOM_PALETTE) affects the shadow palette, and only accepts two arguments, a "room color slot" (palette entry? between 0 and 256) and an index:
  opcode $04 colour[p16] index[p16]
  opcode $04 color[p16] index[p16]
  ... or for V3 games ...
  ... or for V3 games ...
  opcode colour[p16] index[p16] $04
  opcode color[p16] index[p16] $04


In FM-Towns games, sub-opcode $0A performs a different function and has its own sub-opcodes (some unknown and all not yet implemented in ScummVM):
In FM-Towns games, sub-opcode $0A performs a different function and has its own sub-opcodes (some unknown and all not yet implemented in ScummVM):
Line 1,696: Line 1,696:
  $01 object[p16]
  $01 object[p16]
  $02 name[c]... $00
  $02 name[c]... $00
  $03 colour[p8]
  $03 color[p8]
  $04 hicolour[p8]
  $04 hicolor[p8]
  $05 left[p16] top[p16]
  $05 left[p16] top[p16]
  $06
  $06
Line 1,703: Line 1,703:
  $08
  $08
  $09
  $09
  $10 colour[p8]
  $10 color[p8]
  $11
  $11
  $12 key[p8]
  $12 key[p8]
Line 1,709: Line 1,709:
  $14 stringID[p16]
  $14 stringID[p16]
  $16 object[p16] room[p8]
  $16 object[p16] room[p8]
  $17 colour[p8]
  $17 color[p8]


===Operation===
===Operation===
Line 1,720: Line 1,720:
|$02||SO_VERB_NAME||Assigns the in-line name to the verb slot.
|$02||SO_VERB_NAME||Assigns the in-line name to the verb slot.
|-
|-
|$03||SO_VERB_COLOR||Sets the colour of the verb.
|$03||SO_VERB_COLOR||Sets the color of the verb.
|-
|-
|$04||SO_VERB_HICOLOR||Sets the highlight colour of the verb.
|$04||SO_VERB_HICOLOR||Sets the highlight color of the verb.
|-
|-
|$05||SO_VERB_AT||Sets the verb's top-left co-ordinates.
|$05||SO_VERB_AT||Sets the verb's top-left co-ordinates.
Line 1,734: Line 1,734:
|$09||SO_VERB_NEW||Creates a verb in the slot for the given verbID. If the slot is 0 (verb doesn't already exist), will add it to the next unusued slot; if this exceeds the global maximum number of verbs an error will be raised.
|$09||SO_VERB_NEW||Creates a verb in the slot for the given verbID. If the slot is 0 (verb doesn't already exist), will add it to the next unusued slot; if this exceeds the global maximum number of verbs an error will be raised.
|-
|-
|$10||SO_VERB_DIMCOLOR||Sets the dim colour of the verb.
|$10||SO_VERB_DIMCOLOR||Sets the dim color of the verb.
|-
|-
|$11||SO_VERB_DIM||Dims this verb.
|$11||SO_VERB_DIM||Dims this verb.
Line 1,746: Line 1,746:
|$16||Assign Object||Assigns an object from the given room to the verb (if the object's image index is not already assigned to the given object).
|$16||Assign Object||Assigns an object from the given room to the verb (if the object's image index is not already assigned to the given object).
|-
|-
|$17||Set Back Colour||Sets the background colour of the verb?
|$17||Set Back Color||Sets the background color of the verb?
|}
|}


2,051

edits