home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 4 Drivers / 04-Drivers.zip / cs0929a.zip / wavestrm.lst < prev    next >
File List  |  1999-09-29  |  64KB  |  1,597 lines

  1.  
  2. Module: D:\dev\csrc\os2dd\scd\wavestrm.c
  3. Group: 'DGROUP' CONST,CONST2,_DATA,_BSS
  4.  
  5. Segment: _TEXT  PARA   00000684 bytes  
  6.  
  7. //
  8. // wavestrm.c
  9. // 27-Jan-99
  10. //
  11. // 19-Feb-99 removed bogus reference/use of controlPtr->
  12. //
  13. // VOID    wavestreamProcess(WAVESTREAM *wsPtr);
  14. // ULONG   wavestreamGetCurrentTime(WAVESTREAM *wsPtr);
  15. // VOID    wavestreamSetCurrentTime(ULONG time, WAVESTREAM *wsPtr);
  16. // USHORT  wavestreamStart(WAVESTREAM *wsPtr);
  17. // USHORT  wavestreamStop(WAVESTREAM *wsPtr);
  18. // USHORT  wavestreamPause(WAVESTREAM *wsPtr);
  19. // USHORT  wavestreamResume(WAVESTREAM *wsPtr);
  20. // STREAM *wavestreamInit(USHORT streamType, MCI_AUDIO_INIT __far *mciInitPtr, WAVESTREAM *wsPtr);
  21. // USHORT  wavestreamDeinit(WAVESTREAM *wsPtr);
  22.  
  23. #include "cs40.h"
  24.  
  25. static USHORT RealignBuffer(ULONG endPos, STREAM_BUFFER *sbPtr);
  26. static VOID RealignPausedBuffers(WAVESTREAM *wsPtr);
  27. static VOID ResetAudioBuffer(WAVESTREAM *wsPtr);
  28. static VOID FillAudioBuffer(WAVESTREAM *wsPtr);
  29. static ULONG WriteAudioBuffer(WAVESTREAM *wsPtr);
  30. static ULONG ReadAudioBuffer(WAVESTREAM *wsPtr);
  31.  
  32. // ---------------------------------
  33. // in: wsPtr -> WAVESTREAM structure
  34. //out: n/a
  35. //nts: process irq
  36. //     called at interrupt time from the hardware objects' handler (waveplay handler, etc.)
  37. //     if buffers on proc queue get/put them ...
  38. //     (was Process)
  39. //     original notes follow (there was no _vUpdateProcessed() routine):
  40. //     --first call _vUpdateProcessed() to update the dma amd audio buffer related
  41. //     --stuff. Next if we have buffers on the primary queue try to read/write them
  42. //     --to the audiobuffer. Look at the buffers on the done queue and see if they
  43. //     --can be returned and finally process any events pending.
  44.  
  45. VOID wavestreamProcess(WAVESTREAM *wsPtr) {
  46.  
  47.  STREAM_BUFFER *sbPtr;
  48.  STREAM *streamPtr = wsPtr->streamPtr;
  49.  USHORT streamMode = wsPtr->streamPtr->streamType & STREAM_RW_MODE;
  50.  
  51.  0000                    wavestreamProcess_:
  52.  0000  53                                push    bx
  53.  0001  51                                push    cx
  54.  0002  52                                push    dx
  55.  0003  56                                push    si
  56.  0004  57                                push    di
  57.  0005  89 c6                             mov     si,ax
  58.  0007  b8 01 00                          mov     ax,0001H
  59.  
  60.  wsPtr->bytesProcessed = abUpdate(1, &wsPtr->waPtr->ab);  // get 'final' stream byte consumed/produced count
  61.  
  62.  000a  8b 54 02                          mov     dx,[si+2H]
  63.  000d  8b 1c                             mov     bx,[si]
  64.  000f  83 c2 0c                          add     dx,000cH
  65.  0012  8b 7f 1c                          mov     di,[bx+1cH]
  66.  0015  e8 00 00                          call    abUpdate_
  67.  0018  89 44 18                          mov     [si+18H],ax
  68.  001b  83 e7 01                          and     di,0001H
  69.  001e  89 54 1a                          mov     [si+1aH],dx
  70.  
  71.  if (streamMode == STREAM_WRITE) {           // playback
  72.  
  73. // even undoing this only brought it down to 58%!
  74. // so pretty-much rem'ed out all of the irq (just resets int and bye!)...it runs at 58%
  75. // don't know what the hell's going on
  76.  
  77.  0021  83 ff 01                          cmp     di,0001H
  78.  0024  75 47                             jne     L3
  79.  
  80.     if (sbNotEmpty(&streamPtr->sbaProc)) {   // if buffer in proc queue...
  81.  0026  8d 47 10                          lea     ax,[bx+10H]
  82.  0029  e8 00 00                          call    sbNotEmpty_
  83.  002c  85 c0                             test    ax,ax
  84.  002e  74 05                             je      L1
  85.  
  86.        FillAudioBuffer(wsPtr);               // keep audio buffer full
  87.     }
  88.  
  89.     // if there are buffers that have been completely written to the audio buffer
  90.     // check the first one on the done queue to see if the hardware has consumed it
  91.     // and if so return it
  92.  
  93. // rem'ing out the return-buffer stuff below only went from 66% down to 60% or so...hm
  94. // now checking the FillAudioBuffer section above (rem'ing it out--will get back tomorrow
  95. // in any case) ... if that's not it, have to check ssm_idc stuff next
  96.  
  97.  
  98. // should see about doing this out of interrupt context, via arm context hook (18-Feb-99)
  99. // since it calls back to SHDD and ints are enabled there
  100.  
  101.  0030  89 f0                             mov     ax,si
  102.  0032  e8 00 00                          call    FillAudioBuffer_
  103.  
  104.     if (sbNotEmpty(&streamPtr->sbaDone)) {   
  105.  0035  8d 57 14          L1              lea     dx,[bx+14H]
  106.  0038  89 d0                             mov     ax,dx
  107.  003a  e8 00 00                          call    sbNotEmpty_
  108.  003d  85 c0                             test    ax,ax
  109.  003f  74 44                             je      L5
  110.  
  111.        sbPtr = sbHead(&streamPtr->sbaDone);
  112.  0041  89 d0                             mov     ax,dx
  113.  0043  e8 00 00                          call    sbHead_
  114.  0046  89 c7                             mov     di,ax
  115.  
  116.        if ((wsPtr->bytesProcessed + wsPtr->waveConfig.bytesPerIRQ) >= sbPtr->bufferDonePos) {
  117.  0048  8b 54 18                          mov     dx,[si+18H]
  118.  004b  8b 4c 10                          mov     cx,[si+10H]
  119.  004e  8b 44 1a                          mov     ax,[si+1aH]
  120.  0051  01 ca                             add     dx,cx
  121.  0053  8b 4c 12                          mov     cx,[si+12H]
  122.  0056  8b 75 12                          mov     si,[di+12H]
  123.  0059  11 c8                             adc     ax,cx
  124.  005b  39 f0                             cmp     ax,si
  125.  005d  77 07                             ja      L2
  126.  005f  75 24                             jne     L5
  127.  0061  3b 55 10                          cmp     dx,[di+10H]
  128.  0064  72 1f                             jb      L5
  129.  
  130.           streamReturnBuffer(streamPtr);
  131.  0066  89 d8             L2              mov     ax,bx
  132.  0068  e8 00 00                          call    streamReturnBuffer_
  133.  
  134.        }
  135.     }
  136.  
  137.  }
  138.  else { // STREAM_READ capture
  139.  006b  eb 18                             jmp     L5
  140.  
  141.     ReadAudioBuffer(wsPtr);
  142.  006d  89 f0             L3              mov     ax,si
  143.  006f  e8 00 00                          call    ReadAudioBuffer_
  144.  0072  8d 57 14                          lea     dx,[bx+14H]
  145.  
  146.     while(sbNotEmpty(&streamPtr->sbaDone)) {
  147.  0075  89 d0             L4              mov     ax,dx
  148.  0077  e8 00 00                          call    sbNotEmpty_
  149.  007a  85 c0                             test    ax,ax
  150.  007c  74 07                             je      L5
  151.  
  152.        streamReturnBuffer(streamPtr);
  153.  007e  89 d8                             mov     ax,bx
  154.  0080  e8 00 00                          call    streamReturnBuffer_
  155.  
  156.     }
  157.  }
  158.  
  159. // streamProcessEvents(streamPtr); // stub routine for now
  160.  
  161.  return;
  162.  0083  eb f0                             jmp     L4
  163.  
  164. }
  165.  
  166.  
  167. // ---------------------------------
  168. // in: wsPtr -> WAVESTREAM structure
  169. //out: current time
  170. //nts: this calcs stream time in milliseconds based on...(?)
  171. //     -- time = bytes consumed / consume rate
  172. //
  173. //     IMPORTANT: often the use of this data is to not be returned directly, but
  174. //     a pointer to a variable that has its value (eg, wsPtr->currTime, or wsPtr->timeBase
  175. //     for control stop/pause) is returned instead (all DDCMD calls, but not SHD returns)
  176. //     -- if instead return the value directly all sorts of crap (silently) happens (19-Feb-99)
  177.  
  178.  0085  5f                L5              pop     di
  179.  0086  5e                                pop     si
  180.  0087  5a                                pop     dx
  181.  0088  59                                pop     cx
  182.  0089  5b                                pop     bx
  183.  008a  c3                                ret     
  184.  008b  fc                                cld     
  185.  
  186. ULONG wavestreamGetCurrentTime(WAVESTREAM *wsPtr) {
  187.  
  188.  ULONG msecs = 0, processed;
  189.  USHORT flag = 0;
  190.  008c                    wavestreamGetCurrentTime_:
  191.  008c  53                                push    bx
  192.  008d  51                                push    cx
  193.  008e  56                                push    si
  194.  008f  57                                push    di
  195.  0090  55                                push    bp
  196.  0091  89 e5                             mov     bp,sp
  197.  0093  83 ec 0c                          sub     sp,000cH
  198.  0096  89 c6                             mov     si,ax
  199.  
  200.  STREAM *streamPtr = wsPtr->streamPtr;
  201.  
  202.  0098  8b 3c                             mov     di,[si]
  203.  009a  31 db                             xor     bx,bx
  204.  
  205.  if (streamPtr->streamState == STREAM_STREAMING) flag = 1; // check w/hardware only if running
  206.  009c  8a 55 1e                          mov     dl,[di+1eH]
  207.  009f  31 c9                             xor     cx,cx
  208.  00a1  30 f6                             xor     dh,dh
  209.  00a3  31 c0                             xor     ax,ax
  210.  00a5  83 fa 01                          cmp     dx,0001H
  211.  00a8  75 02                             jne     L6
  212.  00aa  89 d0                             mov     ax,dx
  213.  
  214.  processed = abUpdate(flag, &wsPtr->waPtr->ab);
  215.  
  216.  00ac  8b 54 02          L6              mov     dx,[si+2H]
  217.  00af  83 c2 0c                          add     dx,000cH
  218.  00b2  e8 00 00                          call    abUpdate_
  219.  00b5  89 46 fc                          mov     [bp-4H],ax
  220.  00b8  89 56 fe                          mov     [bp-2H],dx
  221.  
  222.  if (processed) {
  223.  00bb  89 d0                             mov     ax,dx
  224.  00bd  8b 56 fc                          mov     dx,[bp-4H]
  225.  00c0  09 d0                             or      ax,dx
  226.  00c2  74 5e                             je      L7
  227.  00c4  8b 44 0e                          mov     ax,[si+0eH]
  228.  
  229.     ULONG c_rate = wsPtr->waveConfig.consumeRate;
  230.  00c7  8b 7c 0c                          mov     di,[si+0cH]
  231.  00ca  89 46 f6                          mov     [bp-0aH],ax
  232.  00cd  89 fb                             mov     bx,di
  233.  00cf  8b 4e f6                          mov     cx,[bp-0aH]
  234.  
  235.     ULONG secs = processed / c_rate;
  236.  00d2  89 d0                             mov     ax,dx
  237.  00d4  8b 56 fe                          mov     dx,[bp-2H]
  238.  00d7  e8 00 00                          call    __U4D
  239.  00da  8b 4e f6                          mov     cx,[bp-0aH]
  240.  00dd  89 46 f4                          mov     [bp-0cH],ax
  241.  
  242.     ULONG ov =   processed - (secs * c_rate);
  243.  00e0  89 fb                             mov     bx,di
  244.  00e2  89 56 f8                          mov     [bp-8H],dx
  245.  00e5  e8 00 00                          call    __U4M
  246.  00e8  8b 5e fc                          mov     bx,[bp-4H]
  247.  00eb  29 c3                             sub     bx,ax
  248.  00ed  89 d8                             mov     ax,bx
  249.  00ef  8b 5e fe                          mov     bx,[bp-2H]
  250.  00f2  19 d3                             sbb     bx,dx
  251.  00f4  89 da                             mov     dx,bx
  252.  00f6  31 c9                             xor     cx,cx
  253.  
  254.     msecs = ((ov * 1000) / c_rate) + (secs * 1000);
  255.  }
  256.  
  257.  00f8  bb e8 03                          mov     bx,03e8H
  258.  00fb  e8 00 00                          call    __U4M
  259.  00fe  8b 4e f6                          mov     cx,[bp-0aH]
  260.  0101  89 fb                             mov     bx,di
  261.  0103  e8 00 00                          call    __U4D
  262.  0106  bb e8 03                          mov     bx,03e8H
  263.  0109  89 c7                             mov     di,ax
  264.  010b  89 56 fa                          mov     [bp-6H],dx
  265.  010e  31 c9                             xor     cx,cx
  266.  0110  8b 46 f4                          mov     ax,[bp-0cH]
  267.  0113  8b 56 f8                          mov     dx,[bp-8H]
  268.  0116  e8 00 00                          call    __U4M
  269.  0119  89 fb                             mov     bx,di
  270.  011b  01 c3                             add     bx,ax
  271.  011d  8b 4e fa                          mov     cx,[bp-6H]
  272.  0120  11 d1                             adc     cx,dx
  273.  
  274.  return msecs + wsPtr->timeBase;  // if nothing yet processed, effectively returns just time base
  275.  0122  8b 44 1c          L7              mov     ax,[si+1cH]
  276.  0125  01 d8                             add     ax,bx
  277.  0127  8b 54 1e                          mov     dx,[si+1eH]
  278.  012a  11 ca                             adc     dx,cx
  279.  
  280. }
  281.  
  282.  
  283. // -----------------------------------
  284. // in: time = ms time to set time base
  285. //     wsPtr -> WAVESTREAM structure
  286. //out: n/a
  287. //nts: mmpm/2 sends stream starting time (may not be 0) so use this as the time base
  288.  
  289.  012c  89 ec                             mov     sp,bp
  290.  012e  5d                                pop     bp
  291.  012f  5f                                pop     di
  292.  0130  5e                                pop     si
  293.  0131  59                                pop     cx
  294.  0132  5b                                pop     bx
  295.  0133  c3                                ret     
  296.  
  297. VOID wavestreamSetCurrentTime(ULONG time, WAVESTREAM *wsPtr) {
  298.  
  299.  wsPtr->timeBase = time;
  300.  
  301.  return;
  302.  0134                    wavestreamSetCurrentTime_:
  303.  0134  89 47 1c                          mov     [bx+1cH],ax
  304.  0137  89 57 1e                          mov     [bx+1eH],dx
  305.  
  306. }
  307.  
  308.  
  309. // -----------------------------------
  310. // in: wsPtr -> WAVESTREAM structure
  311. //out: 0
  312. //nts:
  313.  
  314.  013a  c3                                ret     
  315.  013b  fc                                cld     
  316.  
  317. USHORT wavestreamStart(WAVESTREAM *wsPtr) {
  318.  
  319.  USHORT rc = 0;
  320.  
  321.  // waveConfig.bitsPerSample, channels, sampleRate, and dataType, must be setup
  322.  // (which is done in wavestreamInit()) before calling waConfigDev()
  323.  
  324.  013c                    wavestreamResume_:
  325.  013c                    wavestreamStart_:
  326.  013c  53                                push    bx
  327.  013d  56                                push    si
  328.  013e  89 c3                             mov     bx,ax
  329.  
  330.  waConfigDev(wsPtr);
  331.  0140  e8 00 00                          call    waConfigDev_
  332.  
  333.  ResetAudioBuffer(wsPtr);
  334.  
  335.  0143  89 d8                             mov     ax,bx
  336.  0145  e8 00 00                          call    ResetAudioBuffer_
  337.  
  338.  if (wsPtr->waPtr->devType == AUDIOHW_WAVE_PLAY) {
  339.  0148  8b 77 02                          mov     si,[bx+2H]
  340.  014b  83 7c 02 11                       cmp     word ptr [si+2H],0011H
  341.  014f  75 07                             jne     L8
  342.  
  343.     rc = waveplayStart(wsPtr);
  344.  }
  345.  0151  89 d8                             mov     ax,bx
  346.  0153  e8 00 00                          call    waveplayStart_
  347.  
  348.  else {
  349.  0156  eb 05                             jmp     L9
  350.  
  351.     rc = waverecStart(wsPtr);
  352.  }
  353.  
  354.  0158  89 d8             L8              mov     ax,bx
  355.  015a  e8 00 00                          call    waverecStart_
  356.  
  357.  if (rc) {
  358.  015d  85 c0             L9              test    ax,ax
  359.  015f  74 06                             je      L10
  360.  
  361.     rc = ERROR_START_STREAM;
  362.  }
  363.  0161  b8 ea 15                          mov     ax,15eaH
  364.  
  365.  else {
  366.  0164  5e                                pop     si
  367.  0165  5b                                pop     bx
  368.  0166  c3                                ret     
  369.  
  370.     wsPtr->streamPtr->streamState = STREAM_STREAMING;
  371.  }
  372.  
  373.  return rc;
  374.  0167  8b 1f             L10             mov     bx,[bx]
  375.  0169  c6 47 1e 01                       mov     byte ptr [bx+1eH],01H
  376.  
  377. }
  378.  
  379.  
  380. // -----------------------------------
  381. // in: wsPtr -> WAVESTREAM structure
  382. //out: 0
  383. //nts:
  384.  
  385.  016d  5e                                pop     si
  386.  016e  5b                                pop     bx
  387.  016f  c3                                ret     
  388.  
  389. USHORT wavestreamStop(WAVESTREAM *wsPtr) {
  390.  
  391.  USHORT rc = 0;
  392.  
  393.  0170  53                wavestreamStop_ push    bx
  394.  0171  51                                push    cx
  395.  0172  52                                push    dx
  396.  0173  56                                push    si
  397.  0174  89 c3                             mov     bx,ax
  398.  
  399.  if (wsPtr->waPtr->devType == AUDIOHW_WAVE_PLAY) {
  400.  0176  8b 77 02                          mov     si,[bx+2H]
  401.  0179  83 7c 02 11                       cmp     word ptr [si+2H],0011H
  402.  017d  75 05                             jne     L11
  403.  
  404.     rc = waveplayStop(wsPtr);
  405.  }
  406.  017f  e8 00 00                          call    waveplayStop_
  407.  
  408.  else {
  409.  0182  eb 03                             jmp     L12
  410.  
  411.     rc = waverecStop(wsPtr);
  412.  }
  413.  
  414.  0184  e8 00 00          L11             call    waverecStop_
  415.  0187  89 c1             L12             mov     cx,ax
  416.  
  417.  streamReturnBuffers(wsPtr->streamPtr);
  418.  0189  8b 07                             mov     ax,[bx]
  419.  018b  e8 00 00                          call    streamReturnBuffers_
  420.  
  421.  wsPtr->streamPtr->streamState = STREAM_STOPPED;
  422.  
  423.  018e  8b 37                             mov     si,[bx]
  424.  
  425.  wsPtr->timeBase = wavestreamGetCurrentTime(wsPtr); // local
  426.  
  427.  0190  89 d8                             mov     ax,bx
  428.  0192  c6 44 1e 00                       mov     byte ptr [si+1eH],00H
  429.  0196  e8 00 00                          call    wavestreamGetCurrentTime_
  430.  0199  89 47 1c                          mov     [bx+1cH],ax
  431.  019c  89 57 1e                          mov     [bx+1eH],dx
  432.  
  433.  abReset(wsPtr->streamPtr->streamType & STREAM_RW_MODE, &wsPtr->waPtr->ab);
  434.  
  435.  return rc;
  436.  019f  8b 57 02                          mov     dx,[bx+2H]
  437.  01a2  8b 1f                             mov     bx,[bx]
  438.  01a4  8b 47 1c                          mov     ax,[bx+1cH]
  439.  01a7  30 e4                             xor     ah,ah
  440.  01a9  83 c2 0c                          add     dx,000cH
  441.  01ac  24 01                             and     al,01H
  442.  01ae  e8 00 00                          call    abReset_
  443.  
  444. }
  445.  
  446.  
  447. // -----------------------------------
  448. // in: wsPtr -> WAVESTREAM structure
  449. //out: 0
  450. //nts:
  451.  
  452.  01b1  89 c8                             mov     ax,cx
  453.  01b3  5e                                pop     si
  454.  01b4  5a                                pop     dx
  455.  01b5  59                                pop     cx
  456.  01b6  5b                                pop     bx
  457.  01b7  c3                                ret     
  458.  
  459. USHORT wavestreamPause(WAVESTREAM *wsPtr) {
  460.  
  461.  USHORT rc = 0;
  462.  
  463.  01b8                    wavestreamPause_:
  464.  01b8  53                                push    bx
  465.  01b9  51                                push    cx
  466.  01ba  52                                push    dx
  467.  01bb  56                                push    si
  468.  01bc  89 c3                             mov     bx,ax
  469.  
  470.  if (wsPtr->waPtr->devType == AUDIOHW_WAVE_PLAY) {
  471.  01be  8b 77 02                          mov     si,[bx+2H]
  472.  01c1  83 7c 02 11                       cmp     word ptr [si+2H],0011H
  473.  01c5  75 05                             jne     L13
  474.  
  475.     rc = waveplayStop(wsPtr);
  476.  }
  477.  01c7  e8 00 00                          call    waveplayStop_
  478.  
  479.  else {
  480.  01ca  eb 03                             jmp     L14
  481.  
  482.     rc = waverecStop(wsPtr);
  483.  }
  484.  
  485.  01cc  e8 00 00          L13             call    waverecStop_
  486.  01cf  89 c1             L14             mov     cx,ax
  487.  
  488.  wsPtr->streamPtr->streamState = STREAM_PAUSED;
  489.  01d1  8b 37                             mov     si,[bx]
  490.  
  491.  RealignPausedBuffers(wsPtr);
  492.  
  493.  01d3  89 d8                             mov     ax,bx
  494.  01d5  c6 44 1e 02                       mov     byte ptr [si+1eH],02H
  495.  01d9  e8 00 00                          call    RealignPausedBuffers_
  496.  
  497.  wsPtr->timeBase = wavestreamGetCurrentTime(wsPtr); // local
  498.  
  499.  01dc  89 d8                             mov     ax,bx
  500.  01de  e8 00 00                          call    wavestreamGetCurrentTime_
  501.  01e1  89 47 1c                          mov     [bx+1cH],ax
  502.  01e4  89 57 1e                          mov     [bx+1eH],dx
  503.  
  504.  abReset(wsPtr->streamPtr->streamType & STREAM_RW_MODE, &wsPtr->waPtr->ab);
  505.  
  506. // !!!
  507. // testing new dma stuff (can just change logical dma buffer size at will)
  508. //
  509. //if (wsPtr->audioBufferSize == 0) {
  510. //   wsPtr->audioBufferSize = 8192;
  511. //}
  512.  
  513.  return rc;
  514.  01e7  8b 57 02                          mov     dx,[bx+2H]
  515.  01ea  8b 1f                             mov     bx,[bx]
  516.  01ec  8b 47 1c                          mov     ax,[bx+1cH]
  517.  01ef  30 e4                             xor     ah,ah
  518.  01f1  83 c2 0c                          add     dx,000cH
  519.  01f4  24 01                             and     al,01H
  520.  01f6  e8 00 00                          call    abReset_
  521.  
  522. }
  523.  
  524.  
  525. // -----------------------------------
  526. // in: wsPtr -> WAVESTREAM structure
  527. //out: 0
  528. //nts:
  529.  
  530. USHORT wavestreamResume(WAVESTREAM *wsPtr) {
  531.  
  532.  USHORT rc;
  533.  
  534.  // since the resume code is exactly the same as the start, just call start
  535.  
  536.  rc = wavestreamStart(wsPtr);  // this gets all of start inlined...
  537.  
  538.  return rc;
  539. }
  540.  
  541.  
  542. // -----------------------------------
  543. // in: streamType = AUDIOHW_WAVE_PLAY or _CAPTURE
  544. //     wsPtr -> WAVESTREAM structure, already allocated
  545. //out: n/a
  546. //nts:
  547. //     this called by "void IoctlAudioInit(PREQPACKET prp, USHORT LDev)"
  548. //     and should (I think) return a (STREAM *), which means the last
  549. //     thing this should do is call streamInit(...)
  550.  
  551.  01f9  89 c8                             mov     ax,cx
  552.  01fb  5e                                pop     si
  553.  01fc  5a                                pop     dx
  554.  01fd  59                                pop     cx
  555.  01fe  5b                                pop     bx
  556.  01ff  c3                                ret     
  557.  
  558. STREAM *wavestreamInit(USHORT streamType, MCI_AUDIO_INIT __far *mciInitPtr, WAVESTREAM *wsPtr) {
  559.  
  560.  USHORT rc = 0;
  561.  0200  56                wavestreamInit_ push    si
  562.  0201  57                                push    di
  563.  0202  55                                push    bp
  564.  0203  89 e5                             mov     bp,sp
  565.  0205  83 ec 0a                          sub     sp,000aH
  566.  0208  89 46 f8                          mov     [bp-8H],ax
  567.  020b  89 5e fc                          mov     [bp-4H],bx
  568.  020e  89 4e fe                          mov     [bp-2H],cx
  569.  0211  89 d6                             mov     si,dx
  570.  
  571.  STREAM *tstreamPtr = malloc(sizeof(STREAM));   // this gets free'd in wavestreamDeinit()
  572.  
  573.  0213  b8 26 00                          mov     ax,0026H
  574.  0216  e8 00 00                          call    malloc_
  575.  0219  89 46 fa                          mov     [bp-6H],ax
  576.  021c  89 46 f6                          mov     [bp-0aH],ax
  577.  
  578.  if (tstreamPtr) {
  579.  
  580.  021f  85 c0                             test    ax,ax
  581.  0221  0f 84 15 01                       je      L23
  582.  0225  b9 26 00                          mov     cx,0026H
  583.  0228  8b 7e fa                          mov     di,[bp-6H]
  584.  
  585.     MEMSET(tstreamPtr,0,sizeof(STREAM));
  586.  
  587.  022b  8c da                             mov     dx,ds
  588.  022d  31 c0                             xor     ax,ax
  589.  022f  8e c2                             mov     es,dx
  590.  0231  fc                                cld     
  591.  0232  85 c9                             test    cx,cx
  592.  0234  74 43                             je      L19
  593.  0236  83 f9 20                          cmp     cx,0020H
  594.  0239  72 37                             jb      L18
  595.  023b  f7 c1 01 00                       test    cx,0001H
  596.  023f  74 02                             je      L15
  597.  0241  88 c4                             mov     ah,al
  598.  0243  89 c3             L15             mov     bx,ax
  599.  0245  66 c1 e0 10                       shl     eax,10H
  600.  0249  89 d8                             mov     ax,bx
  601.  024b  f7 c7 03 00                       test    di,0003H
  602.  024f  74 12                             je      L17
  603.  0251  f7 c7 01 00                       test    di,0001H
  604.  0255  74 08                             je      L16
  605.  0257  aa                                stosb   
  606.  0258  49                                dec     cx
  607.  0259  f7 c7 02 00                       test    di,0002H
  608.  025d  74 04                             je      L17
  609.  025f  ab                L16             stosw   
  610.  0260  83 e9 02                          sub     cx,0002H
  611.  0263  88 cb             L17             mov     bl,cl
  612.  0265  c1 e9 02                          shr     cx,02H
  613.  0268  f3 66 ab                          repe    stosd    
  614.  026b  80 e3 03                          and     bl,03H
  615.  026e  74 09                             je      L19
  616.  0270  88 d9                             mov     cl,bl
  617.  0272  d1 e9             L18             shr     cx,1
  618.  0274  f3 ab                             repe    stosw    
  619.  0276  73 01                             jae     L19
  620.  0278  aa                                stosb   
  621.  
  622.     rc = streamInit(streamType, tstreamPtr);
  623.  0279  8b 56 fa          L19             mov     dx,[bp-6H]
  624.  027c  8b 46 f8                          mov     ax,[bp-8H]
  625.  027f  e8 00 00                          call    streamInit_
  626.  0282  89 c3                             mov     bx,ax
  627.  
  628.     if (rc == 0) {
  629.  
  630.  0284  85 c0                             test    ax,ax
  631.  0286  0f 85 a1 00                       jne     L22
  632.  
  633.        tstreamPtr->wsParentPtr = wsPtr;
  634.  
  635.        // update WAVESTREAM
  636.  
  637.        wsPtr->streamPtr = tstreamPtr;
  638.  
  639.        // WAVEAUDIO waPtr-> data already setup (incl. dma, audiobuffer)
  640.        // but still need to set WAVESTREAM.waPtr -> wap (or war) structure (6-Feb-99)
  641.  
  642.  028a  8b 7e fa                          mov     di,[bp-6H]
  643.  028d  89 75 24                          mov     [di+24H],si
  644.  
  645.        if (streamType == AUDIOHW_WAVE_PLAY) {
  646.  0290  8b 4e f8                          mov     cx,[bp-8H]
  647.  0293  89 3c                             mov     [si],di
  648.  0295  83 f9 11                          cmp     cx,0011H
  649.  0298  75 07                             jne     L20
  650.  
  651.           wsPtr->waPtr = &wap;
  652.        }
  653.  029a  c7 44 02 00 00                    mov     word ptr [si+2H],offset _wap
  654.  
  655.        else {
  656.  029f  eb 05                             jmp     L21
  657.  
  658.           wsPtr->waPtr = &war;
  659.  02a1  c7 44 02 00 00    L20             mov     word ptr [si+2H],offset _war
  660.  
  661.        }
  662.  
  663.        //WAVECONFIG. data already setup, some of it? like silence
  664.  
  665.  02a6  8b 46 f8          L21             mov     ax,[bp-8H]
  666.  
  667.        abReset(streamType & STREAM_RW_MODE, &wsPtr->waPtr->ab);
  668.  02a9  8b 54 02                          mov     dx,[si+2H]
  669.  02ac  30 e4                             xor     ah,ah
  670.  02ae  83 c2 0c                          add     dx,000cH
  671.  02b1  24 01                             and     al,01H
  672.  02b3  8b 7e fc                          mov     di,[bp-4H]
  673.  02b6  e8 00 00                          call    abReset_
  674.  
  675.        wsPtr->waveConfig.sampleRate = (USHORT)mciInitPtr->lSRate;
  676.  02b9  8e 46 fe                          mov     es,[bp-2H]
  677.  02bc  26 8b 05                          mov     ax,es:[di]
  678.  02bf  89 44 04                          mov     [si+4H],ax
  679.  
  680.        wsPtr->waveConfig.bitsPerSample = (UCHAR)mciInitPtr->lBitsPerSRate;
  681.  02c2  26 8a 45 04                       mov     al,es:[di+4H]
  682.  02c6  88 44 08                          mov     [si+8H],al
  683.  
  684.        wsPtr->waveConfig.channels = (UCHAR)mciInitPtr->sChannels;
  685.  02c9  26 8a 45 0e                       mov     al,es:[di+0eH]
  686.  02cd  88 44 09                          mov     [si+9H],al
  687.  
  688.        wsPtr->waveConfig.dataType = mciInitPtr->sMode;
  689.  
  690.  02d0  26 8b 45 0c                       mov     ax,es:[di+0cH]
  691.  
  692.        wsPtr->audioBufferSize = 0;  // 0=use default logical DMA size
  693.  02d4  c7 44 14 00 00                    mov     word ptr [si+14H],0000H
  694.  
  695.        wsPtr->bytesProcessed = 0;
  696.  02d9  c7 44 18 00 00                    mov     word ptr [si+18H],0000H
  697.  02de  c7 44 1a 00 00                    mov     word ptr [si+1aH],0000H
  698.  
  699.        wsPtr->timeBase = 0;
  700.  
  701.  02e3  c7 44 1c 00 00                    mov     word ptr [si+1cH],0000H
  702.  02e8  c7 44 1e 00 00                    mov     word ptr [si+1eH],0000H
  703.  02ed  89 44 0a                          mov     [si+0aH],ax
  704.  
  705.        mciInitPtr->sSlotNumber = -1;
  706.  02f0  89 fe                             mov     si,di
  707.  02f2  26 c7 84 22 01 ff 
  708.        ff                                mov     word ptr es:[si+122H],0ffffH
  709.  
  710.        mciInitPtr->lResolution = 10;
  711.  
  712.  02f9  26 c7 44 10 0a 00                 mov     word ptr es:[si+10H],000aH
  713.  
  714.        mciInitPtr->ulFlags = mciInitPtr->ulFlags | FIXED | LEFT_ALIGNED;
  715.  
  716.        // original had this if flags == 8...snafu (pas16 has 8 also)
  717.  
  718.  02ff  26 8a a4 18 01                    mov     ah,es:[si+118H]
  719.  0304  26 c7 44 12 00 00                 mov     word ptr es:[si+12H],0000H
  720.  030a  80 cc 03                          or      ah,03H
  721.  030d  26 88 a4 18 01                    mov     es:[si+118H],ah
  722.  
  723.        if (mciInitPtr->ulFlags == 16) {
  724.  0312  26 8b bc 1a 01                    mov     di,es:[si+11aH]
  725.  0317  26 8b 84 18 01                    mov     ax,es:[si+118H]
  726.  031c  85 ff                             test    di,di
  727.  031e  75 0b                             jne     L22
  728.  0320  3d 10 00                          cmp     ax,0010H
  729.  0323  75 06                             jne     L22
  730.  
  731.           mciInitPtr->ulFlags = mciInitPtr->ulFlags | TWOS_COMPLEMENT;
  732.        }
  733.     }
  734.  
  735.     // since rc only possible if streamInit() failed, don't need to use streamDeinit()
  736.     // but...streamInit() currently never fails...
  737.  
  738.  0325  26 80 8c 18 01 08                 or      byte ptr es:[si+118H],08H
  739.  
  740.     if (rc) {
  741.  032b  85 db             L22             test    bx,bx
  742.  032d  74 0b                             je      L23
  743.  
  744.        free(tstreamPtr);
  745.  032f  8b 46 f6                          mov     ax,[bp-0aH]
  746.  
  747.        tstreamPtr = 0;
  748.     }
  749.  }
  750.  
  751.  return tstreamPtr;
  752.  0332  31 d2                             xor     dx,dx
  753.  0334  e8 00 00                          call    free_
  754.  0337  89 56 f6                          mov     [bp-0aH],dx
  755.  
  756. }
  757.  
  758. // ------------------
  759. // in:
  760. //out:
  761. //nts: deinit used rather than just doing this in streamDeinit
  762. //     just to reverse wavestreamInit() concept
  763.  
  764.  033a  8b 46 f6          L23             mov     ax,[bp-0aH]
  765.  033d  89 ec                             mov     sp,bp
  766.  033f  5d                                pop     bp
  767.  0340  5f                                pop     di
  768.  0341  5e                                pop     si
  769.  0342  c3                                ret     
  770.  0343  fc                                cld     
  771.  
  772. USHORT wavestreamDeinit(WAVESTREAM *wsPtr) {
  773.  
  774.  USHORT rc = 0;
  775.  
  776.  0344                    wavestreamDeinit_:
  777.  0344  53                                push    bx
  778.  0345  89 c3                             mov     bx,ax
  779.  
  780.  streamDeinit(wsPtr->streamPtr);
  781.  0347  8b 07                             mov     ax,[bx]
  782.  0349  e8 00 00                          call    streamDeinit_
  783.  
  784.  free(wsPtr->streamPtr);
  785.  034c  8b 07                             mov     ax,[bx]
  786.  034e  e8 00 00                          call    free_
  787.  
  788.  free(wsPtr);
  789.  
  790.  return rc;
  791.  0351  89 d8                             mov     ax,bx
  792.  0353  e8 00 00                          call    free_
  793.  
  794. }
  795.  
  796.  
  797. // --------------------------
  798. // in: endPos
  799. //     sbPtr -> stream buffer
  800. //out:
  801. //nts:
  802. //
  803. //  _vRealignBuffer
  804. //  called just after a wave stream pause on a playback.
  805. //  Gets the end position of the stream when paused and a pointer to a
  806. //  STREAMBUFFER. Basicly this function looks at the streambuffer and if
  807. // there is any unplayed data in it it adjusts the bufpos counter.
  808. // the donepos counter is ALWAYS set to zero. It will return 0 if all
  809. // the data has been played and 1 if there is still some data left.
  810. //
  811. // note that sbPtr->sizes are being aligned with 0xFFFFFFFC, which should do fine (don't use ALIGN_FILL_...)
  812.  
  813.  0356  31 c0                             xor     ax,ax
  814.  0358  5b                                pop     bx
  815.  0359  c3                                ret     
  816.  035a  89 c0                             mov     ax,ax
  817.  
  818. static USHORT RealignBuffer(ULONG endPos, STREAM_BUFFER *sbPtr) {
  819.  
  820.  USHORT rc = 1;
  821.  ULONG sbStart, consumed;
  822.  
  823.  035c  51                RealignBuffer_  push    cx
  824.  035d  56                                push    si
  825.  035e  57                                push    di
  826.  035f  89 c6                             mov     si,ax
  827.  0361  89 d1                             mov     cx,dx
  828.  
  829.  sbStart = sbPtr->bufferDonePos - sbPtr->bufferCurrPos;
  830.  
  831.  0363  8b 57 10                          mov     dx,[bx+10H]
  832.  0366  8b 47 12                          mov     ax,[bx+12H]
  833.  0369  2b 57 0c                          sub     dx,[bx+0cH]
  834.  036c  1b 47 0e                          sbb     ax,[bx+0eH]
  835.  036f  bf 01 00                          mov     di,0001H
  836.  
  837.  if (endPos <= sbStart) {       // none of the data in this stream buffer has been consumed yet
  838.  0372  39 c1                             cmp     cx,ax
  839.  0374  72 06                             jb      L24
  840.  0376  75 1a                             jne     L25
  841.  0378  39 d6                             cmp     si,dx
  842.  037a  77 16                             ja      L25
  843.  
  844.     sbPtr->bufferDonePos = 0;   
  845.  037c  c7 47 10 00 00    L24             mov     word ptr [bx+10H],0000H
  846.  0381  c7 47 12 00 00                    mov     word ptr [bx+12H],0000H
  847.  
  848.     sbPtr->bufferCurrPos = 0;   
  849.     // rc = 1; already is
  850.  }
  851.  0386  c7 47 0c 00 00                    mov     word ptr [bx+0cH],0000H
  852.  038b  c7 47 0e 00 00                    mov     word ptr [bx+0eH],0000H
  853.  
  854.  else {                         // some or all of the data has been consumed
  855.  0390  eb 50                             jmp     L28
  856.  
  857.     consumed = endPos - sbStart;
  858.  0392  29 d6             L25             sub     si,dx
  859.  0394  19 c1                             sbb     cx,ax
  860.  
  861.     if (consumed <= sbPtr->bufferSize) {        // some has been...
  862.  0396  8b 47 0a                          mov     ax,[bx+0aH]
  863.  0399  8b 57 08                          mov     dx,[bx+8H]
  864.  039c  39 c1                             cmp     cx,ax
  865.  039e  72 06                             jb      L26
  866.  03a0  75 28                             jne     L27
  867.  03a2  39 d6                             cmp     si,dx
  868.  03a4  77 24                             ja      L27
  869.  
  870.        sbPtr->bufferDonePos = 0;
  871.  
  872. // !!!
  873. // not sure if this should be ALIGN_FILL_PLAY instead of 0xFFFFFFFC
  874. // but either this or the one in RealignBuffers() caused problem at pause if used FFFFFFFC
  875.  
  876.        //sbPtr->bufferCurrPos = (sbPtr->bufferSize-consumed) & 0xFFFFFFFC; //always keep dword-aligned
  877.  03a6  c7 47 10 00 00    L26             mov     word ptr [bx+10H],0000H
  878.  
  879.        sbPtr->bufferCurrPos = (sbPtr->bufferSize-consumed) & ALIGN_FILL_PLAY;
  880.        // rc = 1; already is
  881.     }
  882.     else {                      // all has been...
  883.  03ab  8b 57 08                          mov     dx,[bx+8H]
  884.  03ae  c7 47 12 00 00                    mov     word ptr [bx+12H],0000H
  885.  03b3  29 f2                             sub     dx,si
  886.  03b5  8b 47 0a                          mov     ax,[bx+0aH]
  887.  03b8  19 c8                             sbb     ax,cx
  888.  03ba  89 47 0e                          mov     [bx+0eH],ax
  889.  03bd  81 e2 00 fc                       and     dx,0fc00H
  890.  03c1  89 57 0c                          mov     [bx+0cH],dx
  891.  03c4  89 f8                             mov     ax,di
  892.  03c6  5f                                pop     di
  893.  03c7  5e                                pop     si
  894.  03c8  59                                pop     cx
  895.  03c9  c3                                ret     
  896.  
  897.        sbPtr->bufferDonePos = 0;
  898.  03ca  c7 47 10 00 00    L27             mov     word ptr [bx+10H],0000H
  899.  03cf  c7 47 12 00 00                    mov     word ptr [bx+12H],0000H
  900.  
  901.        sbPtr->bufferCurrPos = sbPtr->bufferSize;
  902.  03d4  8b 57 08                          mov     dx,[bx+8H]
  903.  03d7  8b 47 0a                          mov     ax,[bx+0aH]
  904.  03da  89 57 0c                          mov     [bx+0cH],dx
  905.  
  906.        rc = 0;
  907.     }
  908.  }
  909.  
  910.  return rc;
  911.  03dd  31 ff                             xor     di,di
  912.  03df  89 47 0e                          mov     [bx+0eH],ax
  913.  
  914. }
  915.  
  916.  
  917. // ----------------------------------
  918. // in: wsPtr -> wave stream structure
  919. //out:
  920. //nts:
  921. //
  922. // _vRealignPausedBuffers(void)
  923. // When a stream is paused, have to "realign" the data in the audio buffer with reality, since:
  924. // - on playback, not all the data in the audio buffer has been consumed
  925. // - on capture, not all the good data in the audio buffer has been copied out
  926. //
  927. // After getting DDCMDCONTROL PAUSE cmd, this routine is called to line the MMPM buffers back up:
  928. // - for a capture stream: copy any data still in the audio buffer to an MMPM buffer
  929. // - for a playback stream:
  930. // -- check the STREAMBUFFER at proc queue to see if any unconsumed data is in the audio buffer
  931. //    if yes, back up bufferCurrPos (was ulBuffpos) in the STREAMBUFFER
  932. // -- check any STREAMBUFFERs on done queue, starting with the last one (the tail).
  933. //    if necessary, back up bufferCurrPos (was ulBuffpos) and put the STREAMBUFFER on the Head queue
  934.  
  935.  03e2  89 f8             L28             mov     ax,di
  936.  03e4  5f                                pop     di
  937.  03e5  5e                                pop     si
  938.  03e6  59                                pop     cx
  939.  03e7  c3                                ret     
  940.  
  941. static VOID RealignPausedBuffers(WAVESTREAM *wsPtr) {
  942.  
  943.  03e8                    RealignPausedBuffers_:
  944.  03e8  53                                push    bx
  945.  03e9  51                                push    cx
  946.  03ea  52                                push    dx
  947.  03eb  56                                push    si
  948.  03ec  57                                push    di
  949.  03ed  55                                push    bp
  950.  03ee  89 e5                             mov     bp,sp
  951.  03f0  83 ec 02                          sub     sp,0002H
  952.  03f3  89 c3                             mov     bx,ax
  953.  
  954.  STREAM *streamPtr = wsPtr->streamPtr;
  955.  
  956.  03f5  8b 37                             mov     si,[bx]
  957.  
  958.  if ((streamPtr->streamType & STREAM_RW_MODE) == STREAM_READ) {
  959.  03f7  f6 44 1c 01                       test    byte ptr [si+1cH],01H
  960.  03fb  75 08                             jne     L29
  961.  
  962.     ReadAudioBuffer(wsPtr);  // capture/recording
  963.  }
  964.  03fd  89 d8                             mov     ax,bx
  965.  03ff  e8 00 00                          call    ReadAudioBuffer_
  966.  
  967.  else {
  968.  
  969.     static STREAM_BUFFER_ANCHOR sbaTemp; // have to use static else gets "pointer truncated" warning
  970.                                          // which is probably a compiler bug (!) anyway, check later
  971.     STREAM_BUFFER *tsbPtr;
  972.     ULONG endPos;
  973.     USHORT rc;
  974.  
  975.  0402  e9 94 00                          jmp     L35
  976.  
  977.     sbaTemp.headPtr = 0;
  978.  0405  31 d2             L29             xor     dx,dx
  979.  0407  89 16 00 00                       mov     L46,dx
  980.  
  981.     sbaTemp.tailPtr = 0;
  982.  
  983. // !!!
  984. // not sure if this should be ALIGN_FILL_PLAY instead of 0xFFFFFFFC
  985. // but either this or the one in RealignBuffer() caused problem at pause if used FFFFFFFC
  986.  
  987.     //endPos = (abUpdate(1, &wsPtr->waPtr->ab)) & 0xFFFFFFFC; // get 'final' stream byte consumed/produced count
  988.  040b  89 16 02 00                       mov     L47,dx
  989.  
  990.     endPos = (abUpdate(1, &wsPtr->waPtr->ab)) & ALIGN_FILL_PLAY; // get 'final' stream byte consumed count
  991.  
  992.  040f  8b 57 02                          mov     dx,[bx+2H]
  993.  0412  b8 01 00                          mov     ax,0001H
  994.  0415  83 c2 0c                          add     dx,000cH
  995.  0418  e8 00 00                          call    abUpdate_
  996.  
  997.     if (sbNotEmpty(&streamPtr->sbaProc)) {   // if buffer in proc queue...
  998.  041b  8d 5c 10                          lea     bx,[si+10H]
  999.  041e  89 c1                             mov     cx,ax
  1000.  0420  89 d8                             mov     ax,bx
  1001.  0422  89 56 fe                          mov     [bp-2H],dx
  1002.  0425  e8 00 00                          call    sbNotEmpty_
  1003.  0428  81 e1 00 fc                       and     cx,0fc00H
  1004.  042c  85 c0                             test    ax,ax
  1005.  042e  74 14                             je      L30
  1006.  
  1007.        tsbPtr = sbHead(&streamPtr->sbaProc); // ...only care about first since rest are waiting...
  1008.  0430  89 d8                             mov     ax,bx
  1009.  0432  e8 00 00                          call    sbHead_
  1010.  0435  89 c3                             mov     bx,ax
  1011.  
  1012.        if (tsbPtr->bufferDonePos) {          // if any data has been written from this SB, realign
  1013.  0437  8b 47 12                          mov     ax,[bx+12H]
  1014.  043a  0b 47 10                          or      ax,[bx+10H]
  1015.  043d  74 05                             je      L30
  1016.  
  1017.           RealignBuffer(endPos, tsbPtr);
  1018.        }
  1019.     }
  1020.  
  1021.     // if buffers on the done queue, pop off head and push them on sbaTemp head
  1022.     // this is to re-order them, putting the more recently used ones at the front of the queue
  1023.     //
  1024.     // pass all those (on sbaTemp queue) to RealignBuffer():
  1025.     // -- if rc = 0: no unprocessed data in the buffer (ready to be returned as-is)
  1026.     //    so it gets put on the tail of the done queue
  1027.     // -- if rc = 1: put it on head of in-process queue
  1028.  
  1029.  043f  89 c8                             mov     ax,cx
  1030.  0441  e8 00 00                          call    RealignBuffer_
  1031.  
  1032.     while (sbNotEmpty(&streamPtr->sbaDone)) {
  1033.  0444  bf 00 00          L30             mov     di,offset L46
  1034.  0447  8d 5c 14                          lea     bx,[si+14H]
  1035.  044a  89 d8             L31             mov     ax,bx
  1036.  044c  e8 00 00                          call    sbNotEmpty_
  1037.  044f  85 c0                             test    ax,ax
  1038.  0451  74 0c                             je      L32
  1039.  
  1040.        tsbPtr = sbPopHead(&streamPtr->sbaDone);
  1041.  0453  89 d8                             mov     ax,bx
  1042.  
  1043.        sbPushOnHead(tsbPtr, &sbaTemp);
  1044.  0455  89 fa                             mov     dx,di
  1045.  0457  e8 00 00                          call    sbPopHead_
  1046.  045a  e8 00 00                          call    sbPushOnHead_
  1047.  
  1048.     }
  1049.  
  1050.  045d  eb eb                             jmp     L31
  1051.  
  1052.     while (sbNotEmpty(&sbaTemp)) {
  1053.  045f  8d 7c 14          L32             lea     di,[si+14H]
  1054.  0462  83 c6 10                          add     si,0010H
  1055.  0465  b8 00 00          L33             mov     ax,offset L46
  1056.  0468  e8 00 00                          call    sbNotEmpty_
  1057.  046b  85 c0                             test    ax,ax
  1058.  046d  74 2a                             je      L35
  1059.  
  1060.        tsbPtr = sbHead(&sbaTemp);
  1061.  046f  b8 00 00                          mov     ax,offset L46
  1062.  0472  8b 56 fe                          mov     dx,[bp-2H]
  1063.  0475  e8 00 00                          call    sbHead_
  1064.  
  1065.        rc = RealignBuffer(endPos, tsbPtr);
  1066.  0478  89 c3                             mov     bx,ax
  1067.  047a  89 c8                             mov     ax,cx
  1068.  047c  e8 00 00                          call    RealignBuffer_
  1069.  047f  89 c3                             mov     bx,ax
  1070.  
  1071.        tsbPtr = sbPopHead(&sbaTemp);
  1072.  0481  b8 00 00                          mov     ax,offset L46
  1073.  0484  e8 00 00                          call    sbPopHead_
  1074.  
  1075.        if (rc == 0) {   
  1076.           sbPushOnTail(tsbPtr, &streamPtr->sbaDone); // buffer is done
  1077.        }
  1078.  0487  85 db                             test    bx,bx
  1079.  0489  75 07                             jne     L34
  1080.  048b  89 fa                             mov     dx,di
  1081.  048d  e8 00 00                          call    sbPushOnTail_
  1082.  
  1083.        else {           
  1084.           sbPushOnHead(tsbPtr, &streamPtr->sbaProc); // buffer has more
  1085.  0490  eb d3                             jmp     L33
  1086.  0492  89 f2             L34             mov     dx,si
  1087.  0494  e8 00 00                          call    sbPushOnHead_
  1088.  
  1089.        }
  1090.     }
  1091.  }
  1092.  
  1093.  return;
  1094.  0497  eb cc                             jmp     L33
  1095.  
  1096. }
  1097.  
  1098.  
  1099. // ---------------------------------
  1100. // in: wsPtr -> WAVESTREAM structure
  1101. //out: n/a
  1102. //nts: prepare to stream
  1103. //     (was _vInitAudioBuf)
  1104.  
  1105.  0499  89 ec             L35             mov     sp,bp
  1106.  049b  5d                                pop     bp
  1107.  049c  5f                                pop     di
  1108.  049d  5e                                pop     si
  1109.  049e  5a                                pop     dx
  1110.  049f  59                                pop     cx
  1111.  04a0  5b                                pop     bx
  1112.  04a1  c3                                ret     
  1113.  04a2  89 c0                             mov     ax,ax
  1114.  
  1115. static VOID ResetAudioBuffer(WAVESTREAM *wsPtr) {
  1116.  
  1117.  AUDIOBUFFER *abPtr = &wsPtr->waPtr->ab;
  1118.  04a4                    ResetAudioBuffer_:
  1119.  04a4  53                                push    bx
  1120.  04a5  51                                push    cx
  1121.  04a6  52                                push    dx
  1122.  04a7  56                                push    si
  1123.  04a8  89 c3                             mov     bx,ax
  1124.  
  1125.  04aa  8b 37                             mov     si,[bx]
  1126.  
  1127.  USHORT streamMode = wsPtr->streamPtr->streamType & STREAM_RW_MODE;
  1128.  
  1129.  04ac  8b 4f 02                          mov     cx,[bx+2H]
  1130.  04af  8b 74 1c                          mov     si,[si+1cH]
  1131.  04b2  83 c1 0c                          add     cx,000cH
  1132.  04b5  83 e6 01                          and     si,0001H
  1133.  
  1134.  abReset(streamMode, abPtr);            // reset audiobuffer
  1135.  04b8  89 ca                             mov     dx,cx
  1136.  04ba  89 f0                             mov     ax,si
  1137.  04bc  e8 00 00                          call    abReset_
  1138.  
  1139.  if (streamMode == STREAM_WRITE) {
  1140.  04bf  83 fe 01                          cmp     si,0001H
  1141.  04c2  75 07                             jne     L36
  1142.  
  1143.     FillAudioBuffer(wsPtr);
  1144.  }
  1145.  04c4  89 d8                             mov     ax,bx
  1146.  04c6  e8 00 00                          call    FillAudioBuffer_
  1147.  
  1148.  else {
  1149.  04c9  eb 08                             jmp     L37
  1150.  04cb  89 ca             L36             mov     dx,cx
  1151.  
  1152.     abFill(wsPtr->waveConfig.silence, abPtr);
  1153.  }
  1154.  
  1155.  return;
  1156.  04cd  8b 47 06                          mov     ax,[bx+6H]
  1157.  04d0  e8 00 00                          call    abFill_
  1158.  
  1159. }
  1160.  
  1161.  
  1162. // ---------------------------------
  1163. // in: wsPtr -> WAVESTREAM structure
  1164. //out: n/a
  1165. //nts: fill audio buffer with as much data as possible (for playback)
  1166. //     align on 256 bytes sizes though, using ALIGN_FILL_PLAY
  1167. //     was _vFillAudioBuf
  1168.  
  1169.  04d3  5e                L37             pop     si
  1170.  04d4  5a                                pop     dx
  1171.  04d5  59                                pop     cx
  1172.  04d6  5b                                pop     bx
  1173.  04d7  c3                                ret     
  1174.  
  1175. static VOID FillAudioBuffer(WAVESTREAM *wsPtr) {
  1176.  
  1177.  ULONG space;
  1178.  ULONG bytesWritten = 0;        // just for tracePerf
  1179.  STREAM *streamPtr = wsPtr->streamPtr;
  1180.  04d8                    FillAudioBuffer_:
  1181.  04d8  53                                push    bx
  1182.  04d9  51                                push    cx
  1183.  04da  52                                push    dx
  1184.  04db  56                                push    si
  1185.  04dc  89 c3                             mov     bx,ax
  1186.  
  1187.  AUDIOBUFFER *abPtr = &wsPtr->waPtr->ab;
  1188.  
  1189.  // while have process buffers and there is space in the audio buffer, write data to the audio buffer
  1190.  
  1191. #ifdef TRACE_FILLAUDIOBUFFER
  1192.  tracePerf(TRACE_FILLAUDIOBUFFER_IN, _IF());
  1193. #endif
  1194.  
  1195.  04de  8b 4f 02                          mov     cx,[bx+2H]
  1196.  04e1  83 c1 0c                          add     cx,000cH
  1197.  
  1198.  space = abSpace(abPtr) & ALIGN_FILL_PLAY;
  1199.  
  1200.  04e4  89 c8                             mov     ax,cx
  1201.  04e6  8b 37                             mov     si,[bx]
  1202.  04e8  e8 00 00                          call    abSpace_
  1203.  04eb  25 00 fc                          and     ax,0fc00H
  1204.  04ee  09 d0                             or      ax,dx
  1205.  04f0  74 21                             je      L39
  1206.  
  1207.  while(space && sbNotEmpty(&streamPtr->sbaProc)) {
  1208.  04f2  83 c6 10                          add     si,0010H
  1209.  04f5  89 f0             L38             mov     ax,si
  1210.  04f7  e8 00 00                          call    sbNotEmpty_
  1211.  04fa  85 c0                             test    ax,ax
  1212.  04fc  74 15                             je      L39
  1213.  
  1214.     bytesWritten = bytesWritten + WriteAudioBuffer(wsPtr);  // bytesWritten just for tracePerf
  1215.  04fe  89 d8                             mov     ax,bx
  1216.  0500  e8 00 00                          call    WriteAudioBuffer_
  1217.  
  1218.     space = abSpace(abPtr) & ALIGN_FILL_PLAY;
  1219.  0503  89 c8                             mov     ax,cx
  1220.  0505  e8 00 00                          call    abSpace_
  1221.  0508  25 00 fc                          and     ax,0fc00H
  1222.  
  1223.  }
  1224.  
  1225. #ifdef TRACE_FILLAUDIOBUFFER
  1226.  tracePerf(TRACE_FILLAUDIOBUFFER_OUT, (bytesWritten << 16) | _IF());  //
  1227. #endif
  1228.  
  1229.  return;
  1230.  050b  85 d2                             test    dx,dx
  1231.  050d  75 e6                             jne     L38
  1232.  050f  85 c0                             test    ax,ax
  1233.  0511  75 e2                             jne     L38
  1234.  
  1235. }
  1236.  
  1237.  
  1238. // ---------------------------------
  1239. // in: wsPtr -> WAVESTREAM structure
  1240. //out: n/a
  1241. //nts: write one buffer to the audio buffer
  1242. //     caller must ensure that it's okay to write to the audio buffer
  1243. //     -- this assumes there's room and that there's a buffer on proc queue
  1244. //     (was _vAudioBufWrite)
  1245.  
  1246.  0513  5e                L39             pop     si
  1247.  0514  5a                                pop     dx
  1248.  0515  59                                pop     cx
  1249.  0516  5b                                pop     bx
  1250.  0517  c3                                ret     
  1251.  
  1252. static ULONG WriteAudioBuffer(WAVESTREAM *wsPtr) {
  1253.  
  1254.  UCHAR __far *dataBufferPtr;
  1255.  ULONG bufferLeft, bytesWritten, startPos;
  1256.  
  1257.  STREAM_BUFFER *sbPtr;
  1258.  0518                    WriteAudioBuffer_:
  1259.  0518  53                                push    bx
  1260.  0519  51                                push    cx
  1261.  051a  56                                push    si
  1262.  051b  57                                push    di
  1263.  051c  55                                push    bp
  1264.  051d  89 e5                             mov     bp,sp
  1265.  051f  83 ec 0a                          sub     sp,000aH
  1266.  0522  89 c3                             mov     bx,ax
  1267.  
  1268.  STREAM *streamPtr  = wsPtr->streamPtr;
  1269.  0524  8b 37                             mov     si,[bx]
  1270.  
  1271.  AUDIOBUFFER *abPtr = &wsPtr->waPtr->ab;
  1272.  
  1273.  0526  8b 47 02                          mov     ax,[bx+2H]
  1274.  0529  89 76 fe                          mov     [bp-2H],si
  1275.  052c  05 0c 00                          add     ax,000cH
  1276.  
  1277.  sbPtr =    sbHead(&streamPtr->sbaProc);
  1278.  052f  8d 7c 10                          lea     di,[si+10H]
  1279.  0532  89 46 f6                          mov     [bp-0aH],ax
  1280.  0535  89 f8                             mov     ax,di
  1281.  0537  e8 00 00                          call    sbHead_
  1282.  053a  89 c6                             mov     si,ax
  1283.  
  1284.  startPos = abBytes(abPtr);   // could just do "startPos = abPtr->bufferBytes;" (all routine does)
  1285.  
  1286.  dataBufferPtr = sbPtr->bufferPtr + sbPtr->bufferCurrPos;
  1287.  bufferLeft    = sbPtr->bufferSize - sbPtr->bufferCurrPos;
  1288.  
  1289.  053c  8b 46 f6                          mov     ax,[bp-0aH]
  1290.  053f  e8 00 00                          call    abBytes_
  1291.  
  1292.  bytesWritten  = abWrite(dataBufferPtr, bufferLeft, abPtr);  // write to the audio buffer
  1293.  
  1294.  0542  ff 76 f6                          push    [bp-0aH]
  1295.  0545  89 46 fa                          mov     [bp-6H],ax
  1296.  0548  89 56 f8                          mov     [bp-8H],dx
  1297.  054b  8b 5c 0c                          mov     bx,[si+0cH]
  1298.  054e  8b 44 04                          mov     ax,[si+4H]
  1299.  0551  8b 4c 0a                          mov     cx,[si+0aH]
  1300.  0554  01 d8                             add     ax,bx
  1301.  0556  8b 5c 08                          mov     bx,[si+8H]
  1302.  0559  8b 54 06                          mov     dx,[si+6H]
  1303.  055c  2b 5c 0c                          sub     bx,[si+0cH]
  1304.  055f  1b 4c 0e                          sbb     cx,[si+0eH]
  1305.  0562  e8 00 00                          call    abWrite_
  1306.  
  1307.  sbPtr->bufferDonePos = startPos + bytesWritten;  // store bytes written (updated in pause if needed)
  1308.  0565  8b 4e fa                          mov     cx,[bp-6H]
  1309.  0568  01 c1                             add     cx,ax
  1310.  056a  89 4c 10                          mov     [si+10H],cx
  1311.  056d  8b 4e f8                          mov     cx,[bp-8H]
  1312.  0570  11 d1                             adc     cx,dx
  1313.  0572  89 4c 12                          mov     [si+12H],cx
  1314.  
  1315.  sbPtr->bufferCurrPos = sbPtr->bufferCurrPos + bytesWritten; // update position according to Garp
  1316.  
  1317.  // check if this emptied the buffer (check on dword align in case last buffer, which may not be)
  1318.  // if it's empty put it on the tail of the Done queue
  1319.  
  1320.  0575  8b 4c 0c                          mov     cx,[si+0cH]
  1321.  0578  89 c3                             mov     bx,ax
  1322.  057a  01 c1                             add     cx,ax
  1323.  057c  8b 44 0e                          mov     ax,[si+0eH]
  1324.  057f  89 4c 0c                          mov     [si+0cH],cx
  1325.  0582  11 d0                             adc     ax,dx
  1326.  0584  89 44 0e                          mov     [si+0eH],ax
  1327.  0587  89 56 fc                          mov     [bp-4H],dx
  1328.  
  1329.  if (sbPtr->bufferCurrPos >= (sbPtr->bufferSize & 0xFFFFFFFC)) {
  1330.     STREAM_BUFFER *tsbPtr = sbPopHead(&streamPtr->sbaProc);
  1331.  058a  8b 54 08                          mov     dx,[si+8H]
  1332.  058d  8b 44 0a                          mov     ax,[si+0aH]
  1333.  0590  8b 4c 0e                          mov     cx,[si+0eH]
  1334.  0593  80 e2 fc                          and     dl,0fcH
  1335.  0596  39 c8                             cmp     ax,cx
  1336.  0598  72 07                             jb      L40
  1337.  059a  75 13                             jne     L41
  1338.  059c  3b 54 0c                          cmp     dx,[si+0cH]
  1339.  059f  77 0e                             ja      L41
  1340.  
  1341.  05a1  8b 56 fe          L40             mov     dx,[bp-2H]
  1342.  
  1343.     sbPushOnTail(tsbPtr, &streamPtr->sbaDone);
  1344.  05a4  89 f8                             mov     ax,di
  1345.  05a6  83 c2 14                          add     dx,0014H
  1346.  05a9  e8 00 00                          call    sbPopHead_
  1347.  05ac  e8 00 00                          call    sbPushOnTail_
  1348.  
  1349.  }
  1350.  
  1351.  return bytesWritten; // just so can use it for tracePerf
  1352.  05af  8b 56 fc          L41             mov     dx,[bp-4H]
  1353.  
  1354. }
  1355.  
  1356.  
  1357. // ---------------------------------
  1358. // in: wsPtr -> WAVESTREAM structure
  1359. //out: n/a
  1360. //nts: read recorded data from the audio buffer
  1361. //     called at interrupt time (via wavestreamProcess())
  1362. //     (was _vReadAudioBuf)
  1363.  
  1364.  05b2  89 d8                             mov     ax,bx
  1365.  05b4  89 ec                             mov     sp,bp
  1366.  05b6  5d                                pop     bp
  1367.  05b7  5f                                pop     di
  1368.  05b8  5e                                pop     si
  1369.  05b9  59                                pop     cx
  1370.  05ba  5b                                pop     bx
  1371.  05bb  c3                                ret     
  1372.  
  1373. static ULONG ReadAudioBuffer(WAVESTREAM *wsPtr) {
  1374.  
  1375.  UCHAR __far *dataBufferPtr;
  1376.  ULONG bufferLeft, space, bytesRead;
  1377.  ULONG totBytes = 0;  // need separate var since bytesRead used in loop
  1378.  
  1379.  STREAM_BUFFER *sbPtr;
  1380.  05bc                    ReadAudioBuffer_:
  1381.  05bc  53                                push    bx
  1382.  05bd  51                                push    cx
  1383.  05be  56                                push    si
  1384.  05bf  57                                push    di
  1385.  05c0  55                                push    bp
  1386.  05c1  89 e5                             mov     bp,sp
  1387.  05c3  83 ec 08                          sub     sp,0008H
  1388.  05c6  89 c3                             mov     bx,ax
  1389.  
  1390.  STREAM *streamPtr  = wsPtr->streamPtr;
  1391.  05c8  8b 3f                             mov     di,[bx]
  1392.  05ca  31 d2                             xor     dx,dx
  1393.  
  1394.  AUDIOBUFFER *abPtr = &wsPtr->waPtr->ab;
  1395.  
  1396.  05cc  8b 47 02                          mov     ax,[bx+2H]
  1397.  05cf  89 56 fc                          mov     [bp-4H],dx
  1398.  05d2  05 0c 00                          add     ax,000cH
  1399.  05d5  89 56 fe                          mov     [bp-2H],dx
  1400.  05d8  89 46 fa                          mov     [bp-6H],ax
  1401.  
  1402.  space = abSpace(abPtr) & ALIGN_FILL_CAPTURE;   // was not here at all before
  1403.  05db  e8 00 00                          call    abSpace_
  1404.  05de  25 00 fc                          and     ax,0fc00H
  1405.  05e1  09 c2                             or      dx,ax
  1406.  05e3  0f 84 8f 00                       je      L45
  1407.  
  1408.  while(space && sbNotEmpty(&streamPtr->sbaProc)) {
  1409.  
  1410.  05e7  8d 45 14                          lea     ax,[di+14H]
  1411.  05ea  89 46 f8                          mov     [bp-8H],ax
  1412.  05ed  83 c7 10                          add     di,0010H
  1413.  05f0  89 f8             L42             mov     ax,di
  1414.  05f2  e8 00 00                          call    sbNotEmpty_
  1415.  05f5  85 c0                             test    ax,ax
  1416.  05f7  0f 84 7b 00                       je      L45
  1417.  
  1418.     sbPtr = sbHead(&streamPtr->sbaProc);
  1419.  
  1420.     dataBufferPtr = sbPtr->bufferPtr + sbPtr->bufferCurrPos;
  1421.     bufferLeft    = sbPtr->bufferSize - sbPtr->bufferCurrPos;
  1422.  
  1423.  05fb  89 f8                             mov     ax,di
  1424.  05fd  e8 00 00                          call    sbHead_
  1425.  0600  89 c6                             mov     si,ax
  1426.  
  1427.     bytesRead = abRead(dataBufferPtr, bufferLeft, abPtr);  // read from the audio buffer
  1428.  0602  ff 76 fa                          push    [bp-6H]
  1429.  0605  8b 44 04                          mov     ax,[si+4H]
  1430.  0608  8b 5c 0c                          mov     bx,[si+0cH]
  1431.  060b  8b 54 06                          mov     dx,[si+6H]
  1432.  060e  01 d8                             add     ax,bx
  1433.  0610  8b 5c 08                          mov     bx,[si+8H]
  1434.  0613  8b 4c 0a                          mov     cx,[si+0aH]
  1435.  0616  2b 5c 0c                          sub     bx,[si+0cH]
  1436.  0619  1b 4c 0e                          sbb     cx,[si+0eH]
  1437.  061c  e8 00 00                          call    abRead_
  1438.  
  1439.     totBytes = totBytes + bytesRead;  // for tracePerf
  1440.  
  1441.  061f  8b 4e fc                          mov     cx,[bp-4H]
  1442.  0622  8b 5e fe                          mov     bx,[bp-2H]
  1443.  0625  01 c1                             add     cx,ax
  1444.  0627  89 4e fc                          mov     [bp-4H],cx
  1445.  
  1446.     sbPtr->bufferCurrPos = sbPtr->bufferCurrPos + bytesRead; // update position according to Garp
  1447.  
  1448.     // check if this emptied the buffer (check on dword align in case last buffer, which may not be)
  1449.     // if it's empty put it on the tail of the Done queue
  1450.  
  1451.  062a  8b 4c 0c                          mov     cx,[si+0cH]
  1452.  062d  11 d3                             adc     bx,dx
  1453.  062f  01 c1                             add     cx,ax
  1454.  0631  8b 44 0e                          mov     ax,[si+0eH]
  1455.  0634  89 4c 0c                          mov     [si+0cH],cx
  1456.  0637  11 d0                             adc     ax,dx
  1457.  0639  89 44 0e                          mov     [si+0eH],ax
  1458.  063c  89 5e fe                          mov     [bp-2H],bx
  1459.  063f  8b 4c 0c                          mov     cx,[si+0cH]
  1460.  
  1461.     if (sbPtr->bufferCurrPos >= (sbPtr->bufferSize & 0xFFFFFFFC)) {
  1462.  0642  8b 54 08                          mov     dx,[si+8H]
  1463.  0645  8b 44 0a                          mov     ax,[si+0aH]
  1464.  0648  8b 5c 0e                          mov     bx,[si+0eH]
  1465.  064b  80 e2 fc                          and     dl,0fcH
  1466.  064e  39 d8                             cmp     ax,bx
  1467.  0650  72 06                             jb      L43
  1468.  0652  75 0f                             jne     L44
  1469.  0654  39 ca                             cmp     dx,cx
  1470.  0656  77 0b                             ja      L44
  1471.  
  1472.        STREAM_BUFFER *tsbPtr = sbPopHead(&streamPtr->sbaProc);
  1473.        sbPushOnTail(tsbPtr, &streamPtr->sbaDone);
  1474.     }
  1475.  
  1476.  0658  89 f8             L43             mov     ax,di
  1477.  065a  8b 56 f8                          mov     dx,[bp-8H]
  1478.  065d  e8 00 00                          call    sbPopHead_
  1479.  0660  e8 00 00                          call    sbPushOnTail_
  1480.  
  1481.     space = abSpace(abPtr) & ALIGN_FILL_CAPTURE;  // was & 0xFFFFFFFC;;
  1482.  0663  8b 46 fa          L44             mov     ax,[bp-6H]
  1483.  0666  e8 00 00                          call    abSpace_
  1484.  0669  25 00 fc                          and     ax,0fc00H
  1485.  
  1486.  }
  1487.  
  1488.  return totBytes;
  1489.  066c  85 d2                             test    dx,dx
  1490.  066e  75 80                             jne     L42
  1491.  0670  85 c0                             test    ax,ax
  1492.  0672  0f 85 7a ff                       jne     L42
  1493.  
  1494. }
  1495.  
  1496.  
  1497.  
  1498.  0676  8b 46 fc          L45             mov     ax,[bp-4H]
  1499.  0679  8b 56 fe                          mov     dx,[bp-2H]
  1500.  067c  89 ec                             mov     sp,bp
  1501.  067e  5d                                pop     bp
  1502.  067f  5f                                pop     di
  1503.  0680  5e                                pop     si
  1504.  0681  59                                pop     cx
  1505.  0682  5b                                pop     bx
  1506.  0683  c3                                ret     
  1507.  
  1508. No disassembly errors
  1509.  
  1510. List of external symbols
  1511.  
  1512. Symbol
  1513. ----------------
  1514. abUpdate_        00000419 000000b3 00000016
  1515. sbNotEmpty_      000005f3 000004f8 00000469 0000044d 00000426 00000078 0000003b 0000002a
  1516. FillAudioBuffer_ 
  1517.                  000004c7 00000033
  1518. sbHead_          000005fe 00000538 00000476 00000433 00000044
  1519. streamReturnBuffer_ 
  1520.                  00000081 00000069
  1521. ReadAudioBuffer_ 
  1522.                  00000400 00000070
  1523. __U4D            00000104 000000d8
  1524. __U4M            00000117 000000fc 000000e6
  1525. waConfigDev_     00000141
  1526. ResetAudioBuffer_ 
  1527.                  00000146
  1528. waveplayStart_   00000154
  1529. waverecStart_    0000015b
  1530. waveplayStop_    000001c8 00000180
  1531. waverecStop_     000001cd 00000185
  1532. streamReturnBuffers_ 
  1533.                  0000018c
  1534. wavestreamGetCurrentTime_ 
  1535.                  000001df 00000197
  1536. abReset_         000004bd 000002b7 000001f7 000001af
  1537. RealignPausedBuffers_ 
  1538.                  000001da
  1539. malloc_          00000217
  1540. streamInit_      00000280
  1541. _wap             0000029d
  1542. _war             000002a4
  1543. free_            00000354 0000034f 00000335
  1544. streamDeinit_    0000034a
  1545. RealignBuffer_   0000047d 00000442
  1546. sbPopHead_       0000065e 000005aa 00000485 00000458
  1547. sbPushOnHead_    00000495 0000045b
  1548. sbPushOnTail_    00000661 000005ad 0000048e
  1549. abFill_          000004d1
  1550. abSpace_         00000667 000005dc 00000506 000004e9
  1551. WriteAudioBuffer_ 
  1552.                  00000501
  1553. abBytes_         00000540
  1554. abWrite_         00000563
  1555. abRead_          0000061d
  1556. ------------------------------------------------------------
  1557.  
  1558. Segment: _BSS  PARA   00000004 bytes  
  1559.  
  1560. No disassembly errors
  1561.  
  1562. ------------------------------------------------------------
  1563. List of public symbols
  1564.  
  1565. SYMBOL          GROUP           SEGMENT          ADDRESS
  1566. ---------------------------------------------------------
  1567. FillAudioBuffer_ 
  1568.                                 _TEXT            000004d8
  1569. ReadAudioBuffer_ 
  1570.                                 _TEXT            000005bc
  1571. RealignBuffer_                  _TEXT            0000035c
  1572. RealignPausedBuffers_ 
  1573.                                 _TEXT            000003e8
  1574. ResetAudioBuffer_ 
  1575.                                 _TEXT            000004a4
  1576. wavestreamDeinit_ 
  1577.                                 _TEXT            00000344
  1578. wavestreamGetCurrentTime_ 
  1579.                                 _TEXT            0000008c
  1580. wavestreamInit_                 _TEXT            00000200
  1581. wavestreamPause_ 
  1582.                                 _TEXT            000001b8
  1583. wavestreamProcess_ 
  1584.                                 _TEXT            00000000
  1585. wavestreamResume_ 
  1586.                                 _TEXT            0000013c
  1587. wavestreamSetCurrentTime_ 
  1588.                                 _TEXT            00000134
  1589. wavestreamStart_ 
  1590.                                 _TEXT            0000013c
  1591. wavestreamStop_                 _TEXT            00000170
  1592. WriteAudioBuffer_ 
  1593.                                 _TEXT            00000518
  1594.  
  1595. ------------------------------------------------------------
  1596.  
  1597.