home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / progmisc / hellsrc.zip / MUSIC.INC < prev    next >
Text File  |  1993-08-08  |  11KB  |  323 lines

  1. ▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒
  2. ; MASI Assembly .INC file               Copyright (C) 1992,93 Joshua C. Jensen
  3. ████████████████████████████████████████████████████████████████████████████████
  4. ; Version 930808a.
  5. ▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒
  6.  
  7. ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  8. ; Used for driver detection.
  9. dcActive        = 0
  10. dcInactive      = 1
  11.  
  12. dcEnd           = 0
  13. dcPort          = 1
  14. dcIRQ           = 2
  15. dcMIDIPort      = 3
  16. dcMIDIIRQ       = 4
  17. dcDMAIn         = 5
  18. dcDMAOut8       = 6
  19. dcDMAOut16      = 7
  20.  
  21. ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  22. ; These are the function call values to the drivers.
  23. Mus_Init                =  0
  24. Mus_Close               =  1
  25. Mus_Music               =  2
  26. Mus_Sample              =  3
  27. Mus_Speaker             =  4
  28. Mus_Poll                =  5
  29. Mus_ChangeVars          =  6
  30. ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  31. ; These are the Mus_Music types.
  32. PM_Play         =  1
  33. PM_Pause        =  2
  34. PM_Unpause      =  3
  35. PM_Stop         =  4
  36. ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  37. ; These are the Mus_Sample types.
  38. Samp_Start      =  1
  39. Samp_Stop       =  2
  40. Samp_Volume     =  3
  41. Samp_Pan        =  4
  42. Samp_Process    =  5
  43. Samp_Status     =  6
  44. Samp_Freq       =  7
  45. ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  46. ; These are the Mus_Speaker types.
  47. SpeakerOn       =  1
  48. SpeakerOff      =  2
  49. ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  50. ; These are the S.stereoOn types.
  51. PS_StereoOff    =  1
  52. PS_StereoOn     =  2
  53. ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  54. ; These are the S.musicBits types.
  55. PS_8Bit         =  0
  56. PS_16Bit        =  1
  57. ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  58. ; These are the MStatus types.
  59. PS_Playing      =  0
  60. PS_Done         =  1
  61. PS_Paused       =  2
  62. ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  63. ; These are the loop types for the music (mt_PlayStatus).
  64. PS_NoLoop       =  0
  65. PS_Loop         =  1
  66. PS_LoopPattern  =  2    ; UNSUPPORTED
  67. ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  68. ; These are the pattern break types (mt_PBreakFlag).
  69. PB_None         =  0
  70. PB_JumpLoop     =  1
  71. PB_Break        =  2
  72. PB_StartMusic   =  3
  73. ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  74. ; PSFH - The main PSM file header.
  75. struc   PSFH
  76. Sig             db      4 dup (?)
  77. SongName        db      60 dup (?)
  78. SongType        db      ?
  79. SongVer         db      ?
  80. PatternVersion  db      ?
  81. DefaultSpeed    db      ?
  82. DefaultBPM      db      ?
  83. MasterVolume    db      ?
  84. SongLen         dw      ?
  85. NumOrders       dw      ?
  86. NumPatterns     dw      ?
  87. NumSamples      dw      ?
  88. NumChannels     dw      ?
  89. NumProcess      dw      ?
  90. OrdersOfs       dd      ?
  91. PanPosOfs       dd      ?
  92. PatternsOfs     dd      ?
  93. SamplesOfs      dd      ?
  94. CommentOfs      dd      ?
  95. TotalPatternSize dd     ?
  96. Fillers         dd      10 dup (?)
  97. ends    PSFH
  98.  
  99. struc   SampFH
  100. SName           db      0Dh dup (?)     ; Sample filename.
  101. SComment        db      18h dup (?)     ; Sample comment.
  102. fOffset         dd      ?       ; Offset in file where sample begins.
  103. MemoryLoc       dd      ?       ; Physical Location (RAM/DRAM) of sample in
  104.                                 ;  memory.
  105. SampleNum       dw      ?       ; Sample Number.
  106. SType           db      ?
  107.                 ; 7 6 5 4 3 2 1 0
  108.                 ; │ │ │ │ │ │ │ └─ 0 - Digital, 1 - Synthesized
  109.                 ; │ │ │ │ │ │ └─── Reserved
  110.                 ; │ │ │ │ │ └───── 0 - 8-bit, 1 - 16-bit.
  111.                 ; │ │ │ │ └─────── 0 - Signed, 1 - Unsigned
  112.                 ; │ │ │ └───────── 0 - Deltas, 1 - Raw
  113.                 ; │ │ └─────────── 0 - Loop normally, 1 - Bidirectional
  114.                 ; │ └───────────── 1 - Gravis patch (unsupported)
  115.                 ; └─────────────── 0 - No loop, 1 - Loop sample
  116. SLength         dd      ?       ; 0-1 meg
  117. SRepStart       dd      ?       ; 0-SLength
  118. SRepEnd         dd      ?       ; 0-1 meg
  119. FineTune        db      ?       ; Has the pan position in the upper nibble
  120.                 ; from 0 - 15.  Since the fine tune is from 0 - 15, this
  121.                 ; fits perfectly.  The pan pos is only used if the note
  122.                 ; is greater than 60 (not supported).
  123. Volume          db      ?       ; 0-64
  124. C2Freq          dw      ?
  125. ends    SampFH
  126.  
  127. struc   PatFH
  128. PSize           dw      ?
  129. NumLines        db      ?
  130. NumChannels     db      ?
  131. ends    PatFH
  132.  
  133. struc   SC
  134. ioPort        dw    ?    ; card port
  135. cardIRQ         dw      ?
  136. midiIRQ         dw      ?
  137. midiPort        dw      ?
  138. dmaChannelIn    dw      ?
  139. dmaChannelOut   dw      ?
  140. dmaChannelOut16 dw      ?
  141. SamplingRate    dw      ?       ; Sampling rate.
  142. CallsPerSec     dw      ?       ; Calls per second.
  143. mixvolloc       dd      ?       ; 4k/8k/16k volume table and 2-4k buffer.
  144. typeofvol       dw      ?       ; 0 - 16k buffer (64 volume levels)
  145. sizebuf         dw      ?       ; Size of mixing buffer.
  146. stereoOn        dw      ?       ; 0 - Stereo Off (regardless of soundcard).
  147.                                 ; 1 - Stereo On (if possible).
  148. musicBits       dw      ?       ; 0 - 8-bit
  149.                                 ; 1 - 16-bit
  150. ends    SC
  151.  
  152. struc           pt_Offsets
  153. pt_doramp       dd      ?
  154. pt_volequ       dd      ?
  155. pt_SetVoice     dd      ?
  156. pt_PlayVol      dd      ?
  157. pt_PlayNote     dd      ?
  158. pt_PeriodSet    dd      ?
  159. pt_PeriodSet2   dd      ?
  160. pt_StartChannel dd      ?
  161. pt_StartOver    dd      ?
  162. pt_ExtTempo     dd      ?
  163. ends            pt_Offsets
  164.  
  165. ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  166. ; This structure is passed back to the main program from the PSM file loader.
  167. ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  168. struc           PSMStruc
  169. PSM             PSFH    <>      ; The File Header.
  170. OrdersLoc       dd      ?       ; The Orders Location in memory.
  171. PanPosLoc       dd      ?       ; The Pan Position Location.
  172. PatBigLoc       dd      ?       ; The beginning location that the patterns
  173.         ; were loaded into.  This is provided as an easy way to quickly
  174.         ; free ALL of the patterns.
  175.         ;
  176.         ; Size: PSFH.TotalPatternSize for freeing.
  177. PatLoc          dd      ?       ; The Pattern Segment:Offsets Location.
  178.         ; This points to a buffer of segments and offsets specifying the
  179.         ; location of each pattern.
  180. SampLoc         dd      ?       ; The Samples Location.
  181.         ; This points to a buffer of segments and offsets specifying the
  182.         ; location of each sample structure.
  183.         ;
  184.         ; Size:
  185. MChannels       dd      ?
  186. ends            PSMStruc
  187.  
  188. ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  189. ; This structure is the primary music playing structure.
  190. ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  191. struc           PM
  192. reserved        db      0 ; I-  ; 0-Off, 1-On
  193. MStatus         db      0 ; -O  ; Music status
  194. MaxVolume       db      0 ; IO  ; Max volume of song.
  195. SongLen         dw      0 ; I-  ; Length of song, from PSFH.
  196. NumChannels     dw      0 ; I-  ; Number of module channels to play.
  197. ProcessChannels dw      0 ; I-  ; Number of module channels to process.
  198. MaxChannels     dw      0 ; I-  ; Maximum channels to mix.
  199. TruePanning     db      0 ; I-  ; Turns on balanced left/right panning (1-On)
  200. OrdersLoc       dd      0 ; I-  ; Location of sequences in RAM.
  201. SamplesLoc      dd      0 ; I-  ; Location of segment sample structures in RAM.
  202. PatternsLoc     dd      0 ; I-  ; Location of the patterns segments.
  203. ChannelsLoc     dd      0 ; I-  ; Location of channel MS structs = NumChannels.
  204. Expansion       db      40 dup (0) ; Expansion room
  205.                 ;  Protracker specific stuff.
  206. mt_BPM          db      0 ; IO  ; Default music BPM (Cmd G1).
  207. mt_speed        db      0 ; IO  ; Current speed (Cmd G0).
  208. mt_counter      db      0 ; IO  ; Current counter.
  209. mt_SongPos      dw      0 ; IO  ; Current song position.
  210. mt_PatternPos   dd      0 ; IO  ; Current pattern position segment and offset.
  211. mt_PlayStatus   db      0 ; IO  ; Current playing status
  212. mt_NumLines     dw      0 ; IO  ; Number of lines in this pattern.
  213. mt_CurLine      dw      0 ; IO  ; Current pattern line we are on.
  214. mt_PBreakFlag   db      0 ; IO  ; Pattern Break Flags
  215. mt_PBreakPos    dw      0 ; IO  ; Line number to break to.
  216. mt_PeriodTable  dd      0 ; -O  ; Location of the Period Table.
  217. mt_LineBuf      dd      0 ; -O  ; Location of the Line Number Offset Table.
  218. ends            PM
  219.  
  220. struc           MS
  221. Note            db      0
  222. Instrument      db      0
  223. Data            db      0
  224. Cmd             db      0
  225. SType           db      0
  226. Start           dd      0
  227. SLength         dd      0
  228. LoopStart       dd      0
  229. LoopEnd         dd      0
  230. ONote           db      0
  231. PNote           db      0
  232. Period          dw      0
  233. Volume          db      0
  234. FineTune        db      0
  235. C2Freq          dw      0
  236. VSlideDirec     db      0
  237. VSlideSpeed     db      0
  238. TonePortDirec   db      0
  239. TonePortSpeed   db      0
  240. WantedPeriod    dw      0
  241. VibratoCmd      db      0
  242. VibratoPos      db      0
  243. TremoloCmd      db      0
  244. TremoloPos      db      0
  245. WaveControl     db      0
  246. GlissFunk       db      0
  247. MasterVolume    db      0
  248. DecVolume       db      0
  249. SampleNum       db      0
  250. sc_Mode         db      0
  251. sc_PanPosition  db      0
  252. sc_Voice        db      0
  253. sc_Vol          dw      0
  254. sc_Note         dw      0
  255. ends            MS
  256.  
  257. ▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒
  258.   ; Volume Commands
  259.   cFineVolUp        = 01
  260.   cVolSlideUp       = 02
  261.   cFineVolDown      = 03
  262.   cVolSlideDown     = 04
  263.  
  264.   ; Portamento Commands
  265.   cFinePortaUp      = 10
  266.   cPortaUp          = 11
  267.   cFinePortaDown    = 12
  268.   cPortaDown        = 13
  269.   cTonePort         = 14
  270.   cSetGliss         = 15
  271.   cTPortVolUp       = 16
  272.   cTPortVolDown     = 17
  273.  
  274.   ; Vibrato Commands
  275.   cVibrato          = 20
  276.   cSetVibWaveform   = 21
  277.   cVibVolUp         = 22
  278.   cVibVolDown       = 23
  279.  
  280.   ; Tremolo Commands
  281.   cTremolo          = 30
  282.   cSetTremControl   = 31
  283.  
  284.   ; Sample Offset Commands
  285.   cSampleOffset     = 40
  286.   cRetrigNote       = 41
  287.   cNoteCut          = 42
  288.   cNoteDelay        = 43
  289.  
  290.   ; Position Change Commands
  291.   cPositionJump     = 50
  292.   cPatternBreak     = 51
  293.   cJumpLoop         = 52
  294.   cPatternDelay     = 53
  295.  
  296.   ; Speed Change Commands
  297.   cSetSpeed         = 60
  298.   cSetBPM           = 61
  299.  
  300.   ; Misc. Commands
  301.   cArpeggio         = 70
  302.   cSetFineTune      = 71
  303.   cSetBalance       = 72
  304. ▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒▓▒
  305.  
  306. segment         PTSeg
  307. global          PT_MUS:proc
  308. ends            PTSeg
  309.  
  310. segment         SBSeg
  311. global          SB_MUS:proc
  312. ends            SBSeg
  313.  
  314. segment         GUSSeg
  315. global          GUS_MUS:proc
  316. ends            GUSSeg
  317.  
  318. segment         PSMLoaderSeg
  319.  
  320. global          Loader_MUS:proc
  321.  
  322. ends            PSMLoaderSeg
  323.