Skip to content
Toni Mahagoni edited this page Dec 23, 2015 · 11 revisions

A script line consists of a list of conditionals, a list of actions, and a so called playlist consisting media file table indices.

A script line has the format aaaa conditionals... bbbb actions... cccc media... where

  • a is the number of conditionals. Each conditional consists of 8 bytes.
  • b is the number of actions. Each action is 7 bytes.
  • c is a playlist

Conditionals

The conditionals are of the format t1 aaaa cccc t2 bbbb

  • t1 & t2 (uint8) type of a and b resp. (0 == register, 1 == value)
  • a & b (uint16) value or id of register
  • c (uint16) is the comparison operator The rest of the line is only considered when the comparison between the register and the value or other register holds.

Comparison operators

Known comparison operators are:

  • FFF9 (written $r==m? in tttool's output and the yaml files): Equality
  • FFFA (written $r>m? in tttool's output): Greather than
  • FFFB (written $r<m? in tttool's output): Less than
  • FFFD (written $r>=m? in tttool's output): Greater or equal
  • FFFE (written $r<=? in tttool's output): Less or equal
  • FFFF (written $r!=m? in tttool's output): Not equal

Actions

The actions are of the format rrrr cccc tt mmmm

  • r (uint16) id of register
  • c (uint16) is the command
  • t (uint8) type of m (0 == register, 1 == value)
  • m (uint16) value or id of register

Commands

Known commands are:

  • FFF0 (written $r+=m): Increment register $r by m or value of $m
  • FFF1 (written $r-=m): Decrement register $r by m or value of $m
  • FFF2 (written $r*=m): Multiply register $r by m or value of $m
  • FFF3 (written $r%=m): Set register $r to $r mod m
  • FFF4 (written $r/=m): Set register $r to $r div m
  • FFF5 (written $r&=m): Bitwise add to register $r the value of m
  • FFF6 (written $r|=m): Bitwise or to register $r the value of m
  • FFF7 (written $r^=m): Bitwise xor to register $r the value of m
  • FFF8 (written Neg($r)): Negate register $r.
  • FFF9 (written $r:=m): Set register $r to m or value of $m
  • FFE0 (written P(): play one random sample of the media list
  • FFE1 (written P(): play all samples of the media list
  • FFE8 (written P(m)): Play audio referenced by the mth entry in the indices list.
  • FB00 (written P(b-a)): Play all samples from that inclusive range. a := lowbyte(m), b := highbyte(m)
  • FC00 (written P(b-a)): Play one random sample from that inclusive range. a := lowbyte(m), b := highbyte(m)
  • FD00 (written G(m)): Begin game m.
  • F8FF (written J(m)): Jump to script m.
  • FAFF (written C): Cancel game mode.

Currently unknown commands are FE00 and FF00 (in theory there can be more but these have been seen in the wild, at least).

The commands P, G , J and C seem to ignore their registers, C also its parameter (which always is FFFF).

Clone this wiki locally