home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Game Programming Gurus / Tricks_of_the_Game_Programming_Gurus_SAMS_Publishing_1994.iso / digipak / theaudio / flat / video.asm < prev    next >
Assembly Source File  |  1993-12-31  |  963b  |  64 lines

  1. ;;*** VIDEO.ASM simple MCGA mode 13 support calls for PEND example program.
  2. ;;***
  3. ;;*** Written by John W. Ratcliff (c) 1994
  4. ;;***         Compuserve: 70253,3237
  5. ;;***         Genie: J.RATCLIFF3
  6. ;;***         BBS: 1-314-939-0200
  7. ;;***         Addresss:
  8. ;;***               747 Napa Lane
  9. ;;***               St. Charles, MO 63304
  10. ;;***
  11.  
  12.  
  13.     IDEAL
  14.     P386
  15.     JUMPS
  16.     MODEL FLAT,C
  17.  
  18.     public    VidOn
  19.     public    VidOff
  20.     public    DrawSound
  21.  
  22.     CODESEG
  23.  
  24. PROC    C VidOn near
  25.     mov    ax,13h
  26.     int    10h
  27.     ret
  28.     endp
  29.  
  30. PROC    C VidOff near
  31.     mov    ax,03
  32.     int    10h
  33.     ret
  34.     endp
  35.  
  36. PROC    C DrawSound near
  37.     ARG    SOUND:DWORD,SWID:DWORD,COLOR:DWORD
  38.     uses    ebx,ecx,edx,esi,edi
  39.  
  40.     mov    esi,[SOUND]
  41.     mov    ebx,320
  42.     xor    ecx,ecx       ; Xlocation.
  43.  
  44. @@GO:    xor    eax,eax
  45.     mov    al,[esi]      ; Get sound value.
  46.     shr    eax,1
  47.     add    eax,36         ; Adjust.
  48.     mul    ebx
  49.     add    eax,ecx       ; Plus current xlocation.
  50.     mov    edi,eax
  51.     mov    eax,[COLOR]
  52.     mov    [0A0000h+edi],al
  53.     inc    cx
  54.     inc    si
  55.     cmp    ecx,[SWID]
  56.     jne    @@GO
  57.  
  58.     ret
  59.     endp
  60.  
  61.  
  62.     ends
  63.     end
  64.