home *** CD-ROM | disk | FTP | other *** search
/ Fujiology Archive / fujiology_archive_v1_0.iso / !FALCON / ABSTRACT / MEGPL116.ZIP / MGPL-116 / REPLAY / TEST-MOD.S < prev    next >
Text File  |  1995-08-26  |  6KB  |  202 lines

  1. ***********************************************************************
  2. ***********                                        ***********
  3. ***********                                        ***********
  4. ***********  Routine de Test avec un module fait à la main    ***********
  5. ***********                                        ***********
  6. ***********                                        ***********
  7. ***********          Par Simplet / FATAL DESIGN            ***********
  8. ***********                                        ***********
  9. ***********************************************************************
  10.  
  11.             OPT        O+,OW-
  12.  
  13. ***********************************************************************
  14. ***********                Inits TOS                    ***********
  15. ***********************************************************************
  16.  
  17.         Section    TEXT
  18.  
  19. Start_Up    movea.l    4(sp),a5                ; BasePage Adress - Prg
  20.         lea.l    Stack,sp                ; Nouvelle Pile
  21.         movea.l    12(a5),a0                ; Text
  22.         adda.l    20(a5),a0                ; + Data
  23.         adda.l    28(a5),a0                ; + BSS
  24.         adda.w    #256,a0                ; + BasePage
  25.         pea.l    (a0)                    ; Length
  26.         pea.l    (a5)                    ; Adress
  27.         pea.l    $4a0000                ; 0 + Mshrink
  28.         trap        #1                    ; Gemdos
  29.         lea.l    12(sp),sp
  30.  
  31. ***********************************************************************
  32. ***********                It begins here                ***********
  33. ***********************************************************************
  34.  
  35.         lea.l    Msg_Rout(pc),a0
  36.         bsr        Print
  37.  
  38.         lea.l    Module(pc),a0
  39.         lea.l    WorkSpace,a1
  40.         bsr        MGTK_Init_Module_Samples    ; Initialise tout le bordel
  41.         bpl.s    No_Error
  42.  
  43.         lea.l    Error_Format(pc),a0
  44.         cmp.b    #-1,d0
  45.         beq        Error
  46.         lea.l    Error_Memory(pc),a0
  47.         bra        Error
  48.  
  49. No_Error    bsr        MGTK_Init_DSP
  50.         bpl.s    DSP_Ok
  51.  
  52.         lea.l    Error_DSP(pc),a0
  53.         bra        Error
  54.  
  55. DSP_Ok    lea.l    Msg_Ok(pc),a0
  56.         bsr        Print
  57.  
  58.         bsr        MGTK_Save_Sound
  59.         bsr        MGTK_Init_Sound
  60.         moveq.l    #1,d0
  61.         bsr        MGTK_Set_Replay_Frequency
  62.         moveq.l    #0,d0
  63.         bsr        MGTK_Play_Music
  64.  
  65. ***********************************************************************
  66. ***********            Main Waiting Loop                ***********
  67. ***********************************************************************
  68.  
  69.         move.w    #7,-(sp)                ; Crawin
  70.         trap        #1                    ; Gemdos
  71.         addq.l    #2,sp
  72.  
  73. ***********************************************************************
  74. ***********        It's Finished, Restore All            ***********
  75. ***********************************************************************
  76.  
  77. Quit        bsr        MGTK_Stop_Music
  78.         bsr        MGTK_Restore_Sound
  79.  
  80. Exit        clr.w     -(sp)                    ; PTerm
  81.         trap     #1                        ; Gemdos
  82.  
  83. Error    bsr        Print
  84.  
  85.         move.w    #7,-(sp)
  86.         trap        #1
  87.         addq.l    #2,sp
  88.  
  89.         clr.w     -(sp)                    ; PTerm
  90.         trap     #1                        ; Gemdos
  91.  
  92. ***********************************************************************
  93. ***********                Sub-Routines                ***********
  94. ***********************************************************************
  95.  
  96. Print    pea.l    (a0)
  97.         move.w    #9,-(sp)            ; Cconws
  98.         trap        #1                ; GemDos
  99.         addq.l    #6,sp
  100.         rts
  101.  
  102.         Section    BSS
  103.  
  104.         ds.l        150*1024/4            ; WorkSpace
  105. WorkSpace    ds.l        1                    ; premier de la section BSS
  106.  
  107.         Include    'MGT-PLAY.S'
  108.  
  109. ***********************************************************************
  110. ***********                Section DATA                ***********
  111. ***********************************************************************
  112.  
  113.         Section    DATA
  114.  
  115. Msg_Rout    dc.b        27,'E'
  116.         dc.b        "MegaTracker™ v1.1 DSP-Replay Routine by Simplet / FATAL DESIGN",13,10
  117.         dc.b        "--------------------------------------------------------------",13,10,10
  118.         dc.b        "The CPU-Time taken by sending samples to the DSP is appearing in Black + Pink.",13,10
  119.         dc.b        "The Grey corresponds to the patterns management.",13,10
  120.         dc.b        "Initialisations (depacking tracks and initialising samples).....",0
  121.  
  122. Msg_Ok    dc.b        "Ok..",13,10,0
  123.  
  124. Error_DSP    dc.b        7,13,10
  125.         dc.b        "Error, the DSP program couldn't be loaded.",13,10
  126.         dc.b        "Press any key...",0
  127. Error_Format
  128.         dc.b        7,13,10
  129.         dc.b        "Error, the Module is not to the MegaTracker™ format.",13,10
  130.         dc.b        "Press any key...",0
  131. Error_Memory
  132.         dc.b        7,13,10
  133.         dc.b        "Error, the workspace isn't big enough.",13,10
  134.         dc.b        "Press any key...",0
  135.  
  136. ***********************************************************************
  137. ***********                The Module                ***********
  138. ***********************************************************************
  139.  
  140.         Even
  141.  
  142. Module    dc.b        'MGT',$11,'©MCS'
  143.         dc.w        20,1,1,1,1,2,0,0,0
  144.         dc.l        Music-Module,Sequence-Module,Samples_Infos-Module
  145.         dc.l        Patterns-Module,Tracks_Ptr-Module,Samples_Data-Module
  146.         dc.l        Samples_Data_End-Samples_Data,1*6*64
  147.  
  148. Music    dc.b        'Module de Test fait à la main...'
  149.         dc.l        Sequence-Module
  150.         dc.w        1,0
  151.         dc.b        125*60/50,6        ; Tempo 60 Hz, Speed 6
  152.         dc.w        1024,$2020        ; Global Volume 1024
  153.         dc.w        $ff00,$00ff,$ff00,$00ff
  154.         dc.w        $ff00,$00ff,$ff00,$00ff
  155.         dc.w        $ff00,$00ff,$ff00,$00ff
  156.         dc.w        $ff00,$00ff,$ff00,$00ff
  157.         dc.w        $ff00,$00ff,$ff00,$00ff
  158.         dc.w        $ff00,$00ff,$ff00,$00ff
  159.         dc.w        $ff00,$00ff,$ff00,$00ff
  160.         dc.w        $ff00,$00ff,$ff00,$00ff
  161.  
  162. Sequence    dc.w        0,0,0,0
  163.  
  164. Samples_Infos
  165.         dc.b        'Ceci est le Sample Numéro 1.....'
  166.         dc.l        Sample1-Module,(Sample2-Sample1)/2,0,0
  167.         dc.l        16000*4/50,0,40000
  168.         dc.w        1024,0
  169.         dc.b        %0100,0,0,0        ; 16 Bits Mono
  170.         dc.l        0,0,0
  171.  
  172.         dc.b        'Où sont les femmes ?............'
  173.         dc.l        Sample2-Module,(Samples_Data_End-Sample2)/1,0,0
  174.         dc.l        22000*4/50,0,40000
  175.         dc.w        1024,0
  176.         dc.b        %0000,0,0,0        ; 8 Bits Mono
  177.         dc.l        0,0,0
  178.  
  179. Patterns    dc.w        64
  180.         dcb.w    32,1
  181.  
  182. Tracks_Ptr
  183.         dc.l        Track1-Module        
  184.  
  185. Track1    dc.w        64
  186.         dc.b        %11111100,60,2,0,0,0,0    ; 60 = DO-4
  187.         dc.b        2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3
  188.  
  189. Samples_Data
  190. Sample1    IncBin    'E:\SNDTRACK\SAMPLES\BOOT.RAW'
  191. Sample2    IncBin    'E:\SNDTRACK\SAMPLES\JUVET.RAW'
  192. Samples_Data_End
  193.  
  194. ***********************************************************************
  195. ***********                BSS Section                ***********
  196. ***********************************************************************
  197.  
  198.         Section    BSS
  199.  
  200. End_Stack    ds.l        64
  201. Stack    ds.l        1
  202.