home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
CPROG
/
VGAKIT50.ZIP
/
RDPOINT.ASM
< prev
next >
Wrap
Assembly Source File
|
1992-06-25
|
1KB
|
65 lines
include model.h
;
; VGAKIT Version 5.0
;
; Copyright 1988,89,90,91,92 John Bridges
; Free for use in commercial, shareware or freeware applications
;
; RDPOINT.ASM
;
;
.data
extrn curbk:word,adrtbl:dword,ourseg:word
extrn maxx:word,maxy:word,scanline:word
.code
extrn newbank:proc
public rdpoint
public rdpoint13x
rdpoint proc xpos:word,ypos:word
mov dx,[xpos]
mov bx,[ypos]
shl bx,1
shl bx,1
add dx,word ptr adrtbl[bx]
mov ax,word ptr adrtbl[bx+2]
adc ax,0
mov bx,dx
cmp ax,[curbk]
jz nonew
call newbank ;switch banks if a new bank entered
nonew: mov es,[ourseg] ;setup screen segment
mov al,es:[bx]
mov ah,0
ret
rdpoint endp
rdpoint13x proc xpos:word,ypos:word
mov dx,[xpos]
mov bx,[ypos]
shl bx,1
shl bx,1
mov ah,dl
shr dx,1
shr dx,1
add dx,word ptr adrtbl[bx]
mov bx,dx
and ah,3
mov al,4
mov dx,3ceh
out dx,ax ;set EGA bit plane read register
mov es,[ourseg] ;setup screen segment
mov al,es:[bx]
mov ah,0
ret
rdpoint13x endp
end