home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / share / Dos / VARIOS / lente / BAK / TGA.ASM < prev   
Encoding:
Assembly Source File  |  1996-05-14  |  2.2 KB  |  114 lines

  1. DOSSEG
  2. .MODEL SMALL
  3. .STACK 500h 
  4. .DATA
  5.         Ventana1 EQU 0A000h
  6.         Ventana2 EQU 0B000h
  7.  
  8.         TGA_filename    DB  'LENS.TGA',0
  9.         TGA_handle      dw  ?
  10.         PositionX       dw  ?
  11.         PositionY       dw  ?
  12.         ReadBuffer      DB 1024 DUP(?)
  13. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  14.  
  15. .CODE
  16.  
  17. Video13 MACRO
  18.         ;switch over to graphics mode
  19.         mov ax,0013h
  20.         int 10h
  21. ENDM
  22.  
  23. Quit_O MACRO
  24.         ;change back to text mode and quit
  25.         mov ax,0003h
  26.         int 10h
  27.         mov ax,4C00h
  28.         int 21h
  29. ENDM
  30. Codigo PROC
  31.         Video13
  32.         ;load in a pretty picture to look at
  33.  
  34.         mov dx,@DATA
  35.         mov ds,dx
  36.         mov ax,3D00h
  37.         mov dx,offset TGA_filename
  38.         int 21h
  39.         jnc Sigue
  40.         Quit_O
  41. Sigue:
  42.         mov TGA_handle,ax
  43.         mov ah,3Fh
  44.         mov bx,TGA_handle
  45.         mov cx,18
  46.         mov dx,offset ReadBuffer
  47.         int 21h
  48.         jnc Sigue2
  49.         Quit_O
  50. Sigue2:
  51.         mov ah,3Fh
  52.         mov bx,TGA_handle
  53.         mov cx,768
  54.         mov dx,offset ReadBuffer
  55.         int 21h
  56.         jc @@Quit
  57.  
  58.         mov cx,256
  59.         mov ax,@DATA
  60.         mov es,ax
  61.         mov si,offset ReadBuffer
  62.         mov di,offset ReadBuffer
  63.         cld
  64. @@FixPal:
  65.         lodsb           
  66.         shr al,1
  67.         shr al,1
  68.         mov ah,al       
  69.         lodsb           
  70.         shr al,1
  71.         shr al,1
  72.         mov bh,al       
  73.         lodsb           
  74.         shr al,1
  75.         shr al,1
  76.         stosb           
  77.         mov al,bh       
  78.         stosb           
  79.         mov al,ah       
  80.         stosb
  81.         dec cx
  82.         jnz @@FixPal
  83.  
  84.         mov ax,1012h
  85.         mov bx,0
  86.         mov cx,256
  87.         mov dx,offset ReadBuffer
  88.         int 10h
  89.  
  90.         mov ah,3Fh
  91.         mov bx,TGA_handle
  92.         mov cx,64000
  93.         mov dx, Ventana1
  94.         mov ds,dx
  95.         mov dx,0
  96.         int 21h
  97.         jc @@Quit
  98.  
  99.         mov ah,3Eh
  100.         mov bx,TGA_handle
  101.         int 21h
  102.  
  103. @@Quit:
  104.        ;get stdio.  If something's been pressed, quit
  105.  
  106.         mov ah,6h
  107.         mov dl, 0FFh
  108.         int 21h
  109.         jz  @@Quit
  110.         Quit_O
  111.  
  112. Codigo ENDP;
  113.         END     Codigo
  114.