home *** CD-ROM | disk | FTP | other *** search
/ Large Pack of OldSkool DOS MOD Trackers / funk108a.zip / FUNK_S.ZIP / FUNKOBJ.ASM < prev    next >
Assembly Source File  |  1995-06-25  |  12KB  |  165 lines

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;                                                                          ;
  3. ; FunkyOBJ - interface to FUNKLITE.ASM                                     ;
  4. ;                                                                          ;
  5. ; FunkTracker by JsNO/SuperReal - 1994,1995                                ;
  6. ;                                                                          ;
  7. ; This routine is for people who are coding in anything other than TASM    ;
  8. ; ideal mode. An "INCLUDE attachment" is alot more convinent, as you can   ;
  9. ; access any internal memory references or routines without the headache of;
  10. ; defining them globally. However this is totally impractical for DOS32    ;
  11. ; ASM, DOS32 C or MASM people.                                             ;
  12. ;                                                                          ;
  13. ; It's also handly if you have any variable references that clash with any ;
  14. ; existing code.                                                           ;
  15. ;                                                                          ;
  16. ; Following is an explaination of each of the essential routines needed    ;
  17. ; to play a FNK module in memory.                                          ;
  18. ;                                                                          ;
  19. ;CF FNK_autodetect(BL)                                                     ;
  20. ;---------------------                                                     ;
  21. ;expects BL : 0 = PAS16 card override                                      ;
  22. ;             1 = GUS card override                                        ;
  23. ;             2 = Creative Labs cards override                             ;
  24. ;            FF = at routines discretion (will typically be this value)    ;
  25. ;                                                                          ;
  26. ;Returns CF :CY = detection failed. no card detected                       ;
  27. ;            CN = Card found, proceed.                                     ;
  28. ;                                                                          ;
  29. ;Will autodetect your soundcard. It will test and detect soundcards in     ;
  30. ;the order of PAS, GUS and CT cards, so if you have a GUS and a CT card    ;
  31. ;in the one machine (like me), and you want to play music thru your SB16   ;
  32. ;card, then you're going to have to override the thing.                    ;
  33. ;                                                                          ;
  34. ;NB/ Only run this once at the start of your demo.                         ;
  35. ;                                                                          ;
  36. ;CF FNK_card_init(EAX,EBX)                                                 ;
  37. ;---------------------                                                     ;
  38. ;expects EAX:   = pointer to allocated DMA memory                          ;
  39. ;                                                                          ;
  40. ;Returns CF :CY = init failed....halt and catch fire                       ;
  41. ;            CN = inited, proceed.                                         ;
  42. ;                                                                          ;
  43. ;This routine setups up the mixxing routines so that it's paging           ;
  44. ;DMA in backround.                                                         ;
  45. ;                                                                          ;
  46. ;void FNK_setup_player(EAX)                                                ;
  47. ;--------------------------                                                ;
  48. ;expects EAX:   = funksong pointer                                         ;
  49. ;                                                                          ;
  50. ;Returns    :   = nothing                                                  ;
  51. ;                                                                          ;
  52. ;This inits, resets all the trackers variables etc. It accepts (EAX)       ;
  53. ;a pointer, pointing to your funk song in memory, as your load a funk      ;
  54. ;file _whole_ in memory, or your fuknsong could even be attached           ;
  55. ;to an executable, whatever, you must have a contingous funky song         ;
  56. ;in memory from header to sample block.                                    ;
  57. ;                                                                          ;
  58. ;void FNK_PLAY(void)                                                       ;
  59. ;-------------------                                                       ;
  60. ;expects    :nothing                                                       ;
  61. ;                                                                          ;
  62. ;Returns    :nothing                                                       ;
  63. ;                                                                          ;
  64. ;This tells the tracker to PLAY                                            ;
  65. ;                                                                          ;
  66. ;void FNK_STOP(void)                                                       ;
  67. ;-------------------                                                       ;
  68. ;expects    :nothing                                                       ;
  69. ;                                                                          ;
  70. ;Returns    :nothing                                                       ;
  71. ;                                                                          ;
  72. ;This tells the tracker to STOP                                            ;
  73. ;                                                                          ;
  74. ;void FNK_card_deinit(void)                                                ;
  75. ;--------------------------                                                ;
  76. ;expects    :nothing                                                       ;
  77. ;                                                                          ;
  78. ;Returns    :nothing                                                       ;
  79. ;                                                                          ;
  80. ;Deinits the card. To be used at the very end of your demo. Never run      ;
  81. ;this twice in a row. and don't ever run this without initialising the     ;
  82. ;card first.                                                               ;
  83. ;                                                                          ;
  84. ;ZF FNK_teststatus(void)                                                   ;
  85. ;-----------------------                                                   ;
  86. ;expects    :nothing                                                       ;
  87. ;                                                                          ;
  88. ;Returns    :ZY = Song currently playing                                   ;
  89. ;            ZN = Song has stopped                                         ;
  90. ;                                                                          ;
  91. ;void FNK_set_mvolume(AL)                                                  ;
  92. ;------------------------                                                  ;
  93. ;expects    :AL = master volume value to set                               ;
  94. ;                                                                          ;
  95. ;Returns    :nothing                                                       ;
  96. ;                                                                          ;
  97. ;use this to set the current master volume (handly for fading songs in     ;
  98. ;and out)                                                                  ;
  99. ;                                                                          ;
  100. ;AL FNK_get_mvolume(void)                                                  ;
  101. ;------------------------                                                  ;
  102. ;expects    :nothing                                                       ;
  103. ;                                                                          ;
  104. ;Returns    :AL = current master volume                                    ;
  105. ;                                                                          ;
  106. ;used to get the current master volume (ditto)                             ;
  107. ;                                                                          ;
  108. ;Instructions for general operation                                        ;
  109. ;----------------------------------                                        ;
  110. ;                                                                          ;
  111. ;After you have ran FNK_autodetect and CF FNK_card_init(EAX), you would    ;
  112. ;use the three followiing routines to setup and play a song.               ;
  113. ;                                                                          ;
  114. ;FNK_setup_player                                                          ;
  115. ;FNK_PLAY                                                                  ;
  116. ;FNK_STOP                                                                  ;
  117. ;                                                                          ;
  118. ;you can use these any number of times, typically in this sequence:        ;
  119. ;                                                                          ;
  120. ;FNK_setup_player                                                          ;
  121. ;FNK_PLAY                                                                  ;
  122. ;                                                                          ;
  123. ;(first song playing)                                                      ;
  124. ;                                                                          ;
  125. ;FNK_STOP                                                                  ;
  126. ;FNK_setup_player                                                          ;
  127. ;FNK_PLAY                                                                  ;
  128. ;                                                                          ;
  129. ;(second song playing)                                                     ;
  130. ;                                                                          ;
  131. ;.                                                                         ;
  132. ;.                                                                         ;
  133. ;.                                                                         ;
  134. ;.                                                                         ;
  135. ;FNK_STOP                                                                  ;
  136. ;                                                                          ;
  137. ;etc                                                                       ;
  138. ;                                                                          ;
  139. ;COMPILING                                                                 ;
  140. ;---------                                                                 ;
  141. ; tasmx funkobj                                                            ;
  142. ; tasmx <your code>                                                        ;
  143. ; dlink [-Sdos32.exe] [debug.obj] funkobj <your OBJ> [, <your EXE>]        ;
  144. ;                                                                          ;
  145. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  146. ideal
  147. p386
  148. model flat
  149. stack 0
  150. codeseg
  151.  
  152. public                FNK_autodetect
  153. public                FNK_card_deinit
  154. public                FNK_card_init
  155. public                FNK_setup_player
  156. public                FNK_PLAY
  157. public                FNK_STOP
  158. public                FNK_teststatus
  159. public                FNK_set_mvolume
  160. public                FNK_get_mvolume
  161.  
  162. include "funklite.asm"
  163.  
  164. end
  165.