STOS.MBK

From Atari Wiki
Revision as of 09:36, 10 July 2007 by Nyh (talk | contribs)
Jump to navigation Jump to search

STOS .MBK file structure

MBK_HEADER:
{
 10 bytes  Magic "Lionpoubnk": STOS memory bank
  1 long   Memorybank number (1-15)
  1 byte   Banktype
  3 byte   Size, might be rounded to the next 256 byte multiple
___+
 18 byte   total size header
}

Banktype:

$01 work          
$02 screen        
$81 data          
$82 datascreen
$83 bank with executable subroutines?
$84 set
$85 packed files

For banktype $81, data, the following magics have been found:

$003d2067  blocks, tile.mbk
$02528e54  missing link map#1
$03031973  missing link map#2
$06071963  packed screen
$07793868  missing link blocks
$0858b8c1  digisound
$091e0000  soundfile
$13490157  STOS music bank
$18e7074c  missing link blocks
$19861987  STOS sprite bank
$28091960  STOS icon bank
$38964820  missing link bobs
$3f092f08  asm music player
$41544d35  ATOMIC packed file
$416D426B  Sound file 'AmBk'
$43410100  packed crackart file
$49434521  Ice 2.4 packed file
$49636521  Ice 2.1 packed file
$494d4147  IMAG file
$4A4F4E??  Sound sample 'JON'
$4d414553  STOS Maestro! file
$544E5920  TINY pack screen
$60??????  lots of executable files
$60626000  music
$60346000  music
$60626000  music
$60786000  music
$607A6000  music
$61000074  music
$6D6F64??  mod

For banktype $84, set, the following magics have been found:

$06071963  character set

For banktype $85, ??, the following magics have been found:

$02528e54  map, same as missing link map#1
$41544d35  Atomik 3.5 packed memory bank
$49636521  Ice 2.4 packed memory bank



Banktype $02, screen

32000 bytes screen data
   16 words palette
  736 bytes free usable



Banktype $81, data, magic $003d2067, blocks, tile.mbk It seems ths file always contains 32 shifted sprites

   18 Byte   MBK_HEADER
    1 long   magic $003d2067
    1 word   ??
   16 word   palette
32
{
   64 word   block data 16x16 4 pitplanes
}

Banktype $81, data, magic $02528e54, missing link map#1

   18 Byte   MBK_HEADER
    1 long   magic $02528e54
    1 word   2*(x_size-1)
    1 word   2*(y_size)

x_size*y_size
{
    1 word   map data, block_numer<<8
}

Banktype $81, data, magic $03031973, missing link map#2

 18 Byte   MBK_HEADER
  1 long   magic $03031973
  1 word   2*(x_size-1)
  1 word   2*(y_size)

x_size*y_size
{
  1 word   map data, block_number<<7
}


Banktype $81, data, magic $06071963, packed screen

   18 Byte   MBK_HEADER
    1 long   magic $06071963
    1 word   resolution: 0=low, 1=med, 2=high
    1 word   x_offset (words)
    1 word   y_offset (pixels)
    1 word   x_size (words, per 16 pixels)
    1 word   y_blocks
    1 word   unused
    1 word   block_size, y_block*block_size = y_size
    1 word   flags
    1 long   offset of table2, relative to magic
    1 long   offset of pointers2, relative to magic
   16 words  palette
   ?? bytes  compressed data

Banktype $81, data, magic $07793868, missing link blocks 16x16 sprites in a 32x16 raster, sprites are preshifted in the file.

   18 Byte   MBK_HEADER
    1 long   magic $07793868
    1 word   unknown
    1 word   nr_of_sprites*256
   16 word   colors
4 x nr_of_sprites
{
  256 bytes   sprite data, 32x16, preshifted
}

Banktype $81, data, magic $0858b8c1, digisound

   18 Byte   MBK_HEADER
    1 long   magic $0858b8c1
   ?? word   unknown

Banktype $81, data, magic $13490157, STOS music bank

Structure of the Music Bank

Offset         Meaning
   0           Music Bank ID code ($13490157)
   4           Offset  from start of the bank to music number  1. 
               Set to zero if no music with this number.
   8           Offset to music number 2....
   124         Offset to music number 32 (Maximum of 32 pieces of 
               music)
   128         Length of this memory bank
   132         Name of music 1 (8 letters)
   140         Name of music 2 (8 letters).....
   380         Name of music 32 (8 letters)
   388         Start of music 1...

Inside the music definitions

Offset         Meaning             
   0           ID code that this is music data. ($19631969)
   6           Offset to music in voice 1.
   8           Offset to music in voice 2.
   10          Offset to music in voice 3.
   12          Definition  of  first tremelo/envelope  (36  bytes 
               long)
   48          Definition of second trememlo/envelope

   Start of voice 1

The Music Commands

Each note is stored as a teo-byte word ranging from 0-32767.  The 
lower  half of this word contains the pitch of the  note  (0-96). 
See PLAY for more details. The upper byte holds the length of the 
note in 50ths of a second.  The Music commands are held in either 
two  or  four bytes.  In order to distinguish  them  from  normal 
notes,  the highest bit of these commands is set to 1.  Here is a 
list  of the various commands and the numbers used  to  represent 
them in the music.

Number         Size       Command       Meaning
$8000          2 bytes    END           Signifies   the  end   of 
                                        music for this voice
$A000          2 bytes    MUSIC         Use pure tones for music.
$A100          2 bytes    NOISE ONLY    Use noise for music.
$A200          2 bytes    STOP NOISE    Turns off noise.
$A3xx          2 bytes    NOISE xx      Plays noise with pitch xx
$A400          2 bytes    STOP NTREMULO Stop mixing tremulo  with 
                                        noise
$A500          2 bytes    STOP ENVEL    Stop    using     current 
                                        envelope
$A600          2 bytes    STOP TREMOLO  Stop    using     current 
                                        tremolo
$A7xx          2 bytes    VOLUME xx     Set volume of sound to xx
$C000          4 bytes    NTREMULO      Mix  TREMULO with  noise. 
                                        Bytes 2&3 hold offset  to 
                                        tremulo definition
$C100          4 bytes    ENVEL xx      Use ENVEL xx.  Bytes  2&3 
                                        hold  offset to  envelope 
                                        definition
$C200          4 bytes    TREMULO xx    Use TREMULO xx. Bytes 2&3 
                                        hold  offset  to  tremulo 
                                        definition.
$C3nn          4 bytes    REPEAT  nn,note  Repeat music  starting 
                                        from note, nn times. Note 
                                        held in bytes 2&3.

Banktype $81, data, magic $18e7074c, missing link blocks, 16x16 sprites

   18 Byte   MBK_HEADER
    1 long   magic $18e7074c
    1 word   unknown
    1 word   nr_of_sprites*256
   16 word   colors
nr_of_sprites
{
  128 bytes   sprite data 16x16
}

Banktype $81, data, magic $19861987, STOS sprite bank

   18 Byte   MBK_HEADER
    1 long   magic $19861987
    1 long   offset (relative to first position after the magic long)
             to low resolution sprite parameter block, points past end
             of Bank if none.
    1 long   offset (relative to first position after the magic long)
             to medium resolution sprite parameter block, points past end
             of Bank if none.
    1 long   offset (relative to first position after the magic long)
             to high resolution sprite parameter block, points past end
             of Bank if none.
    1 word   number of low resolution sprites
    1 word   number of medium resolution sprites
    1 word   number of high resolution sprites
   ?? word   could be there
number of sprites
{
Sprite Parameter Block
    1 long   4-byte offset to sprite data, relative to start of 
             _FIRST_ sprite parameter block for current resolution
    1 byte   Width of sprite (in units of 16)
    1 byte   Height of sprite (lines)
    1 byte   X coordinate of hotspot
    1 byte   Y coordinate of hotspot
}
   ?? word   could be there
   ?? word   sprite parameter blocks for other resolutions
    1 long   magic PALT
   16 word   palette data
   ?? word   could be there
total numer of sprites
{
Height of sprite
{
Width of sprite
{
    1 word   mask data
}
Width of sprite
{
    ? word  sprite data, 4 lowres, 2 med res, 1 high res
}
}
}

Banktype $81, data, magic $28091960, STOS icon bank Sprite data has same format as the LINE-A sprites

   18 Byte   MBK_HEADER
    1 long   magic $28091960
    1 word   number of icons in bank
number_of_icons
{
    1 word   x_hotspot
    1 word   y_hotspot
    1 word   form; 1: vid-format, -1 XOR format
    1 word   bgcol
    1 word   fgcol
   32 word   image, 32x16, 1 word mask, 1 word data
    5 word   ??
}

Banktype $81, data, magic $38964820, missing link bobs

   18 Byte   MBK_HEADER
    1 long   magic $38964820
    1 word   number of bobs
   16 word   palette
number_of_bobs
{
    1 long   offset from start of magic to sprite data
}

number_of_sprites
{
sprite data:
     1 word  x_size
     1 word  y_size
     1 word  ??
     1 word  ??
     1 word  ??
x_size/16
{
y_size
{
     2 word  mask
     4 word  sprite
}
}
}

Banktype $81, data, magic $3f092f08 asm music player

   18 Byte   MBK_HEADER
    1 long   magic $60626000
   ?? word   music data

Banktype $81, data, magic $41544d35 Atomik 3.5 packed memory bank

   18 Byte   MBK_HEADER
    1 long   magic $41544d35
   ?? byte   Atomik 3.5 data, see Atomic 3.5 format

Banktype $81, data, magic $43410100 Crac art packed screen

   18 Byte   MBK_HEADER
    1 long   magic $43410100 'CA'
   ?? byte   Crackart data, see Crackart format

Banktype $81, data, magic $49434521 Ice 2.4 packed memory bank

   18 Byte   MBK_HEADER
    1 long   $49434521
   ?? byte   Ice 2.4 data, see Ice 2.4 format

Banktype $81, data, magic $49636521 Ice 2.1 packed memory bank

   18 Byte   MBK_HEADER
    1 long   $49636521
   ?? byte   Ice 2.4 data, see Ice 2.4 format

Banktype $81, data, magic $494d4147, IMAG! file

   18 Byte   MBK_HEADER
    1 long   magic $494d4147 (IMAG)
    1 long   magic $54524f21 (PALT)
   16 word   palette
    1 long   number of preshifts
    1 long   ??
    1 long   ??
    1 long   size of single sprite
    1 word   number of sprites

number of preshifts
{
number of sprites
{
    1 long   magic $44553528
    1 word   x_size (pixels)
    1 word   y_size
   ?? word   sprite data
}
}

Banktype $81, data, magic $4d414553, STOS Maestro! file Sampled music data

   18 Byte   MBK_HEADER
    1 long   magic $4d414553 (MAES)
    1 long   magic $54524f21 (TRO!)
   ?? word   music data

Banktype $81, data, magic $53544552, (stereo) Sample file Sampled music data

   18 Byte   MBK_HEADER
    1 long   magic $53544552 (STER)
    1 long   magic $454fff1d (EO..)
   ?? word   music data

Banktype $81, data, magic $544E5920 Tiny packed screen

   18 Byte   MBK_HEADER
    1 long   magic $544E5920 'TNY '
   ?? byte   Tiny data, see Tiny format

Banktype $81, data, magic $6???????, music Magic header is header of the music subroutine:

$60626000  music
$60346000  music
$60626000  music
$60786000  music
$607A6000  music
$61000074  music

   18 Byte   MBK_HEADER
    1 long   magic
   ?? word   music data

Banktype $82, screen

32000 bytes screen data
   16 words palette
  736 bytes free usable

Banktype $84, set, magic $06071963, character set

   18 byte   MBK_HEADER
    1 long   magic $06071963
    1 word   x_size in bytes
    1 word   y_size in lines
   32 bytes  unknown, zero
  224 bytes  characterset $00 to $DF
  224*x_size*y_size bytes character data, starting with char 32, space
<pre>
Without the MBK_HEADER the file is equal to STOS *.CR? files.

----

Banktype $85, ??, magic $02528e54, same as missing link map#1
<pre>
   18 Byte   MBK_HEADER
    1 long   magic $02528e54
    1 word   2*(x_size-1)
    1 word   2*(y_size)

x_size*y_size
{
    1 word   map data, block_numer<<8
}

Banktype $85, ??, magic $41544d35 Atomik 3.5 packed memory bank

   18 Byte   MBK_HEADER
    1 long   magic $41544d35
   ?? byte   Atomik 3.5 data, see Atomic 3.5 format

Banktype $85, ??, magic $49434521 Ice 2.4 packed memory bank

   18 Byte   MBK_HEADER
    1 long   $49434521
   ?? byte   Ice 2.4 data, see Ice 2.4 format