home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Interdit
/
pc-interdit.iso
/
graph
/
wobbler.asm
< prev
next >
Wrap
Assembly Source File
|
1994-10-07
|
2KB
|
65 lines
extrn WaitRetrace:far
data segment public
extrn sinus:dataptr ;table des sinus
data ends
code segment public
assume cs:code,ds:data
public make_wob
make_wob proc pascal wob_pos,wob_hauteur,wob_offset:word
xor cx,cx ;initialise le compteur de lignes
call waitretrace ;synchronisation avec le rayon cathodique
next_line:
inc cx ;incrémente le compteur de lignes
mov bx,cx ;détermine la position à l'intérieur du wobbler
sub bx,wob_pos
mov si,bx ;mémorise pour la fin
add bx,wob_offset ;ajoute l'offset pour provoquer le déplacement
and bx,63 ;valeurs de 0..63 uniquement (dimension du tableau)
shl bx,1 ;accès au tableau par mot
mov bx,sinus[bx] ;lit la valeur en bx
cli ;inhibe les interruptions, portion TRES critique
mov dx,3dah ;sélectionne le registre 1 de l'Input Status
in_display:
in al,dx ;attend le retour de balayage horizontal
test al,1
je in_display
in_retrace:
in al,dx ;attend l'affichage
test al,1
jne in_retrace
cmp cx,wob_pos ;ligne souhaitée atteinte ?
jb next_line ;non -> fixe valeur standard
mov dx,3d4h ;sélectionne le registre 4 (Horizontal Sync Start)
mov al,4 ;du CRTC
mov ah,bl ;lit le sinus
out dx,ax ;et le reporte
cmp si,wob_hauteur ;fini ?
jb next_line
mov dx,3dah
attente:
in al,dx ;attend le retour de balayage horizontal
test al,1
jne attente
mov dx,3d4h ;réinitialise Sync Start
mov ax,5504h
out dx,ax
sti ;rétablit les interruptions
ret
make_wob endp
code ends
end