These files store music written on Fuxoft AY Language (terminology and file header was got from RDOSPLAY documentation).
Fuxoft (Frantisek Fuka) designed this language.
Offset | Size | Name | Description |
---|---|---|---|
+0 | 4 | ID | Identifier 'FXSM' |
+4 | 2 | Addr | Data block allocation address in Z80 memory |
+6 | ? | Data | Data block |
Data block is original structure from software, in which this music is used.
Offset | Size | Name | Description |
---|---|---|---|
+0 | 2 | AddrA | Fuxoft AY Language program first byte address for channel A |
+2 | 2 | AddrB | Fuxoft AY Language program first byte address for channel B |
+4 | 2 | AddrC | Fuxoft AY Language program first byte address for channel C |
+6 | ? | Progs | Programs, subprograms on Fuxoft AY Language, samples, ornaments, and also (very seldom) subprograms on Z80 machine codes |
Programs and subprograms (as in any other program language) consist of sequence of commands. In this sequence can to select phrases. Phrase is totality of commands is needed for setting one note to playing. Note command and Silence command define the end of phrase.
16 words size stack is given to each channel for playing module. So, maximal number of subprograms calls from other subprograms is 16. Recursive calls are not allowed.
Sound off command. Byte parameter XX after this command code is number of interrupts, during which no sound in corresponding channel.
Sets note (number from 00 to 53) for playing during XX interrupts. AY tone register value 0FBF corresponds to note number 00 is note A of subcontroctave (if chip frequency is 1773400 MHz). Range between two closest notes is semitone.
Simple jump to address XXXX (Z80 JP command analog). Usually, this command ends main programs of corresponding channels (in this case it jumps to infinite loop command address).
Stores in stack address of next command and jumps to XXXX address (subprogram calling, Z80 CALL analog). Stack size is 16 words limited.
Stores in stack address of next command (loop point) and XX parameter (number of reiterations increased by 1). Program part from this loop point to command 83 will be repeated (XX – 1) times (reprise).
Reiterates (XX – 1) times from loop point is set by 82 XX command. This command pops from stack XX parameter and loop point address, decreases XX by 1, and, if it not equals to zero, stores both parameter and loop point address in stack and jump to loop point.
Parameter XX (00..1F) is AY noise register value.
Parameter XX (set/reset bit 0 for enable/disable ton, and same for bit 3 for noise, all other bits are zeros) sets value of AY mixer register of corresponding channel.
Parameter XXXX defines address of ornament for using with this phrase note (and by default will be used in next phrases).
Parameter XXXX defines address of sample for using with this phrase note (and by default will be used in next phrases; command 8A defines to continue play this sample from current position in it with next notes and command 8B defines to restart playing of this sample with next notes; by default, second described mode is on).
Sets transposition equal to XX semitones. XX is signed byte. By default, transposition is zero.
Pops address from stack and jump to it (Z80 RET analog).
Switch to mode during which setting of new notes do not allows to restart current sample playing (it simply continues to play from current position in this sample).
Switch to mode during which setting of new note restarts sample playing from its beginning (default mode).
Gives control to subprogram in Z80 machine codes. I met only one FXM, which uses this command, and its Z80 subprogram does nothing for sounding. Command 8C is not supported in Ay_Emul. I think Fuxoft designed this command to synchronize some visual effects with playing melody.
Addition to AY noise register current value by module 20 (or 10 in some versions, see Andsix parameter in AY-files description).
Addition to current transposition value in semitones.
Pushes current transposition value into channel stack.
Pops transposition value from channel stack.
Sample in this language has simple structure and controls amplitude of output signal only. As programs, sample is commands sequence.
Defines amplitude value in this and next interrupts (XX defines number of interrupts).
Defines amplitude value in only this interrupt (increased by 32).
Jumps to XXXX loop point of this sample.
Ornament is a bit compounder structure. It changes current frequency of tone register in current interrupt by given value.
Jumps to XXXX loop point of this ornament.
Directs that all ornament values are in semitones.
Directs taht all ornament values are in AY tone register units.
Inverts both AY mixer bits for corresponding channel.
Changes value of AY tone register by adding this addition (signed byte) to it. Can be in semitones or in tone register units (set by commands 82 and 83).