Skip to content

Scumm 7 data format

Alban Bedel edited this page Apr 5, 2015 · 1 revision

1. Index file

RNAM : room names

Seems identical to v6.

MAXS : maximal address for ...

  engine version  : 50*8
  game version    : 50*8
  max var         : 16le
  max bit var     : 16le
  unk             : 16le
  max global objs : 16le
  max local objs  : 16le
  max new names   : 16le
  max verb        : 16le
  max fl objs     : 16le
  max inv         : 16le
  max arrays      : 16le
  max room        : 16le
  max scr         : 16le
  max snds        : 16le
  max chst        : 16le
  max cost        : 16le

There is now up to 2000 global scripts instead of 200 in v6.

DROO : room index

DSCR : script index

DSOU : sound index

DCOS : costume index

DCHR : charset index

All these are identical to v6.

DOBJ : object index

  num obj    : 16le
  states     : 8*num obj
  rooms      : 8*num obj
  classes    : 32le*num obj

AARY : pre-allocated arrays

Identical to v6.

ANAM : audio names

  num files  : 16le
  filenames  : 9*8*num files

2. Data file

2.1 Structure

TODO: Basicaly similar to v6

2.2 Blocks

2.2. RMHD

  version      : 32le
  width        : 16le
  height       : 16le
  num object   : 16le

2.2. IMHD

  version      : 32le
  obj id       : 16le
  num imnn     : 16le
  x            : 16le signed
  y            : 16le signed
  width        : 16le
  height       : 16le
  num zpnn     : 16le
  unk          : 8
  actor dir    : 8
  num hotspots : 16le (usually one for each IMnn, but there is one even
                       if no IMnn is present)
  hotspots
    x          : 16le signed
    y          : 16le signed

2.2. CDHD

  version      : 32le
  id           : 16le
  parent       : 8
  parent state : 8

2.2. LSCR

  id           : 16le (local script IDs start at 2000)
  data

3. NUT files

NUT files are used to store fonts (and animations?)

3.1 Structure

  • ANIM file block
    • AHDR anim header
    • AFMR anim frame
      • FOBJ frame object

3.2 Blocks

3.2.1 AHDR

  unk          : 16 (version?)
  num frames   : 16le
  unk2         : 16
  palette      : 8*3*255

3.2.1 FOBJ

  codec        : 16le
  x offset     : 16le
  y offset     : 16le
  width        : 16le
  height       : 16le
  unk          : 32
  image data

3.3 Codecs

3.3.1 Codec1

  for(y = 0 ; y < h ; y++) {
    line_size = read_16le();
    x = 0;
    while(line_size > 0) {
      code = read_byte();
      line_size--:
      length = (code>>1)+1;
      if(code & 1) {
        line_size--;
        write_pixels(x,y,read_byte(),length);
        x += length;
      } else {
        line_size -= length;
        while(length > 0) {
          write_pixel(x,y,read_byte());
          x++, length--;
        }
      }
    }
  }