extrn   _dfmcounter:byte, _dfmfunc:dword, _scard:byte, _sbirq:byte
extrn   _sbport:word, _dspout:byte, _pcsfxtblptr:dword, _fmsfxtblptr:dword
extrn   _sbsfxtblptr:dword, _sbsfxchl:byte, _sbsfxchh:byte, _sbsfxch:byte
extrn   muztempo:byte, muzordern:byte, muzorderl:byte, muzordptr:dword
extrn   muzsbinsptr:dword, muzfminsptr:dword, muzpatbase:dword
extrn   muzpatoffptr:dword, _voicehit:byte, modebitmap:byte

extrn   _sbdma:byte

extrn   _install_dfm:near, _uninstall_dfm:near, _detect_scard:near
extrn   _pcsfx:near, _pcsfxd:near, _sbsfxs:near, _sbsfxsd:near
extrn   _stopsmp:near, _sbsfxmd:near, _sbsfxm:near, _sbnote:near, _fmnote:near
extrn   _fmsfx:near, _fmsfxd:near
extrn   _stopmuzik:near, _setmuzik:near, _muzik:near, _adjsmp:near
extrn   _phademuzik:near
extrn   _mixahead:near

;
; PC SFX table:
; 0       1db     number of FX present
; 1+      struc{
;   0     1dd     ptr to fect data (z-terminated string of bytes)
; }
;
; SB SFX table:
; 0       1db     number of FX present
; 1       1dd     ptr to list of ptrs to dsfx
; 5+      struc{
;   0     1db     SB sampling rate (or mix rate shr 4 for mix out)
;   1     1db     number of sample to use (length is first dword there)
; }
;
; FM SFX table:
; 0       1db     number of FX present
; 1       1dd     ptr to list of timbre+freq data (13 bytes each)
; 5+      struc{
;   0     1dd     ptr to single fect data (-1 ends the chain)
; }
;
; 670 muzik format:
; 0       1db     tempo for whole muzik
; 1       1db     number of orders
; 2       1db     number of patterns
; 3       1db     number of digital instruments
; 4       1db     number of FM instruments
; 5       1db     order loop
; 6       1dd     offset (from beginning of block) of digital instruments
; 10      ?db     order list
;         ?dd     pattern offset (from beginning of patterns) list
;         ?4dd    digital instrument data
;         ?11db   FM instrument data
;         ?db     patterns{
;           high 3 bits are command:
;           000vvvvv - note, byte[1]=iooonnnn, byte[2]=iiiivvvv
;           001vvvvv - volume, byte[1]=0000vvvv
;           010????? - delay, byte[1]=dddddddd
;           011????? - break pattern
;

; for 22k mixing:
;
;  mono SB rate is 0d2h, SBP stereo rate is 0e9h
;  DBUFLEN is 380, max code end is 9FA1
;
;  frequencies are:
;   24, 25, 27, 29, 30, 32, 34, 36, 38, 41, 43, 46
;   49, 51, 55, 58, 61, 65, 69, 73, 77, 82, 87, 92
;   98, 103, 110, 116, 123, 130, 138, 146, 155, 164, 174, 185
;   196, 207, 220, 233, 247, 261, 277, 293, 311, 329, 349, 370
;   392, 415, 440, 466, 494, 523, 554, 587, 622, 659, 699, 740
;

; for 12k mixing:
;
;  mono SB rate is 0ach, SBP stereo rate is 0d2h
;  DBUFLEN is 208, max code end is ?
;
;  frequencies are:
;   44, 47, 50, 53, 56, 59, 63, 67, 71, 75, 79, 84
;   89, 95, 100, 106, 113, 119, 126, 134, 142, 150, 159, 169
;   179, 190, 201, 213, 226, 239, 253, 268, 284, 301, 319, 338
;   359, 380, 402, 426, 452, 479, 507, 537, 569, 603, 639, 677
;   718, 760, 805, 853, 904, 958, 1015, 1075, 1139, 1207, 1279, 1355
;

