Subversion Repositories Kolibri OS

Rev

Rev 281 | Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. ;
  2. ;   This file is part of the Infinity sound library.
  3. ;   (C) copyright Serge 2006
  4. ;   email: infinity_sound@mail.ru
  5. ;
  6. ;   This program is free software; you can redistribute it and/or modify
  7. ;   it under the terms of the GNU General Public License as published by
  8. ;   the Free Software Foundation; either version 2 of the License, or
  9. ;   (at your option) any later version.
  10. ;
  11. ;   This program is distributed in the hope that it will be useful,
  12. ;   but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. ;   GNU General Public License for more details.
  15.  
  16. format MS COFF
  17.  
  18. include 'proc32.inc'
  19. include 'main.inc'
  20. include 'imports.inc'
  21.  
  22. DEBUG               equ 1
  23.  
  24. EVENT_NOTIFY        equ 0x00000200
  25.  
  26. OS_BASE               equ 0;  0x80400000
  27. new_app_base          equ 0x60400000;   0x01000000
  28. PROC_BASE             equ OS_BASE+0x0080000
  29.  
  30. public START
  31. public service_proc
  32. public version
  33.  
  34. SND_CREATE_BUFF     equ 2
  35. SND_PLAY            equ 3
  36. SND_STOP            equ 4
  37. SND_SETBUFF         equ 5
  38. SND_DESTROY_BUFF    equ 6
  39.  
  40. DEV_PLAY            equ 1
  41. DEV_STOP            equ 2
  42. DEV_CALLBACK        equ 3
  43.  
  44. struc IOCTL
  45. {  .handle           dd ?
  46.    .io_code          dd ?
  47.    .input            dd ?
  48.    .inp_size         dd ?
  49.    .output           dd ?
  50.    .out_size         dd ?
  51. }
  52.  
  53. virtual at 0
  54.   IOCTL IOCTL
  55. end virtual
  56.  
  57. section '.flat' code readable align 16
  58.  
  59. proc START stdcall, state:dword
  60.  
  61.            cmp [state], 1
  62.            jne .exit
  63.  
  64.            stdcall GetService, szSound
  65.            test eax, eax
  66.            jz .fail
  67.            mov [hSound], eax
  68.  
  69.            stdcall KernelAlloc, 16*512
  70.            test eax, eax
  71.            jz .out_of_mem
  72.            mov [mix_buff], eax
  73.  
  74.            mov edi, stream_list
  75.            mov ecx, 17
  76.            xor eax, eax
  77.            cld
  78.            rep stosd
  79.  
  80.            mov edi, stream
  81.            mov ecx, 4*STREAM_SIZE
  82.            rep stosd
  83.            mov [stream_count],0
  84.  
  85.            stdcall set_handler, [hSound], new_mix
  86.            stdcall RegService, szInfinity, service_proc
  87.            ret
  88. .fail:
  89.      if DEBUG
  90.            mov esi, msgFail
  91.            call SysMsgBoardStr
  92.      end if
  93. .exit:
  94.            xor eax, eax
  95.            ret
  96.  
  97. .out_of_mem:
  98.      if DEBUG
  99.            mov esi, msgMem
  100.            call SysMsgBoardStr
  101.      end if
  102.            xor eax, eax
  103.            ret
  104. endp
  105.  
  106. handle     equ  IOCTL.handle
  107. io_code    equ  IOCTL.io_code
  108. input      equ  IOCTL.input
  109. inp_size   equ  IOCTL.inp_size
  110. output     equ  IOCTL.output
  111. out_size   equ  IOCTL.out_size
  112.  
  113. align 4
  114. proc service_proc stdcall, ioctl:dword
  115.  
  116.            mov edi, [ioctl]
  117.            mov eax, [edi+io_code]
  118.  
  119.            cmp eax, SND_CREATE_BUFF
  120.            jne @F
  121.            mov ebx, [edi+input]
  122.            stdcall CreateBuffer,[ebx]
  123.            ret
  124. @@:
  125.            cmp eax, SND_PLAY
  126.            jne @F
  127.  
  128.            mov ebx, [edi+input]
  129.            stdcall play_buffer, [ebx]
  130.            ret
  131. @@:
  132.            cmp eax, SND_STOP
  133.            jne @F
  134.  
  135. ;       if DEBUG
  136. ;          mov esi, msgStop
  137. ;          call   [SysMsgBoardStr]
  138. ;       end if
  139.  
  140.            mov ebx, [edi+input]
  141.            stdcall stop_buffer, [ebx]
  142.            ret
  143. @@:
  144.            cmp eax, SND_SETBUFF
  145.            jne @F
  146.  
  147.            mov ebx, [edi+input]
  148.            mov eax, [ebx+4]
  149.            add eax, new_app_base
  150.            stdcall set_buffer, [ebx],eax,[ebx+8],[ebx+12]
  151.            ret
  152. @@:
  153.            cmp eax, SND_DESTROY_BUFF
  154.            jne @F
  155.  
  156.            mov ebx, [edi+input]
  157.            stdcall DestroyBuffer, [ebx]
  158.            ret
  159. @@:
  160.            xor eax, eax
  161.            ret
  162. endp
  163.  
  164. restore   handle
  165. restore   io_code
  166. restore   input
  167. restore   inp_size
  168. restore   output
  169. restore   out_size
  170.  
  171. TASK_COUNT    equ 0x0003004
  172. CURRENT_TASK  equ 0x0003000
  173.  
  174. align 8
  175. proc CreateBuffer stdcall, format:dword
  176.            locals
  177.              str dd ?
  178.            endl
  179.  
  180.            call alloc_stream
  181.            and eax, eax
  182.            jz .fail
  183.            mov [str], eax
  184.            mov edi, eax
  185.  
  186.            mov edx, [stream_count]
  187.            mov [stream_list+edx*4], eax
  188.            inc [stream_count]
  189.  
  190.            mov [edi+STREAM.magic], 'WAVE'
  191.            mov [edi+STREAM.size], STREAM_SIZE
  192.  
  193.            stdcall KernelAlloc, 172*1024
  194.  
  195.            mov edi, [str]
  196.            mov [edi+STREAM.base], eax
  197.            add eax, 0x1000
  198.            mov [edi+STREAM.seg_0], eax
  199.            mov [edi+STREAM.curr_seg], eax
  200.            mov [edi+STREAM.notify_off1], eax
  201.            add eax, 0x8000
  202.            mov [edi+STREAM.lim_0], eax
  203.            add eax, 0x1000
  204.            mov [edi+STREAM.seg_1], eax
  205.            mov [edi+STREAM.notify_off2], eax
  206.            add eax, 0x8000
  207.            mov [edi+STREAM.limit], eax
  208.            mov [edi+STREAM.lim_1], eax
  209.  
  210.            mov [edi+STREAM.work_buff], eax
  211.            mov [edi+STREAM.work_read], eax
  212.            mov [edi+STREAM.work_write], eax
  213.            mov [edi+STREAM.work_count], 0
  214.            add eax, 0x10000
  215.            mov [edi+STREAM.work_top], eax
  216.  
  217.            mov ebx, [CURRENT_TASK]
  218.            shl ebx, 5
  219.            mov eax, [0x3000+ebx+4]
  220.  
  221.            mov [edi+STREAM.notify_task], eax
  222.  
  223.            mov eax, [format]
  224.            mov [edi+STREAM.format], eax
  225.            mov [edi+STREAM.flags], SND_STOP
  226.  
  227.            xor ebx, ebx
  228.            cmp eax, 19
  229.            jb @f
  230.            mov ebx, 0x80808080
  231. @@:
  232.            mov [edi+STREAM.r_silence], ebx
  233.  
  234.            shl eax, 4
  235.            mov ebx, [resampler_params+eax]
  236.            mov ecx, [resampler_params+eax+4]
  237.            mov edx, [resampler_params+eax+8]
  238.  
  239.            mov [edi+STREAM.r_size],ebx
  240.            mov [edi+STREAM.r_end], ecx
  241.            mov [edi+STREAM.r_dt],  edx
  242.  
  243.            mov ebx, [resampler_params+eax+12]
  244.            mov [edi+STREAM.resample], ebx
  245.  
  246.            mov edx, [edi+STREAM.base]
  247.            lea eax, [edx+0x9000]
  248.            call GetPgAddr  ;eax
  249.            call FreePage   ;eax
  250.  
  251.            mov eax, edx
  252.            lea ebx, [edx+0x9000]
  253.            call GetPgAddr  ;eax
  254.            stdcall MapPage, ebx, eax, dword 3
  255.  
  256.            mov edi, [edi+STREAM.base]
  257.            mov ecx, (168*1024)/4
  258.            xor eax, eax
  259.            rep stosd
  260.  
  261.            mov eax, [str]
  262.            ret
  263. .fail:
  264.            xor eax, eax
  265.            ret
  266. endp
  267.  
  268. align 4
  269. pid_to_slot:
  270.  
  271.            push   ebx
  272.            push   ecx
  273.            mov    ebx,[TASK_COUNT]
  274.            shl    ebx,5
  275.            mov    ecx,2*32
  276. .loop:
  277.            cmp    byte [CURRENT_TASK+ecx+0xa],9
  278.            jz     .endloop              ;skip empty slots
  279.            cmp    [CURRENT_TASK+ecx+0x4],eax ;check PID
  280.            jz     .pid_found
  281. .endloop:
  282.            add    ecx,32
  283.            cmp    ecx,ebx
  284.            jle    .loop
  285.            pop    ecx
  286.            pop    ebx
  287.            xor    eax,eax
  288.            ret
  289.  
  290. .pid_found:
  291.            shr    ecx,5
  292.            mov    eax,ecx
  293.            pop    ecx
  294.            pop    ebx
  295.            ret
  296.  
  297. align 4
  298. proc DestroyBuffer stdcall, str:dword
  299.  
  300.            mov esi, [str]
  301.  
  302.            cmp [esi+STREAM.magic], 'WAVE'
  303.            jne .fail
  304.  
  305.            cmp [esi+STREAM.size], STREAM_SIZE
  306.            jne .fail
  307.  
  308.            stdcall KernelFree, [esi+STREAM.base]
  309.  
  310.            mov eax, [str]
  311.            call free_stream
  312.  
  313.            mov edi, [str]
  314.            mov ecx, STREAM_SIZE/4
  315.            xor eax, eax
  316.            cld
  317.            rep stosd
  318.  
  319.            mov eax, [str]
  320.            mov esi, stream_list
  321.            mov ecx, 16
  322. @@:
  323.            cmp [esi], eax
  324.            je .remove
  325.            add esi, 4
  326.            dec ecx
  327.            jnz @B
  328.            xor eax, eax
  329.            inc eax
  330.            ret
  331. .remove:
  332.            mov edi, esi
  333.            add esi, 4
  334.            cld
  335.            rep movsd
  336.            dec [stream_count]
  337.            xor eax, eax
  338.            inc eax
  339.            ret
  340. .fail:
  341.            xor eax, eax
  342.            ret
  343. endp
  344.  
  345. align 4
  346. proc play_buffer stdcall, str:dword
  347.  
  348.            mov ebx, [str]
  349.            cmp [ebx+STREAM.magic], 'WAVE'
  350.            jne .fail
  351.  
  352.            cmp [ebx+STREAM.size], STREAM_SIZE
  353.            jne .fail
  354.  
  355.            mov edi,[ebx+STREAM.work_buff]
  356.            mov [ebx+STREAM.work_read], edi
  357.            mov [ebx+STREAM.work_write], edi
  358.            mov [ebx+STREAM.work_count], 0
  359.  
  360.            mov edx, [ebx+STREAM.base]
  361.            add edx, 0x1000
  362.            mov [ebx+STREAM.seg_0], edx
  363.            mov [ebx+STREAM.curr_seg], edx
  364.            add edx, 0x8000
  365.            mov [ebx+STREAM.lim_0], edx
  366.            add edx, 0x1000
  367.            mov [ebx+STREAM.seg_1], edx
  368.            add edx, 0x8000
  369.            mov [ebx+STREAM.lim_1], edx
  370.  
  371.            mov edx, [ebx+STREAM.seg_0]
  372.            mov ecx, -128
  373.            mov eax, [ebx+STREAM.r_silence]
  374. @@:
  375.            mov [edx+ecx], eax
  376.            add ecx, 4
  377.            jnz @B
  378.  
  379.            stdcall [ebx+STREAM.resample], edi, edx,\
  380.            [ebx+STREAM.r_dt],[ebx+STREAM.r_size],[ebx+STREAM.r_end]
  381.  
  382.            mov ebx, [str]
  383.  
  384.            add [ebx+STREAM.work_count], eax
  385.            add [ebx+STREAM.work_write], eax
  386.  
  387.            mov edx, [ebx+STREAM.r_size]
  388.            add [ebx+STREAM.curr_seg], edx
  389.  
  390.            mov [ebx+STREAM.flags], SND_PLAY
  391.  
  392.            mov eax, [ebx+STREAM.r_silence]
  393.            mov edi, [ebx+STREAM.work_write]
  394.            mov ecx, [ebx+STREAM.work_top]
  395.            sub ecx, edi
  396.            shr ecx, 2
  397.            cld
  398.            rep stosd
  399.  
  400.            stdcall  dev_play, [hSound]
  401.            xor eax, eax
  402.            inc eax
  403.            ret
  404. .fail:
  405.            xor eax, eax
  406.            ret
  407. endp
  408.  
  409. align 4
  410. proc stop_buffer stdcall, str:dword
  411.  
  412.            mov edi, [str]
  413.  
  414.            cmp [edi+STREAM.magic], 'WAVE'
  415.            jne .fail
  416.  
  417.            cmp [edi+STREAM.size], STREAM_SIZE
  418.            jne .fail
  419.  
  420.            mov [edi+STREAM.flags], SND_STOP
  421.  
  422. ;           stdcall [ServiceHandler], [hSound], dword DEV_STOP, 0
  423.  
  424.            xor eax, eax
  425.            inc eax
  426.            ret
  427. .fail:
  428.            xor eax, eax
  429.            ret
  430. endp
  431.  
  432. align 4
  433. proc set_buffer stdcall, str:dword,src:dword,offs:dword,size:dword
  434.  
  435.            mov edx, [str]
  436.            test edx, edx
  437.            jz .fail
  438.  
  439.            cmp [edx+STREAM.magic], 'WAVE'
  440.            jne .fail
  441.  
  442.            cmp [edx+STREAM.size], STREAM_SIZE
  443.            jne .fail
  444.  
  445.            mov esi,[src]
  446.            test esi, esi
  447.            jz .fail
  448.  
  449.            cmp esi, new_app_base
  450.            jb .fail
  451.  
  452.            mov edi, [offs]
  453.            mov ecx, 0x8000
  454.  
  455.            sub ecx, edi
  456.            jbe .seg_1
  457.  
  458.            sub [size], ecx
  459.            jb .fail
  460.  
  461.            add edi, [edx+STREAM.base]
  462.            add edi, 0x1000
  463.            shr ecx, 2
  464.            cld
  465.            rep movsd
  466.            jmp @F
  467. .seg_1:
  468.            add edi, [edx+STREAM.base]
  469.            add edi, 0x1000
  470. @@:
  471.            add edi, 0x1000
  472.            mov ecx, [size]
  473.            test ecx, ecx
  474.            jz .done
  475.            cmp ecx, 0x8000
  476.            ja .fail
  477.  
  478.            shr ecx, 2
  479.            rep movsd
  480. .done:
  481.            xor eax, eax
  482.            inc eax
  483.            ret
  484. .fail:
  485.            xor eax, eax
  486.            ret
  487. endp
  488.  
  489. align 4
  490. proc alloc_stream
  491.  
  492.            mov esi, stream_map
  493.  
  494.            pushf
  495.            cli
  496.  
  497.            bsf eax, [esi]
  498.            jnz .find
  499.            popf
  500.            xor eax, eax
  501.            ret
  502. .find:
  503.            btr [esi], eax
  504.            popf
  505.            mov ebx, STREAM_SIZE
  506.            mul ebx
  507.            add eax, stream
  508.            ret
  509. endp
  510.  
  511. align 4
  512. proc free_stream
  513.            sub eax, stream
  514.            mov ebx, STREAM_SIZE
  515.            xor edx, edx
  516.            div ebx
  517.  
  518.            and edx, edx
  519.            jnz .err
  520.  
  521.            bts [stream_map], eax
  522.            ret
  523. .err:
  524.            xor eax, eax
  525.            ret
  526. endp
  527.  
  528. align 4
  529. proc prepare_playlist
  530.  
  531. .restart:
  532.            xor ebx, ebx
  533.            xor edx, edx
  534.            mov [play_count], 0
  535.            mov ecx, [stream_count]
  536.            jcxz .exit
  537. .l1:
  538.            mov esi, [stream_list+ebx]
  539.            test esi, esi
  540.            jz .next
  541.  
  542.            cmp [esi+STREAM.magic], 'WAVE'
  543.            jne .next
  544.  
  545.            cmp [esi+STREAM.size], STREAM_SIZE
  546.            jne .next
  547.  
  548.            mov eax,[esi+STREAM.notify_task]
  549.            cmp eax, -1
  550.            je .fail
  551.  
  552.            call pid_to_slot
  553.            test eax, eax
  554.            jz .fail
  555.  
  556.            cmp [esi+STREAM.flags], SND_PLAY;
  557.            jne .next
  558.            cmp [esi+STREAM.work_count], 16384
  559.            jb .next
  560.  
  561.            mov [play_list+edx], esi
  562.            inc [play_count]
  563.            add edx, 4
  564. .next:
  565.            add ebx, 4
  566.            loop .l1
  567. .exit:
  568.            ret
  569. .fail:
  570.            stdcall DestroyBuffer, esi
  571.            jmp .restart
  572. endp
  573.  
  574. align 4
  575. proc prepare_updatelist
  576.  
  577.            xor ebx, ebx
  578.            xor edx, edx
  579.            mov [play_count], 0
  580.            mov ecx, [stream_count]
  581.            jcxz .exit
  582. .l1:
  583.            mov eax, [stream_list+ebx]
  584.            test eax, eax
  585.            jz .next
  586.            cmp [eax+STREAM.flags], SND_PLAY
  587.            jne .next
  588.  
  589.            mov [play_list+edx], eax
  590.            inc [play_count]
  591.            add edx, 4
  592. .next:
  593.            add ebx, 4
  594.            loop .l1
  595. .exit:
  596.            ret
  597. endp
  598.  
  599. align 4
  600. proc set_handler stdcall, hsrv:dword, handler_proc:dword
  601.            locals
  602.              handler    dd ?
  603.              io_code    dd ?
  604.              input      dd ?
  605.              inp_size   dd ?
  606.              output     dd ?
  607.              out_size   dd ?
  608.              val        dd ?
  609.            endl
  610.  
  611.            mov eax, [hsrv]
  612.            lea ecx, [handler_proc]
  613.            xor ebx, ebx
  614.  
  615.            mov [handler], eax
  616.            mov [io_code], DEV_CALLBACK
  617.            mov [input], ecx
  618.            mov [inp_size], 4
  619.            mov [output], ebx
  620.            mov [out_size], 0
  621.  
  622.            lea eax, [handler]
  623.            stdcall ServiceHandler, eax
  624.            ret
  625. endp
  626.  
  627. align 4
  628. proc dev_play stdcall, hsrv:dword
  629.            locals
  630.              handle     dd ?
  631.              io_code    dd ?
  632.              input      dd ?
  633.              inp_size   dd ?
  634.              output     dd ?
  635.              out_size   dd ?
  636.              val        dd ?
  637.            endl
  638.  
  639.            mov eax, [hsrv]
  640.            xor ebx, ebx
  641.  
  642.            mov [handle], eax
  643.            mov [io_code], DEV_PLAY
  644.            mov [input], ebx
  645.            mov [inp_size], ebx
  646.            mov [output], ebx
  647.            mov [out_size], ebx
  648.  
  649.            lea eax, [handle]
  650.            stdcall ServiceHandler, eax
  651.            ret
  652. endp
  653.  
  654. include 'mixer.asm'
  655.  
  656. align 16
  657. resampler_params:
  658.      ;r_size    r_end   r_dt   resampler_func
  659.      dd 0,0,0,0                                  ; 0  PCM_ALL
  660.      dd 16384,          0,     0, copy_stream    ; 1  PCM_2_16_48
  661.      dd 16384,          0,     0, m16_stereo     ; 2  PCM_1_16_48
  662.  
  663.      dd 16384, 0x08000000, 30109, resample_2     ; 3  PCM_2_16_44
  664.      dd  8192, 0x08000000, 30109, resample_1     ; 4  PCM_1_16_44
  665.  
  666.      dd 16384, 0x08000000, 21846, resample_2     ; 5  PCM_2_16_32
  667.      dd  8192, 0x08000000, 21846, resample_1     ; 6  PCM_1_16_32
  668.  
  669.      dd 16384, 0x08000000, 16384, resample_2     ; 7  PCM_2_16_24
  670.      dd  8192, 0x08000000, 16384, resample_1     ; 8  PCM_1_16_24
  671.  
  672.      dd  8192, 0x04000000, 15052, resample_2     ; 9  PCM_2_16_22
  673.      dd  4096, 0x04000000, 15052, resample_1     ;10  PCM_1_16_22
  674.  
  675.      dd  8192, 0x04000000, 10923, resample_2     ;11  PCM_2_16_16
  676.      dd  4096, 0x04000000, 10923, resample_1     ;12  PCM_1_16_16
  677.  
  678.      dd  8192, 0x04000000,  8192, resample_2     ;13  PCM_2_16_12
  679.      dd  4096, 0x04000000,  8192, resample_1     ;14  PCM_1_16_12
  680.  
  681.      dd  4096, 0x02000000,  7527, resample_2     ;15  PCM_2_16_11
  682.      dd  2048, 0x02000000,  7527, resample_1     ;16  PCM_1_16_11
  683.  
  684.      dd  4096, 0x02000000,  5462, resample_2     ;17  PCM_2_16_8
  685.      dd  2048, 0x02000000,  5462, resample_1     ;18  PCM_1_16_8
  686.  
  687.      dd 16384,          0,     0, s8_stereo      ;19  PCM_2_8_48
  688.      dd  8192,          0,     0, m8_stereo      ;20  PCM_1_8_48
  689.  
  690.      dd  8192, 0x08000000, 30109, resample_28    ;21  PCM_2_8_44
  691.      dd  4096, 0x08000000, 30109, resample_18    ;22  PCM_1_8_44
  692.  
  693.      dd  8192, 0x08000000, 21846, resample_28    ;23  PCM_2_8_32
  694.      dd  4096, 0x08000000, 21846, resample_18    ;24  PCM_1_8_32
  695.  
  696.      dd  8192, 0x08000000, 16384, resample_28    ;25  PCM_2_8_24
  697.      dd  4096, 0x08000000, 16384, resample_18    ;26  PCM_1_8_24
  698.  
  699.      dd  4096, 0x04000000, 15052, resample_28    ;27  PCM_2_8_22
  700.      dd  2048, 0x04000000, 15052, resample_18    ;28  PCM_1_8_22
  701.  
  702.      dd  4096, 0x04000000, 10923, resample_28    ;29  PCM_2_8_16
  703.      dd  2048, 0x04000000, 10923, resample_18    ;30  PCM_1_8_16
  704.  
  705.      dd  4096, 0x04000000,  8192, resample_28    ;31  PCM_2_8_12
  706.      dd  2048, 0x04000000,  8192, resample_18    ;32  PCM_1_8_12
  707.  
  708.      dd  2048, 0x02000000,  7527, resample_28    ;33  PCM_2_8_11
  709.      dd  1024, 0x02000000,  7527, resample_18    ;34  PCM_1_8_11
  710.  
  711.      dd  2048, 0x02000000,  5462, resample_28    ;35  PCM_2_8_8
  712.      dd  1024, 0x02000000,  5462, resample_18    ;36  PCM_1_8_8
  713.  
  714. m7            dw 0x8000,0x8000,0x8000,0x8000
  715. mm80          dq 0x8080808080808080
  716. mm_mask       dq 0xFF00FF00FF00FF00
  717.  
  718. stream_map    dd 0xFFFF       ; 16
  719. version       dd 0x00030003
  720.  
  721. szInfinity    db 'INFINITY',0
  722. szSound       db 'SOUND',0
  723.  
  724. if DEBUG
  725. msgFail       db 'Sound service not loaded',13,10,0
  726. msgPlay       db 'Play buffer',13,10,0
  727. msgStop       db 'Stop',13,10,0
  728. msgUser       db 'User callback',13,10,0
  729. msgMem        db 'Not enough memory',13,10,0
  730. end if
  731.  
  732. section '.data' data readable writable align 16
  733.  
  734. stream        rb STREAM_SIZE*16
  735.  
  736. play_list     rd 16
  737. mix_input     rd 16
  738.  
  739. stream_list   rd 17
  740. play_count    rd 1
  741. stream_count  rd 1
  742. hSound        rd 1
  743. mix_buff      rd 1
  744. mix_buff_map  rd 1
  745.  
  746.