#00 Reset flags
      Data bit  Command bit.
    SC #00
    WC
    (Data bit=0, Command bit=0)

#01 Set silence (*)
         #80.    .

    SC #01
    WC

#02 Set low volume (*)
     x     .

    SC #02
    WC

#03 Set high volume (*)
          .

    SC #03
    WC

#04 Set 'E' 3bits (*)
      'E'  GS 3       -
      (2              
    #00-#03).

    SD Chan (#00-#07)
    SC #04
    WC

#05 Out volume port (*)
      ,     'E',  -
     . (   ,   'E'  
     #00-#03)

    SD Volume (#00-#3F)
    SC #05
    WC

#06 Send to DAC (*)
        ,   'E'.

    SD Byte
    SC #06
    WC

#07 Send to DAC and to volume port (*)
        ('E')   .

    SD Byte
    SC #07
    WC
    SD Volume
    WD

#08 -      #00

#09 Sets one's byte volume. (*)
      ,     2  .

    SD Byte (ccvvvvvv)
    SC #09
    WC

    cc -  
    vvvvvv -  

#0A DAC output (*)
         .

    SD Byte
    SC #0A
    WC
    SD Chan (#00-#03)
    WD

#0B DAC and Volume output (*)
            .

    SD Fbyte
    SC #0B
    WC
    SD Sbyte (ccvvvvvv)
    WD

      Sbyte    .#09)

     #01  - #0B        Covox'
     ,         -
     GS.

    vvvvvv -  

#0C Call SounDrive Covox mode (*)
       ,    -
       .          
     .

    SD CH1
    SC #0C
    WC
    SD CH2
    WD
    SD CH3
    WD
    SD CH4
    WD

#0D Call Ultravox mode (*)
       ,       -
       ,     (1-4).  
        .    -
         .

    SD CHANS
    SC #0D
    WC

    SD CH1
    SD CH2
    SD CH3
    SD CH4

    CHANS (4-  )        -
            .  
    ,           
    (  :)


#0E Go to LPT Covox mode
        ,       
        (  ) .      -
     #00   .

    SC #0E
    WC

    SD  \
    SD   \
    ...      
        /
    SD  /

    SC #00
    WC

#0F Go in Profi Covox mode (*)
        ,       
        ,          .
        -  #4   ,    -
     #0F  #AA   .

    SD #59
    SC #0F
    WC

    SD  \
    SC   \
    SD    \
    SC         
    ...   /
    SD   /
    SC  /

    SD #4E
    WD
    SC #0F
    WC
    SC #AA
    WC

#10 Output to any port (*)
      o   GS (#00-#09).

    SD Port
    SC #10
    WC
    SD Data
    WD

#11 Input from any port (*)
         GS (#00-#09).

    SD Port
    SC #10
    WC
    GD Data
    WN

#12 OUT to 0 port (*) (Out to page register)
         GS (#00).

    SD Data
    SC #12
    WC

#13 Jump to Address (*)
        .

    SD ADR.L
    SC #13
    WC
    SD ADR.H
    WD

#14 Load memory block (*)
            .

    SD LEN.L
    SC #14
    SD LEN.H
    WD
    SD ADR.L
    WD
    SD ADR.H

    SD \
    WD  \
    SD   \
    WD        LEN
    ...  /
    SD  /
    WD /

#15 Get memory block (*)
            .

    SD LEN.L
    SC #15
    SD LEN.H
    WD
    SD ADR.L
    WD
    SD ADR.H

    GD \
    WN  \
    GD   \
    WN        LEN
    ...  /
    GD  /
    WN /

#16 Poke to address (*)
         .

    SD ADR.L
    SC #16
    WC
    SD ADR.H
    WD
    SD Byte
    WD

#17 Peek from address (*)
         .

    SD ADR.L
    SC #17
    WC
    SD ADR.H
    WD
    GD Byte
    WN

#18 Load DE Pair (*) (Set memory pointer)
       DE (  GS,      -
      Main CPU)  .

    SD B.E
    SC #18
    WC
    SD B.D
    WD

#19 Poke to (DE) address (*)
          DE.

    SD Byte
    SC #19
    WC

#1A Peek from (DE) address (*)
      ,   DE.

    SC #1A
    WC
    GD Byte
    WN

#1B Increment of DE Pair (*)
      DE  .

    SC #1B
    WC

#1C Poke to (#20XX) address (*) (Put byte to system area)
       ,     #20.

    SD ADR.L
    SC #1C
    WC
    SD Byte
    WD

#1D Peek from (#20XX) address (*) (Get byte from system area)
       ,     #20.

    SD ADR.L
    SC #1D
    WC
    GD Byte
    WN

#1E - #1F .()

#20 Get total RAM (Get memory size)
          GS. (    112)

    SC #20
    WC
    GD RAM.L( )
    WN
    GD RAM.M( )
    WN
    GD RAM.H( )

Total RAM=65536*RAM.H+256*RAM.M+RAM.L

#21 Get free RAM
      '    GS.

    SC #20
    WC
    GD RAM.L( )
    WN
    GD RAM.M( )
    WN
    GD RAM.H( )

 Free_RAM=65536*RAM.H+256*RAM.M+RAM.L

#22


#23 Get number of RAM Pages
         GS.

    SC #23
    WC
    GD Number_RAM_Pages

       3 .

#24 - #29 .

#2A Set Module Master Volume
       .

    SD Module_Master_Volume [#00..#40]
    SC #2A
    WC
    [GD Old_Master_Volume] -  .

        :

    (,   )

           LD B,#40

     LOOP: LD A,B
           OUT (GSDAT),A
           LD A,#2A
           OUT (GSCOM),A
           EI
           HALT
           DJNZ LOOP

           LD A,#32
           OUT (GSCOM),A

       ,   -
 .

#2B Set FX Master Volume
       .

    SD FX_Master_Volume [#00..#40]
    SC #2B
    WC
    [GD Old_FX_Volume] -  

    ,    .

             
,  ..

#2C Set Current Module
     .
      .  CURMOD -
     .

#2D Set Current Sample
     .
      .  CURSMP -
     .

#2E Set Current FX
      .    CURFX  -
    .  -     (sample handle), 
          #00    -
         CURFX. (.  #38, #39, #40-#4F
      .)

    SD Cur_FX
    SC #2E
    WC

#30 Load Module
       .

    SC #30
    WC
   [GD Module_Handle]- 
   (Command bit=0, Data bit=0)
    SC #D1 (Open Stream- )
    WC

    SD \
    WD  \
    ...    
    SD  /
    WD /

    SC #D2 (Close Stream- )
    WC

    :
             LD HL,Mod_adress
             LD DE,0-Mod_length
             LD C,GSCOM

             LD A,#30
             CALL SENDCOM
             LD A,#D1
             CALL SENDCOM

             LD A,(HL)
     LOOP:   IN B,(C)
             JP P,READY
             IN B,(C)
             JP M,LOOP
     READY:  OUT (GSDAT),A
             INC HL
             LD A,(HL)
             INC E
             JP NZ,LOOP
             INC D
             JP NZ,LOOP
     WAIT:   IN B,(C)  ; 
             JP M,WAIT ; 
             LD A,#D2
             CALL SENDCOM
             IN A,(GSDAT) ;  
             OUT (GSDAT),A
             LD A,#31

    SENDCOM: OUT (GSCOM),A
    WAITCOM: IN A,(GSCOM)
             RRCA
             JR C,WAITCOM
             RET

#31 Play module
     .

    SD Module_Handle -  
    SC #31
    WC

#32 Stop module
      .

    SC #32
    WC

#33 Continue module
        .

    SC #33
    WC

#35 Set Module Volume
       .

    SD Module_Master_Volume [#00..#40]
    SC #35
    WC
   [GD Old_Master_Volume] -  .

#36 Data on (*)
        #FF.

    SC #36
    WC
   [GD Data (#FF) ]

#37 Reinitialisation (*)
         .

    SC #37
    WC

#38 Load FX
        .    (PC type)

    SC #38
    WC
   [GD FX_Handle]- 
   (Command bit=0, Data bit=0)
    SC #D1 (Open Stream- )
    WC

    SD \
    WD  \
    ...    
    SD  /
    WD /

    SC #D2 (Close Stream- )
    WC

     ,   GS     -
,      .   
    ,  :

  Note=60,    Volume=#40,    FineTune=0,    SeekFirst=#0F,    SeekLast=#0F,
Priority=#80,  No Loop    CurFX  
FX_Handle.

    #40, #41, #42, #45, #46  #47     -
   .       #39   
       .

          ,  
   ,      Delta-,   ..
    ,        -
  .             
Delta-:

            LD HL,Start_of_sample
            LD DE,0-Length_of_sample
            LD C,#00

      LOOP: LD A,(HL)
            SUB C
            LD C,(HL)
            LD (HL),A
            INC E
            JP NZ,LOOP
            INC D
            JP NZ,LOOP

         :

             LD IX,Parameters
             LD HL,Sample_adress
             LD DE,0-Sample_length
             LD C,GSCOM

             LD A,#38
             CALL SENDCOM
             LD A,#D1
             CALL SENDCOM

             LD A,(HL)
     LOOP:   IN B,(C)
             JP P,READY
             IN B,(C)
             JP M,LOOP
     READY:  OUT (GSDAT),A
             INC HL
             ADD A,(HL)
             INC E
             JP NZ,LOOP
             INC D
             JP NZ,LOOP
     WAIT:   IN B,(C)  ; 
             JP M,WAIT ; 
             LD A,#D2
             CALL SENDCOM

      ;   
      ;    
      ; 

             LD A,(IX+#00)
             OUT (GSDAT),A  ; 
             LD A,#40
             CALL SENDCOM
             LD A,(IX+#01)
             OUT (GSDAT),A  ; 
             LD A,#41

    SENDCOM: OUT (GSCOM), A
    WAITCOM: IN A,(GSCOM)
             RRCA
             JR C,WAITCOM
             RET

#39 Play FX
     .

    SD FX_Handle -  
    SC #39
    WC

       :  ,  -
  SeekFirst   ,   -    -
,      ,       ,
  SeekLast      ,       ,
  ,    ,   SeekLast,  
          
  (   ,     ),    
    ,   ,    ,
      ,         
    .     ...

      ,   ,   ..  -
        .

    ,  -     ,   
          -
 #39.     ,     -
:  #2E    ,    #4x  -
  ,       #39.

        #80..#9F,  
        ,     
  ,    ,       
 /    .

#3A Stop FX in channels
         ,   -
        (Channel Mask).      n-    -
      ,    n-   

    SD Channel_Mask
    SC #3A
    WC

         ,   -
       ,      ,   -
:    7     ,  ..  -
    ,       -
     #FF.

#3D Set FX Volume
       .

    SD FX Volume [#00..#40]
    SC #3D
    WC
   [GD Old_FX_Volume] -  

#3E Load FX (Extended version)
        .     .
    (Amiga type)

    SD #01 (Signed sample)
    SC #3E
    WC
   [GD FX_Handle]- 
   (Command bit=0, Data bit=0)
    SC #D1 (Open Stream- )
    WC

    SD \
    WD  \
    ...    
    SD  /
    WD /

    SC #D2 (Close Stream- )
    WC

#40 Set FX Sample Playing Note
          .

    SD Note [0..95]
    SC #40
    WC

Note=
 0 C-0
 1 C#0
12 C-1
24 C-2
36 C-3 (C-1  )
48 C-4 (C-2  )
60 C-5 (C-3  )
72 C-6
84 C-7

     Sound Generators Wave 2,  3    3,
4  5,      Note    36
 71.

#41 Set FX Sample Volume
          .

    SD FX_Volume [#00..#40]
    SC #41
    WC

#42 Set FX Sample Finetune
     Finetune     .

    SD FX_Finetune [#00..#40]
    SC #42
    WC

#43 - #44 .

#45 Set FX Sample Priority
        . (.  #39)

    SD FX_Priority [#01..#fe]
    SC #45
    WC

#46 Set FX Sample Seek First parameter
      Seek First   . (.  #39)

    SD FX_SeekFirst
    SC #46
    WC

#47 Set FX Sample Seek Last parameter
      Seek Last   . (.  #39)

    SD FX_SeekLast
    SC #47
    WC

#48 Set FX Sample Loop Begin (*)
         .

    SD LEN.L
    SC #48
    WC
    SD LEN.M
    WD
    SD LEN.H
    WD

      LEN.H - #FF   

#49 Set FX Sample Loop End (*)
         .

    SD LEN.L
    SC #49
    WC
    SD LEN.M
    WD
    SD LEN.H
    WD

#4A - #4F .

#51 - #5F .

#60 Get Song Position
       Song_Position   .

    SC #60
    WC
    GD Song_Position  [#00..#FF]

        .  -
     0          
  .       
      .    
,  ,        SC  #60,
      ,   
 .. (..       ),  -
    179 (GD Song_Position),      -
 ,   ,     , ..

  if (Song_Position==My_Position)
  then goto Next_Part_Of_Demo

#61 Get Pattern Position
       Pattern_Position   .

    SC #61
    WC
    GD Pattern_Position  [#00..#3F]

       ( ROW),  - -
  ,   ,    -
  ,  

 if (Pattern_Position>=My_Position) then goto Next_Part_Of_Demo

#62 Get Mixed Position
      Pattern_Position,    Song_Position.

    SC #62
    WC
    GD Mixed_Position

    Mixed_Position: ( )

    7-Song_Position.1
    6-Song_Position.0
    5-Pattern_Position.5
    4-Pattern_Position.4
    3-Pattern_Position.3
    2-Pattern_Position.2
    1-Pattern_Position.1
    0-Pattern_Position.0

  .   Mixed_Position     AND #3F,     
 Pattern_Position,        RLCA,   RLCA,
AND #02 -       Song_Position. .   -
 #60  #61.

#63 Get Channel Notes
        .

    SC #63
    WC
    GD Note_of_channel_0
    WN
    GD Note_of_channel_1
    WN
    GD Note_of_channel_2
    WN
    GD Note_of_channel_3

    -         -
  #63,   7  

            Note_of_channel_N

  ,       ,    ,   
   .          0  95;
    127,    ,      
 .          -
  .

#64 Get Channel Volumes
        .

    SC #64
    WC
    GD Volume_of_channel_0
    WN
    GD Volume_of_channel_1
    WN
    GD Volume_of_channel_2
    WN
    GD Volume_of_channel_3

   .   #63

#65 Jump to position (*)
        .

    SD Position
    SC #65
    WC

#66 Set speed/tempo (*)
        #01-#1F.   #20-#FF -
      .     
      #06.

    SD Speed/Tempo
    SC #66
    WC

#67 Get speed value (*)
      .

    SC #67
    WC
    GD Speed
    WD

#68 Get tempo value (*)
      .

    SC #68
    WC
    GD Tempo
    WD

#6A - #7F .

#80 Direct Play FX Sample (#80..#83)
        .

    SD Sample_Number
    SC #80..#83 (     , 
                    ) WC

#88 Direct Play FX Sample (#88..#8B)
           .

    SD Sample_Number
    SC #88..#8B (     , 
                    ) WC SD Note [0..95] WD

#90 Direct Play FX Sample (#90..#93)
           .

    SD Sample_Number
    SC #90..#93 (     , 
                    )
    WC
    SD Volume [#00..#40]
    WD

#98 Direct Play FX Sample (#98..#9B)
             .

    SD Sample_Number
    SC #98..#9B (     ,    
                    )
    WC
    SD Note [0..95]
    WD
    SD Volume [#00..#40]
    WD

#B0 - #F0 .

    : ,   (*),   
            1.04.     
           (2)  
    .
    2.,   ( ),    , -
           GS     
        .

#F1 - #F2 .

#F3 Warm restart
      GS,         
        ,       -
    .

    SC #F3
    WC

#F4 Cold restart
      GS   .  , JP #0000.

    SC #F4
    WC

#F5 Busy on
        #FF

    SC #F5
    WC

#F6 Busy off
        #00

    SC #F6
    WC

    Busy=#00.      GS    
   .        -
  :

 1 if Command bit=0 then go to 1
 2 Execute Command
 3 if Command bit=1 then go to 2
 4 if Playing=0 then go to 1
 5 if Busy=#FF then go to 1
 6 Process Sound
 7 go to 1

    Busy       
             
    .       -
  :   (    
     ..)

#F7 Get HX Register (*)
       HX (GS)
    HX     Busy.

    SC #F7
    WC
    GD HX
    WN

#F8 - #F9 .

#FA Out zero_to_zero
        ()  GS.     
          .. .

    SC #FA

    WC

#FB - #FF .