home *** CD-ROM | disk | FTP | other *** search
/ Point Programming 1 / PPROG1.ISO / c / pas_sdk1 / pas / subs / misc / mvstate.asm < prev    next >
Encoding:
Assembly Source File  |  1992-07-13  |  2.1 KB  |  95 lines

  1.  
  2.         page    64,131
  3.     Title    MVSTATE --  Audio Spectrum Sound Support Code
  4.  
  5. ;   /*\
  6. ;   |*|----====< MVSTATE >====----
  7. ;   |*|
  8. ;   |*|  This module maintains the state table and pointer
  9. ;   |*|
  10. ;   |*|  Media Vision, Inc. Copyright (c) 1991,1992. All Rights Reserved.
  11. ;   |*|
  12. ;   \*/
  13.  
  14.     .xlist
  15.     include model.inc
  16.         include masm.inc
  17.     include state.inc
  18.     include common.inc
  19.     .list
  20.     .data
  21. ;
  22. ; This pointer points to a state table of hardware variables
  23. ;
  24.         public  mvhwShadowPointer
  25. mvhwShadowPointer    dd    0    ; points to the start of the data table
  26.  
  27. ;
  28. ; These variables mirror the hardware state
  29. ;
  30. HardwareShadowTable    db    (size MVState) dup (0)
  31.  
  32.     .code
  33. ;
  34. ;   /*\
  35. ;---|*|---------------====< MVInitStatePtr() >====---------------
  36. ;---|*|
  37. ;---|*| Initializes the state table pointer.
  38. ;---|*|
  39. ;---|*| Entry Conditions:
  40. ;---|*|     None
  41. ;---|*|
  42. ;---|*| Exit Conditions:
  43. ;---|*|     DX:AX point to the state table
  44. ;   \*/
  45.  
  46.     public    MVInitStatePtr
  47. MVInitStatePtr    proc
  48. ;
  49. ; this code can only be processed once per loading
  50. ;
  51.     cmp    wptr [mvhwShadowPointer+2],0    ; have we been here?
  52.     jnz    imvsp_done            ; yes, don't do this again
  53. ;
  54. ; setup a pointer to our local hardware state table
  55. ;
  56.     lea    bx,HardwareShadowTable
  57.     mov    wptr [mvhwShadowPointer+0],bx
  58.     mov    wptr [mvhwShadowPointer+2],ds
  59.  
  60.     mov    [bx._audiomixr],31h    ; lowest filter setting
  61.     mov    [bx._crosschannel],09h    ; cross channel l-2-l, r-2-r
  62. ;
  63. ; find the int 2F interface and if found, use it's state table pointer
  64. ;
  65.     mov    ax,0BC00h        ; MVSOUND.SYS ID check
  66.     mov    bx,'??'
  67.     sub    cx,cx
  68.     sub    dx,dx
  69.  
  70.     int    2fh            ; will return something if loaded
  71.  
  72.     xor    bx,cx
  73.     xor    bx,dx
  74.     cmp    bx,'MV'                 ; is the int 2F interface here?
  75.     jnz    imvsp_done        ; no, exit home
  76.  
  77.     mov    ax,0BC02H        ; get the pointer
  78.         int     2fh
  79.     cmp    ax,'MV'                 ; busy or intercepted
  80.     jnz    imvsp_done
  81.  
  82.     mov    wptr [mvhwShadowPointer+0],bx
  83.     mov    wptr [mvhwShadowPointer+2],dx
  84. ;
  85. imvsp_done:
  86.     mov    ax,wptr [mvhwShadowPointer+0]
  87.     mov    dx,wptr [mvhwShadowPointer+2]
  88.  
  89.         ret
  90.  
  91. MVInitStatePtr    endp
  92.  
  93.     end
  94.  
  95.