home *** CD-ROM | disk | FTP | other *** search
- DOSSEG
- .MODEL SMALL
- .STACK 500h
- .DATA
- Ventana1 EQU 0A000h
- Ventana2 EQU 0B000h
-
- TGA_filename DB 'LENS.TGA',0
- TGA_handle dw ?
- PositionX dw ?
- PositionY dw ?
- ReadBuffer DB 1024 DUP(?)
- ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- .CODE
-
- Video13 MACRO
- ;switch over to graphics mode
- mov ax,0013h
- int 10h
- ENDM
-
- Quit_O MACRO
- ;change back to text mode and quit
- mov ax,0003h
- int 10h
- mov ax,4C00h
- int 21h
- ENDM
- Codigo PROC
- Video13
- ;load in a pretty picture to look at
-
- mov dx,@DATA
- mov ds,dx
- mov ax,3D00h
- mov dx,offset TGA_filename
- int 21h
- jnc Sigue
- Quit_O
- Sigue:
- mov TGA_handle,ax
- mov ah,3Fh
- mov bx,TGA_handle
- mov cx,18
- mov dx,offset ReadBuffer
- int 21h
- jnc Sigue2
- Quit_O
- Sigue2:
- mov ah,3Fh
- mov bx,TGA_handle
- mov cx,768
- mov dx,offset ReadBuffer
- int 21h
- jc @@Quit
-
- mov cx,256
- mov ax,@DATA
- mov es,ax
- mov si,offset ReadBuffer
- mov di,offset ReadBuffer
- cld
- @@FixPal:
- lodsb
- shr al,1
- shr al,1
- mov ah,al
- lodsb
- shr al,1
- shr al,1
- mov bh,al
- lodsb
- shr al,1
- shr al,1
- stosb
- mov al,bh
- stosb
- mov al,ah
- stosb
- dec cx
- jnz @@FixPal
-
- mov ax,1012h
- mov bx,0
- mov cx,256
- mov dx,offset ReadBuffer
- int 10h
-
- mov ah,3Fh
- mov bx,TGA_handle
- mov cx,64000
- mov dx, Ventana1
- mov ds,dx
- mov dx,0
- int 21h
- jc @@Quit
-
- mov ah,3Eh
- mov bx,TGA_handle
- int 21h
-
- @@Quit:
- ;get stdio. If something's been pressed, quit
-
- mov ah,6h
- mov dl, 0FFh
- int 21h
- jz @@Quit
- Quit_O
-
- Codigo ENDP;
- END Codigo
-