Subversion Repositories Kolibri OS

Rev

Rev 376 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. format MS COFF
  2.  
  3. include "snd.inc"
  4. include "proc32.inc"
  5.  
  6. section '.text' align 16 code readable executable
  7.  
  8. public _GetBufferSize@8
  9. public _GetBufferFree@8
  10.  
  11. extrn hSound
  12.  
  13. align 4
  14. _GetBufferSize@8:      ;str:dword, p_size:dword
  15.            
  16.            push ebx
  17.            push ecx
  18.            
  19.            lea eax, [esp+16]
  20.            lea ebx, [esp+12]   ;[stream]
  21.  
  22.            push 4              ;.out_size
  23.            push eax            ;.output
  24.            push 4              ;.inp_size
  25.            push ebx            ;.input
  26.            push SND_GETBUFFSIZE;.code
  27.            push dword [hSound] ;.handle
  28.  
  29.            mov eax, 68
  30.            mov ebx, 17
  31.            mov ecx, esp
  32.            int 0x40
  33.            add esp, 24
  34.            pop ecx
  35.            pop ebx
  36.            ret 8
  37.            
  38. align 4
  39. _GetBufferFree@8:      ;str:dword, p_free:dword
  40.            push ebx
  41.            push ecx
  42.            
  43.            lea ebx, [esp+12]      ;[stream]
  44.            push 0                 ;storage for free_space    
  45.            mov eax, esp
  46.  
  47.            push 4                 ;.out_size
  48.            push eax               ;.output
  49.            push 4                 ;.inp_size
  50.            push ebx               ;.input
  51.            push SND_GETFREESPACE  ;.code
  52.            push dword [hSound]    ;.handle
  53.  
  54.            mov eax, 68
  55.            mov ebx, 17
  56.            mov ecx, esp
  57.            int 0x40
  58.            add esp, 24
  59.            mov ecx, [esp+20]      ; p_free  
  60.            pop dword [ecx]
  61.            pop ecx
  62.            pop ebx
  63.            ret 8
  64.