
 /* st.h
    - Include File for ST Support Routines -
    (c) 1994 by Andreas R. Kleinert
    Last changes : 17.05.1994
 */

 /* This Headerfile bases on a description of the MOD-Fileformat
    in "DOS Extra", issue 4/93, DMV-Verlag.
    The "spoken" description was translated into C-Source (Headerfile).
 */

#ifndef ST_H
#define ST_H

#ifndef LIBRARIES_IFFPARSE_H
#include <libraries/iffparse.h>     /* for MAKE_ID macro : I'm lazy ... */
#endif /* LIBRARIES_IFFPARSE_H */

#define ID_MK   MAKE_ID('M','.','K','.')
#define ID_FLT4 MAKE_ID('F','L','T','4')

struct STNote
{
 UBYTE stn_Tone1_HiNum;   /* Bits 0 .. 3 : Tone - 4 .. 7 : Instr-Num (high) */ 
 UBYTE stn_Tone2;         /* also Tone-value                                */
 UBYTE stn_Eff_LowNum;    /* Bits 0 .. 3 : Eff. - 4 .. 7 : Instr-Num (low)  */ 
 UBYTE stn_EffectOperand; /* effect operands (4 Bit = one operand)          */
};

struct STPattern
{
 struct STNote st_NoteLines [4][64]; /* 64 lines, each with 4 4-Byte Notes */
};

struct STInstrument
{
 UBYTE st_InstrumentName   [22];
 UWORD st_InstrumentLength;      /* length in WORDs */
 UBYTE st_FineTune;              /* -8 .. 8         */
 UBYTE st_Volume;                /*  0 .. 64        */
 UWORD st_LoopStart;
 UWORD st_LoopLength;
};

struct STHeader
{
 UBYTE               st_SongName    [20];   /* Name of Song                 */

 struct STInstrument st_Instruments [31];   /* Instrument data (usually 31) */

 UBYTE               st_PatternNum;         /* Song Length in Patterns      */
 UBYTE               st_CIAA_Speed;
 UBYTE               st_SongPatterns [128]; /* 128 Patterns (0-63)          */
 UBYTE               st_ID           [4];   /* "M.K.", "FLT4", ...          */
 
 /* Patterns : (filelength - headersize - samplesizes) / 1024 */
 /* Samples  : samplesize (add all InstrumentLength entries)  */

 /* EOF */
};

#endif /* ST_H */
