home *** CD-ROM | disk | FTP | other *** search
/ HomeWare 14 / HOMEWARE14.bin / music / vaisdk.arj / VBEAI.INC < prev    next >
Text File  |  1994-04-10  |  27KB  |  750 lines

  1.  
  2. ;   /*\
  3. ;---|*|--------------------====< VESA AI Include >====--------------------
  4. ;---|*|
  5. ;---|*| Copyright (c) 1993,1994  V.E.S.A, Inc. All Rights Reserved.
  6. ;---|*|
  7. ;---|*| VBE/AI 1.0 Specification
  8. ;---|*|    February 2, 1994. 1.00 release
  9. ;---|*|
  10. ;---|*| Additional Changes:
  11. ;---|*|   03/03 - Added the full list of Volume feature bit as EQUs
  12. ;---|*|
  13. ;   \*/
  14.  
  15. VBEAI_VERSION   equ     10h     ; first VBE/AI version
  16.  
  17. ;   /*\
  18. ;---|*|----====< VESA Services Definitions >====----
  19. ;   \*/
  20.  
  21. INTHOOK         equ     0010h
  22.  
  23. ;   // VAI query interface functions
  24.  
  25. VESAFUNCID      equ     04f13h  ; function ID
  26.  
  27. VESAFUNC0       equ     0000h   ; VESA Function #0 -- Validate VBE/AI presence
  28. VESAFUNC1       equ     0001h   ; VESA Function #1 -- Locate the device
  29. VESAFUNC2       equ     0002h   ; VESA Function #2 -- Query the device
  30. VESAFUNC3       equ     0003h   ; VESA Function #3 -- Open the device
  31. VESAFUNC4       equ     0004h   ; VESA Function #4 -- Close the device
  32. VESAFUNC5       equ     0005h   ; VESA Function #5 -- Driver Unload
  33. VESAFUNC6       equ     0006h   ; VESA Function #6 -- Driver Chain/Unchain
  34.  
  35. ;   // VAI function 2 queries
  36.  
  37. VESAQUERY1      equ     0001h   ; return length of GeneralDeviceClass
  38. VESAQUERY2      equ     0002h   ; return copy   of GeneralDeviceClass
  39. VESAQUERY3      equ     0003h   ; return length of Volume Info Structure
  40. VESAQUERY4      equ     0004h   ; return copy   of Volume Info Structure
  41. VESAQUERY5      equ     0005h   ; return length of Volume Services Structure
  42. VESAQUERY6      equ     0006h   ; return copy   of Volume Services Structure
  43. VESAENDQUERY    equ     000fh   ; subfunctions 6 - 15 are reserved
  44.                                 ; subfunctions 16+ are used by the devices
  45. ;   // VAI Device types
  46.  
  47. WAVDEVICE       equ     01h
  48. MIDDEVICE       equ     02h
  49. VOLDEVICE       equ     03h
  50.  
  51. ;#define WAVESERVICES    0x57415653 // ascii "WAVS"
  52. ;#define MIDISERVICES    0x4D494453 // ascii "MIDS"
  53.  
  54.  
  55. ;   /*\
  56. ;---|*|----====< Volume Services >====----
  57. ;   \*/
  58.  
  59.         VolumeInfo struc
  60.  
  61.             ;; housekeeping
  62.  
  63.             viname          db      4 dup(?)  ;; name of the structure
  64.             vilength        dd      ?         ;; structure length
  65.  
  66.             ;; hardware vendor name
  67.  
  68.             viversion       dd      0         ;; driver software version
  69.             vivname         db      32 dup(?) ;; vendor name, etc. (ASCIIZ string)
  70.             viprod          db      32 dup(?) ;; vendor product name
  71.             vichip          db      32 dup(?) ;; vendor chip/hardware description
  72.             viboardid       db      0         ;; installed board #
  73.             viunused        db      3  dup(?) ;; unused data
  74.  
  75.             vicname         db      24 dup(?) ;; text name of the mixer channel
  76.  
  77.             vifeatures      dd      ?         ;; bits of features
  78.  
  79.             vimin           dw      ?         ;; minimum volume setting
  80.             vimax           dw      ?         ;; maximum volume setting
  81.             vicross         dw      ?         ;; attenuation/gain crossover
  82.  
  83.         VolumeInfo ends
  84.  
  85. ;  // Volume feature bits
  86.  
  87. VOLSTEREO       equ     0001h           ;; Stereo Volume control available
  88. VOLLOPASS       equ     0004h           ;; Low Pass Filter is available
  89. VOLHIPASS       equ     0008h           ;; High Pass Filter is available
  90. VOLPARATC       equ     0010h           ;; Parametric Tone Control is available
  91. VOLSELOUT       equ     0020h           ;; selectable output paths
  92. VOLAZIMUTH      equ     0100h           ;; Azimuth Field positioning supported
  93. VOLPHIMUTH      equ     0200h           ;; Phi Field positioning supported
  94. VOLMASTER       equ     80000000h       ;; Master Volume device
  95.  
  96. ;   // VOL device check messages
  97.  
  98. VOLFILTERRANGE          equ    0011h
  99. VOLFILTERSETTING        equ    0012h
  100. VOLFILTERCURRENT        equ    0013h
  101. VOLTONERANGE            equ    0014h
  102. VOLTONESETTING          equ    0015h
  103. VOLTONECURRENT          equ    0016h
  104. VOLPATH                 equ    0017h
  105. VOLGETIOADDRESS         equ    0018h
  106. VOLOEMSTARTINGDC        equ    0080h    ;; vendors can add DevChks above 0x80
  107.  
  108.  
  109. ;   /*\
  110. ;---|*|----====< Volume services Structure >====----
  111. ;   \*/
  112.  
  113.         VolumeService struc
  114.  
  115.             ;; housekeeping
  116.  
  117.             vsname          db      4 dup(?)  ;; name of the structure
  118.             vslength        dd      ?         ;; structure length
  119.  
  120.             vsfuture        db      16 dup(?) ;; 16 bytes for future expansion
  121.  
  122.             vsDeviceCheck   dd      ?         ;; device check
  123.             vsSetVolume     dd      ?         ;; set vol to an absolute setting
  124.             vsSetFieldVol   dd      ?         ;; set 3D volume
  125.             vsToneControl   dd      ?         ;;
  126.             vsFilterControl dd      ?         ;;
  127.             vsOutputPath    dd      ?         ;;
  128.             vsResetChannel  dd      ?         ;;
  129.             vsGetLastError  dd      ?         ;;
  130.  
  131.         VolumeService ends
  132.  
  133. ;   // VOL SetVolume message
  134.  
  135. VOL_USERSETTING equ     01h                   ;; User master volume setting
  136. VOL_APPSETTING  equ     02h                   ;; application master volume setting
  137.  
  138. ;   // VOL error message
  139.  
  140. VOL_NOSUPPORT   equ     01h                   ;; unsupported feature/function
  141. VOL_BADVALUE    equ     02h                   ;; out of range parameter value
  142. VOL_HWFAILURE   equ     80h                   ;; vendors specific errors
  143.  
  144.  
  145. ;   /*\
  146. ;---|*|----====< WAVE Info Structure >====----
  147. ;   \*/
  148.  
  149.         WAVEInfo struc
  150.  
  151.             ;; housekeeping
  152.  
  153.             winame          db      4 dup(?)  ;; name of the structure
  154.             wilength        dd      ?         ;; structure length
  155.  
  156.             ;; hardware vendor name
  157.  
  158.             wiversion       dd      0         ;; driver software version
  159.             wivname         db      32 dup(?) ;; vendor name, etc. (ASCIIZ string)
  160.             wiprod          db      32 dup(?) ;; vendor product name
  161.             wichip          db      32 dup(?) ;; vendor chip/hardware description
  162.             wiboardid       db      0         ;; installed board #
  163.             wiunused        db      3  dup(?) ;; unused data
  164.  
  165.             ;; device specific information
  166.  
  167.             wifeatures      dd      ?         ;; feature bits
  168.             widevpref       dw      ?         ;; user determined preference field
  169.             wimemreq        dw      ?         ;; memory required for driver use.
  170.             witimerticks    dw      ?         ;; # of timer tick callbacks per second
  171.  
  172.             wiChannels      dw      ?         ;; 1 = mono, 2 = stereo. Stereo is
  173.                                               ;; assumed to be interleaved data.
  174.             wiSampleSize    dw      ?         ;; Bit field of max sample sizes
  175.  
  176.         WAVEInfo ends
  177.  
  178. ;   // WAVE feature bit definitions
  179.  
  180. WAVEMP8K        equ     00000001h       ;; 8000hz Mono Playback.
  181. WAVEMR8K        equ     00000002h       ;; 8000hz Mono Record.
  182. WAVESR8K        equ     00000004h       ;; 8000hz Stereo Record.
  183. WAVESP8K        equ     00000008h       ;; 8000hz Stereo Playback.
  184. WAVEFD8K        equ     00000010h       ;; 8000hz Full Duplex Play/Record.
  185.  
  186. WAVEMP11K       equ     00000020h       ;; 11025hz Mono Playback.
  187. WAVEMR11K       equ     00000040h       ;; 11025hz Mono Record.
  188. WAVESR11K       equ     00000080h       ;; 11025hz Stereo Record.
  189. WAVESP11K       equ     00000100h       ;; 11025hz Stereo Playback.
  190. WAVEFD11K       equ     00000200h       ;; 11025hz Full Duplex Play/Record.
  191.  
  192. WAVEMP22K       equ     00000400h       ;; 22050hz Mono Playback.
  193. WAVEMR22K       equ     00000800h       ;; 22050hz Mono Record.
  194. WAVESR22K       equ     00001000h       ;; 22050hz Stereo Record.
  195. WAVESP22K       equ     00002000h       ;; 22050hz Stereo Playback.
  196. WAVEFD22K       equ     00004000h       ;; 22050hz Full Duplex Play/Record.
  197.  
  198. WAVEMP44K       equ     00008000h       ;; 44100hz Mono Playback.
  199. WAVEMR44K       equ     00010000h       ;; 44100hz Mono Record.
  200. WAVESR44K       equ     00020000h       ;; 44100hz Stereo Record.
  201. WAVESP44K       equ     00040000h       ;; 44100hz Stereo Playback.
  202. WAVEFD44K       equ     00080000h       ;; 44100hz Full Duplex Play/Record.
  203.  
  204. WAVEPREPARE     equ     08000000h       ;; driver must pre handle the data
  205. WAVEVARIPMONO   equ     10000000h       ;; Variable Sample mono   playback
  206. WAVEVARIPSTER   equ     20000000h       ;; Variable Sample stereo playback
  207. WAVEVARIRMONO   equ     40000000h       ;; Variable Sample mono   record
  208. WAVEVARIRSTER   equ     80000000h       ;; Variable Sample stereo record
  209.  
  210. ;   // WAVE device check messages
  211.  
  212. WAVECOMPRESSION         equ     11h
  213. WAVEDRIVERSTATE         equ     12h
  214. WAVEGETCURRENTPOS       equ     13h
  215. WAVESAMPLERATE          equ     14h
  216. WAVESETPREFERENCE       equ     15h
  217. WAVEGETDMAIRQ           equ     16h
  218. WAVEGETIOADDRESS        equ     17h
  219. WAVEGETMEMADDRESS       equ     18h
  220. WAVEGETMEMFREE          equ     19h
  221. WAVEFULLDUPLEX          equ     1Ah
  222. WAVEGETBLOCKSIZE        equ     1Bh
  223. WAVEGETPCMFORMAT        equ     1Ch
  224. WAVEENAPCMFORMAT        equ     1Dh
  225. WAVEOEMSTARTINGDC       equ     80h     ;; vendors can add DevChks above 0x80
  226.  
  227. ;   // types of compression
  228.  
  229. WAVEIMAPLAY             equ     01h
  230. WAVEALAWPLAY            equ     02h
  231. WAVEULAWPLAY            equ     03h
  232.  
  233. WAVEIMARECORD           equ     11h
  234. WAVEALAWRECORD          equ     12h
  235. WAVEULAWRECORD          equ     13h
  236.  
  237. ;   // sample data sizes
  238.  
  239. WAVE08BITPLAY           equ     01h
  240. WAVE16BITPLAY           equ     02h
  241. WAVE08BITREC            equ     10h
  242. WAVE16BITREC            equ     20h
  243.  
  244.  
  245. ;   /*\
  246. ;---|*|----====< WAVE Audio Services >====----
  247. ;   \*/
  248.  
  249. ;   ;;  The following is a description of the contents of the WAVE Audio
  250. ;   ;;  Services. For the most part, this structure is read-only to
  251. ;   ;;  the application. The only two fields the application can write
  252. ;   ;;  are the callback fields.
  253.  
  254.         WAVEService struc
  255.  
  256.             ;; housekeeping
  257.  
  258.             wsname          db      4 dup(?)  ;; name of the structure
  259.             wslength        dd      ?         ;; structure length
  260.  
  261.             wsfuture        db      16 dup(?) ;; 16 bytes for future expansion
  262.  
  263.             ;; device driver supplied function
  264.  
  265.             wsDeviceCheck   dd      ?         ;;
  266.             wsPCMInfo       dd      ?         ;;
  267.             wsPlayBlock     dd      ?         ;;
  268.             wsPlayCont      dd      ?         ;;
  269.  
  270.             wsRecordBlock   dd      ?         ;;
  271.             wsRecordCont    dd      ?         ;;
  272.             wsPauseIO       dd      ?         ;;
  273.             wsResumeIO      dd      ?         ;;
  274.  
  275.             wsStopIO        dd      ?         ;;
  276.             wsWavePrepare   dd      ?         ;;
  277.             wsWaveRegister  dd      ?         ;;
  278.  
  279.             wsGetLastError  dd      ?         ;;
  280.             wsTimerTick     dd      ?         ;;
  281.  
  282.             ;; device driver run-information time data
  283.  
  284.             wsApplPSyncCB   dd      ?         ;; play filled in by the app
  285.             wsApplRSyncCB   dd      ?         ;; rec filled in by the app
  286.  
  287.         WAVEService ends
  288.  
  289.         ;; error messages
  290.  
  291. WAV_NOSUPPORT           equ     1h      ;; unsupported feature/function
  292. WAV_BADSAMPLERATE       equ     2h
  293. WAV_BADBLOCKLENGTH      equ     3h
  294. WAV_BADBLOCKADDR        equ     4h
  295. WAV_BADLOSTIRQ          equ     5h      ;; app. missed an IRQ
  296. WAV_BADPCMDATA          equ     6h      ;; don't understand the PCM size/format
  297. WAV_HWFAILURE           equ    80h      ;; vendors specific errors
  298.  
  299.  
  300. ;   /*\
  301. ;---|*|----====< MIDI Info Structure >====----
  302. ;   \*/
  303.  
  304.         MIDIInfo struc
  305.  
  306.             ;; housekeeping
  307.  
  308.             miname          db      4 dup(?)  ;; name of the struc
  309.             milength        dd      ?         ;; structure length
  310.  
  311.             ;; hardware vendor name
  312.  
  313.             miversion       dd      0         ;; driver software version
  314.             mivname         db      32 dup(?) ;; vendor name, etc. (ASCIIZ string)
  315.             miprod          db      32 dup(?) ;; vendor product name
  316.             michip          db      32 dup(?) ;; vendor chip/hardware description
  317.             miboardid       db      0         ;; installed board #
  318.             miunused        db      3  dup(?) ;; unused data
  319.  
  320.             milibrary       db      14 dup(?) ;; the patch library name. file name
  321.  
  322.             ;; Feature list
  323.  
  324.             mifeatures      dd      ?         ;; feature bits
  325.             midevpref       dw      ?         ;; user determined preference field
  326.             mimemreq        dw      ?         ;; memory required for driver use
  327.             mitimerticks    dw      ?         ;; # of timer tick callbacks per second
  328.  
  329.             miactivetones   dw      ?         ;; max # of tones (voices, partials)
  330.  
  331.         MIDIInfo ends
  332.  
  333. ;   // MIDI feature bits
  334.  
  335. MIDIFRESVD1             equ     0001h   ;; reserved for GM extensions
  336. MIDIFRESVD2             equ     0002h   ;; reserved for GM extensions
  337. MIDIFRESVD3             equ     0004h   ;; reserved for GM extensions
  338. MIDIFRESVD4             equ     0008h   ;; reserved for GM extensions
  339. MIDIFXMITR              equ     0010h   ;; Transmitter/Receiver only.
  340. MIDIFPRELD              equ     0020h   ;; Patches preloaded.
  341. MIDIFTIMEST             equ     0040h   ;; MIDI receive has time stamp.
  342. MIDIINTR                equ     0100h   ;; MIDI interrupt driven input supported
  343. MIDIPOLL                equ     0200h   ;; MIDI polled input supported
  344. MIDIREMOTELD            equ     0400h   ;; MIDI remote patches supported
  345.  
  346. ;   // MIDI device check messages
  347.  
  348. MIDITONES               equ     11h     ;; return available tones
  349. MIDIPATCHTYPE           equ     12h     ;; return TRUE/FALSE if patch is understood
  350. MIDISETPREFERENCE       equ     13h     ;; set the preference
  351. MIDIVOICESTEAL          equ     14h     ;; allow/disallow voice stealing
  352. MIDIGETFIFOSIZES        equ     15h
  353. MIDIGETDMAIRQ           equ     16h
  354. MIDIGETIOADDRESS        equ     17h
  355. MIDIGETMEMADDRESS       equ     18h
  356. MIDIGETMEMFREE          equ     19h
  357. MIDIOEMSTARTINGDC       equ     80h     ;; vendors can add DevChks above 0x80
  358.  
  359. ;   // MIDI Registered Patch Types
  360.  
  361. MIDI_PATCH_OPL2         equ     10h
  362. MIDI_PATCH_OPL3         equ     11h
  363.  
  364.  
  365. ;   /*\
  366. ;---|*|----====< Synthesizer Audio Services Structure >====----
  367. ;   \*/
  368.  
  369.             ;; Synthesizer Services Structure
  370.  
  371.         MIDIService struc
  372.  
  373.             ;; housekeeping
  374.  
  375.             msname         db      4 dup(?)  ;; name of the struc
  376.             mslength       dd      ?         ;; structure length
  377.  
  378.             ;; runtime data
  379.  
  380.             mspatches      dw      16 dup(?) ;; patches loaded table bit field
  381.             msfuture       db      16 dup(?) ;; 16 bytes for future expansion
  382.  
  383.             ;; device driver supplied function
  384.  
  385.             msDeviceCheck  dd      ?          ;;
  386.             msGlobalReset  dd      ?          ;;
  387.             msMIDImsg      dd      ?          ;;
  388.             msPollMIDI     dd      ?          ;;
  389.             msPreLoadPatch dd      ?          ;;
  390.             msUnloadPatch  dd      ?          ;;
  391.             msTimerTick    dd      ?          ;;
  392.             msGetLastError dd      ?          ;;
  393.  
  394.             ;; application supplied functions
  395.  
  396.             msApplFreeCB   dd      ?          ;; Patch Block free cb
  397.             msApplMIDIIn   dd      ?          ;; MIDI byte avail.
  398.  
  399.         MIDIService ends
  400.  
  401. MID_NOSUPPORT           equ     1h      ;; unsupported feature/function
  402. MID_UNKNOWNPATCH        equ     2h      ;; unknown patch type
  403. MID_ALLTONESUSED        equ     3h      ;; all tones are used
  404. MID_BADMIDIMSG          equ     4h      ;; messages are out of sync
  405. MID_PATCHINCOMP         equ     5h      ;; an incoming patch was incomplete
  406. MID_PATCHINFULL         equ     6h      ;; an incoming patch couldn't be stored
  407. MID_BADLOSTIRQ          equ     7h      ;; had to drop an incoming byte
  408. MID_PATCHINFAIL         equ     8h      ;; driver is failing a patch download
  409. MID_HWFAILURE           equ    80h      ;; vendors specific errors
  410.  
  411.  
  412. ;   /*\
  413. ;---|*|----====< General Device Class structure for all devices >====----
  414. ;   \*/
  415.  
  416. ;   ;;  When a device is queried via function #1, it will return the
  417. ;   ;;  following structure. The entire structure contents are read-only
  418. ;   ;;  for the application. There are no fields that the application
  419. ;   ;;  may modify.
  420.  
  421.  gdcpad = SIZE MIDIInfo
  422.  if (SIZE VolumeInfo) GT (SIZE MIDIInfo)
  423.    gdcpad = SIZE VolumeInfo
  424.  endif
  425.  if (SIZE WAVEInfo) GT (SIZE MIDIInfo)
  426.    gdcpad = SIZE WAVEInfo
  427.  endif
  428.  
  429.         GeneralDeviceClass struc
  430.  
  431.             ;; housekeeping...
  432.  
  433.             gdcname         db      4 dup(?)  ;; name of the struc
  434.             gdclength       dd      ?         ;; structure length
  435.  
  436.             ;; generalities...
  437.  
  438.             gdcclassid      dw      ?         ;; type of device
  439.             gdvbever        dw      ?         ;; version of VESA driver support
  440.  
  441.             ;; unions follow...
  442.  
  443.             gdcu            db   gdcpad dup(?);; version of VESA driver support
  444.  
  445.         GeneralDeviceClass ends
  446.  
  447. wiunion equ <gdcvesaver+2>
  448. miunion equ <gdcvesaver+2>
  449. viunion equ <gdcvesaver+2>
  450.  
  451.     ;;
  452.     ;; patch file format structures
  453.     ;;
  454.  
  455.         RIFFhdr struc
  456.             rifftype    db      4 dup(0);; structure type holds "RIFF"
  457.             riffrcount  dd      0       ;; length of the RIFF block
  458.         RIFFhdr ends
  459.  
  460.         VAILhdr struc
  461.             vailtype    db      4 dup(0);; structure type holds "vail"
  462.             vailpcount  dd      0       ;; count of patches in the file
  463.         VAILhdr ends
  464.  
  465.         ZSTRhdr struc
  466.             zstrtype    db      4 dup(0);; structure type holds "ZSTR"
  467.             zstrtlen    dd      0       ;; length of text following this field
  468.         ZSTRhdr ends
  469.  
  470.         VAIPhdr struc
  471.             vaiptype    db      4 dup(0);; structure type holds "vaip"
  472.             vaiplen     dd      0       ;; VBE/AI Patch data table
  473.         VAIPhdr ends
  474.  
  475.         VAIIhdr struc
  476.             vaiitype    db      4 dup(0);; structure type holds "vaii", index
  477.             vaiilen     dd      0       ;; vaii structure length
  478.             vailpoffset dd      0       ;; holds offset to "vaid" from "vaip"
  479.             vailvaidln  dd      0       ;; holds length of the corresponding patch
  480.         VAIIhdr ends
  481.  
  482.         VAIDhdr struc
  483.             vaidtype    db      4 dup(0);; structure type holds "vaid"
  484.             vaidlen     dd      ?       ;; holds length of this patch
  485.         VAIDhdr ends
  486.  
  487.  
  488. ;   /*\
  489. ;---|*|----====< PC Hardware specific Definitions >====----
  490. ;   \*/
  491.  
  492. ; Interrupt Controller #1 Port Addresses and Interrupt Masks
  493.  
  494. IRQ1MASKREG     EQU     021h            ;; 8259 mask register
  495. IRQ1ACKREG      EQU     020h            ;; 8259 INT acknowledge register
  496.  
  497. INT0MSK         EQU     00000001B       ;; interrupt 0 mask
  498. INT1MSK         EQU     00000010B       ;; interrupt 1 mask
  499. INT2MSK         EQU     00000100B       ;; interrupt 2 mask
  500. INT3MSK         EQU     00001000B       ;; interrupt 3 mask
  501. INT4MSK         EQU     00010000B       ;; interrupt 4 mask
  502. INT5MSK         EQU     00100000B       ;; interrupt 5 mask
  503. INT6MSK         EQU     01000000B       ;; interrupt 6 mask
  504. INT7MSK         EQU     10000000B       ;; interrupt 7 mask
  505.  
  506. ; Interrupt Controller #2 Port Addresses and Interrupt Masks
  507.  
  508. IRQ2MASKREG     EQU     0A1h            ;; 8259 mask register
  509. IRQ2ACKREG      EQU     0A0h            ;; 8259 INT acknowledge register
  510.  
  511. INT8MSK         EQU     00000001B       ;; interrupt 8 mask
  512. INT9MSK         EQU     00000010B       ;; interrupt 9 mask
  513. INTAMSK         EQU     00000100B       ;; interrupt A mask
  514. INTBMSK         EQU     00001000B       ;; interrupt B mask
  515. INTCMSK         EQU     00010000B       ;; interrupt C mask
  516. INTDMSK         EQU     00100000B       ;; interrupt D mask
  517. INTEMSK         EQU     01000000B       ;; interrupt E mask
  518. INTFMSK         EQU     10000000B       ;; interrupt F mask
  519.  
  520. EOI             EQU     020h            ;; non specific end of interrupt
  521.  
  522. ; dma controller #1 port addresses
  523.  
  524. DMAC0ADDR       EQU     000h            ;; DMA channel 0 Base & Current Address
  525. DMAC0COUNT      EQU     001h            ;; DMA channel 0 Base & Current Count
  526. DMAC1ADDR       EQU     002h            ;; DMA channel 1 Base & Current Address
  527. DMAC1COUNT      EQU     003h            ;; DMA channel 1 Base & Current Count
  528. DMAC2ADDR       EQU     004h            ;; DMA channel 2 Base & Current Address
  529. DMAC2COUNT      EQU     005h            ;; DMA channel 2 Base & Current Count
  530. DMAC3ADDR       EQU     006h            ;; DMA channel 3 Base & Current Address
  531. DMAC3COUNT      EQU     007h            ;; DMA channel 3 Base & Current Count
  532.  
  533. DMA2C4ADDR      EQU     0C0h            ;; DMA channel 4 Base & Current Address
  534. DMA2C4COUNT     EQU     0C2h            ;; DMA channel 4 Base & Current Count
  535. DMA2C5ADDR      EQU     0C4h            ;; DMA channel 5 Base & Current Address
  536. DMA2C5COUNT     EQU     0C6h            ;; DMA channel 5 Base & Current Count
  537. DMA2C6ADDR      EQU     0C8h            ;; DMA channel 6 Base & Current Address
  538. DMA2C6COUNT     EQU     0CAh            ;; DMA channel 6 Base & Current Count
  539. DMA2C7ADDR      EQU     0CCh            ;; DMA channel 7 Base & Current Address
  540. DMA2C7COUNT     EQU     0CEh            ;; DMA channel 7 Base & Current Count
  541.  
  542. DMARDSTAT       EQU     008h            ;; DMA read status
  543. DMAWRCNTRL      EQU     008h            ;; DMA write command register
  544. DMAWREQ         EQU     009h            ;; DMA write request register
  545. DMAWRSMR        EQU     00Ah            ;; DMA write single mask register
  546. DMAWRMODE       EQU     00Bh            ;; DMA write mode register
  547. DMACLEAR        EQU     00Ch            ;; DMA clear low/high flip-flop
  548. DMARDTEMP       EQU     00Dh            ;; DMA read temp register
  549. DMAWRCLR        EQU     00Dh            ;; DMA write master clear
  550. DMACLRMSK       EQU     00Eh            ;; DMA clear mask register
  551. DMAWRALL        EQU     00Fh            ;; DMA write all mask register bits
  552.  
  553. DMA2RDSTAT      EQU     0D0h            ;; DMA read status
  554. DMA2WRCNTRL     EQU     0D0h            ;; DMA write command register
  555. DMA2WREQ        EQU     0D2h            ;; DMA write request register
  556. DMA2WRSMR       EQU     0D4h            ;; DMA write single mask register
  557. DMA2WRMODE      EQU     0D6h            ;; DMA write mode register
  558. DMA2CLEAR       EQU     0D8h            ;; DMA clear low/high flip-flop
  559. DMA2RDTEMP      EQU     0DAh            ;; DMA read temp register
  560. DMA2WRCLR       EQU     0DAh            ;; DMA write master clear
  561. DMA2CLRMSK      EQU     0DCh            ;; DMA clear mask register
  562. DMA2WRALL       EQU     0DEh            ;; DMA write all mask register bits
  563.  
  564. CH0PAGEREG      EQU     087h            ;; Channel 0 Page Register
  565. CH1PAGEREG      EQU     083h            ;; Channel 1 Page Register
  566. CH2PAGEREG      EQU     081h            ;; Channel 2 Page Register
  567. CH3PAGEREG      EQU     082h            ;; Channel 3 Page Register
  568.  
  569. CH5PAGEREG      EQU     08Bh            ;; Channel 5 Page Register
  570. CH6PAGEREG      EQU     089h            ;; Channel 6 Page Register
  571. CH7PAGEREG      EQU     08Ah            ;; Channel 7 Page Register
  572.  
  573. SYSSPKRTMR      EQU     00042h          ;; System Speaker Timer Address
  574. SYSTMRCTLR      EQU     00043h          ;; System Timer Control Register
  575. SYSSPKRREG      EQU     00061h          ;; System Speaker Register
  576. JOYSTICK        EQU     00201h          ;; Joystick Register
  577.  
  578. ;   /*\
  579. ;---|*|----====< Assember Miscellaneous Definitions >====----
  580. ;   \*/
  581.  
  582. TRUE    equ     -1
  583. FALSE   equ      0
  584.  
  585. wptr    equ     <word ptr>
  586. bptr    equ     <byte ptr>
  587. dptr    equ     <dword ptr>
  588.  
  589. ; PUSHA stack frame, plus ES & DS
  590.  
  591. regwset struc
  592.  _regDS dw      ?
  593.  _regES dw      ?
  594.  _regDI dw      ?
  595.  _regSI dw      ?
  596.  _regBP dw      ?
  597.  _regSP dw      ?
  598.  _regBX dw      ?
  599.  _regDX dw      ?
  600.  _regCX dw      ?
  601.  _regAX dw      ?
  602. regwset ends
  603.  
  604. ; stack frame accesses
  605.  
  606. _DI     equ     <word ptr [bp+_regDI]>
  607. _SI     equ     <word ptr [bp+_regSI]>
  608. _BP     equ     <word ptr [bp+_regBP]>
  609. _SP     equ     <word ptr [bp+_regSP]>
  610. _BX     equ     <word ptr [bp+_regBX]>
  611. _BL     equ     <byte ptr [bp+_regBX]>
  612. _BH     equ     <byte ptr [bp+_regBX+1]>
  613. _DX     equ     <word ptr [bp+_regDX]>
  614. _DL     equ     <byte ptr [bp+_regDX]>
  615. _DH     equ     <byte ptr [bp+_regDX+1]>
  616. _CX     equ     <word ptr [bp+_regCX]>
  617. _CL     equ     <byte ptr [bp+_regCX]>
  618. _CH     equ     <byte ptr [bp+_regCX+1]>
  619. _AX     equ     <word ptr [bp+_regAX]>
  620. _AL     equ     <byte ptr [bp+_regAX]>
  621. _AH     equ     <byte ptr [bp+_regAX+1]>
  622.  
  623.  
  624. if @codesize
  625.   @ret equ 4
  626.   FFAR  equ     <far>
  627.   if1
  628.     %out compiling LARGE code segments
  629.   endif
  630. else
  631.   @ret equ 2
  632.   FFAR  equ     <near>
  633.   if1
  634.     %out compiling SMALL code segments
  635.   endif
  636. endif
  637.  
  638. if @datasize
  639.   @ptr equ 4
  640.   if1
  641.     %out compiling LARGE data segments
  642.   endif
  643. else
  644.   @ptr equ 2
  645.   if1
  646.     %out compiling SMALL data segments
  647.   endif
  648. endif
  649.  
  650. @farret  equ 4
  651. @nearret equ 2
  652. @farptr  equ 4
  653. @nearptr equ 2
  654.  
  655.  
  656. ;
  657. ; NEAR branches
  658. ;
  659. jjnz    macro   addr
  660.         LOCAL   jjmp
  661.         jz      jjmp
  662.         jmp     addr
  663.      jjmp:
  664.         endm
  665.  
  666. jjz     macro   addr
  667.         LOCAL   jjmp
  668.         jnz     jjmp
  669.         jmp     addr
  670.      jjmp:
  671.         endm
  672.  
  673. jjc     macro   addr
  674.         LOCAL   jjmp
  675.         jnc     jjmp
  676.         jmp     addr
  677.      jjmp:
  678.         endm
  679.  
  680. jjnc    macro   addr
  681.         LOCAL   jjmp
  682.         jc      jjmp
  683.         jmp     addr
  684.      jjmp:
  685.         endm
  686.  
  687. jjb     macro   addr
  688.         LOCAL   jjmp
  689.         jae     jjmp
  690.         jmp     addr
  691.      jjmp:
  692.         endm
  693.  
  694. jjbe    macro   addr
  695.         LOCAL   jjmp
  696.         ja      jjmp
  697.         jmp     addr
  698.      jjmp:
  699.         endm
  700.  
  701. jjl     macro   addr
  702.         LOCAL   jjmp
  703.         jge     jjmp
  704.         jmp     addr
  705.      jjmp:
  706.         endm
  707.  
  708. jjle    macro   addr
  709.         LOCAL   jjmp
  710.         jg      jjmp
  711.         jmp     addr
  712.      jjmp:
  713.         endm
  714.  
  715. jjge    macro   addr
  716.         LOCAL   jjmp
  717.         jl      jjmp
  718.         jmp     addr
  719.      jjmp:
  720.         endm
  721.  
  722. jjg     macro   addr
  723.         LOCAL   jjmp
  724.         jle     jjmp
  725.         jmp     addr
  726. jjmp:
  727.         endm
  728.  
  729. jja     macro   addr
  730.         LOCAL   jjmp
  731.         jbe     jjmp
  732.         jmp     addr
  733. jjmp:
  734.         endm
  735.  
  736. breakpoint      macro
  737.  if DEBUG
  738.  if1
  739.         %out Take this Out
  740.  endif
  741.         int 3
  742.  endif
  743.                 endm
  744.  
  745. ;   /*\
  746. ;---|*| end of DRIVER.INC
  747. ;   \*/
  748.  
  749.  
  750.