VGA mode 12h
Posted: Sun Nov 16, 2003 12:00 am
by jiakk
I can switch to mode 12h, but how can i draw a pixel?
RE:VGA mode 12h
Posted: Sun Nov 16, 2003 12:00 am
by Gamer
mov al,colornumber
mov bh,displaypage // cud ignore this thing if dont have idea
mov cx,column
mov dx,row
i hope this will solve ur pro.
RE:VGA mode 12h
Posted: Mon Nov 17, 2003 12:00 am
by Xenos
Finally:
int 10h
RE:VGA mode 12h
Posted: Mon Nov 17, 2003 12:00 am
by jiakk
i'm in protected mode. i can't use bios interrupt. how can i draw a pixel using only vga registers and direct access to the video memory?
RE:VGA mode 12h
Posted: Thu Nov 20, 2003 12:00 am
by jiakk
have you got any code to do that?
RE:VGA mode 12h
Posted: Sun Nov 30, 2003 12:00 am
by DrivingMeNuts
Any idea how to display text in mode 12h? i'm trying to write a c function to display unicode characters on screen but can't find any useful infro on 12h. Help!
RE:VGA mode 12h
Posted: Wed Dec 24, 2003 12:00 am
by wasiliy
maybe a bit too late, but here is some code for TASM:
.model tiny,pascal
.code
org 100h
main:
mov ax,12h
int 10h
repeat:
.386
CALL rand,offset X,-200,200
add [X],320
CALL rand,offset Y,-200,200
add [Y],240
CALL randb,offset COL,0,15
CALL pix,X,Y,word ptr COL
.8086
in al,60h
dec al
jnz repeat
mov ax,03h
int 10h
ret
.286
pix proc near USES ax bx cx dx es,Xc,Yc : word,COLOR : byte
mov ax,0A000h
mov es,ax
mov bx,[Xc]
mov ax,[Yc]
mov cl,bl
and cl,07h
shr bx,3
shl ax,6
add bx,ax
shr ax,2
add bx,ax
mov dx,3CEh
mov al,08h
mov ah,80h
shr ah,cl
out dx,ax
mov al,01h
mov ah,0Fh
out dx,ax
xor al,al
mov ah,[COLOR]
out dx,ax
mov cl,es:[bx]
mov es:[bx],cl
inc al
xor ah,ah
out dx,ax
mov al,08h
mov ah,0FFh
out dx,ax
ret
pix endp
.8086
rand proc near uses ax bx dx di,ofsVAR,min,max : word
inc [max]
mov ax,[seed]
mov bx,[seed]
xchg bh,bl
sub bx,[seed]
mov bl,ah
mov ah,bh
xchg ah,al
in al,40h
add ax,[seed]
xchg ah,al
mov [seed],ax
mov bh,al
mov ax,bx
mov bx,[max]
sub bx,[min]
xor dx,dx
div bx
mov di,[ofsVAR]
add dx,[min]
mov word ptr [di],dx
ret
rand endp
randb proc near uses ax bx dx di,ofsVAR,min,max : word
inc [max]
mov ax,[seed]
mov bx,[seed]
xchg bh,bl
sub bx,[seed]
mov bl,ah
mov ah,bh
xchg ah,al
in al,40h
sub ax,[seed]
xchg ah,al
sub [seed],ax
mov bh,al
mov ax,bx
mov bx,[max]
sub bx,[min]
xor dx,dx
div bx
mov di,[ofsVAR]
add dl,byte ptr [min]
mov byte ptr [di],dl
ret
randb endp
X dw ?
Y dw ?
seed dw ?
COL db ?
end main