adholioshake
Programmer
- Feb 9, 2003
- 136
Hi everyone.
I have started some simple graphics routines in assembly for SVGA resolution. The code I have written for a simple line is shown below. I am using an interrupt to set the pixel. However, this is very slow! Does anyone know how to access the graphics memory area directly for SVGA? (I don't know the base address for SVGA). Any help would be appriciated.
Adonai
I have started some simple graphics routines in assembly for SVGA resolution. The code I have written for a simple line is shown below. I am using an interrupt to set the pixel. However, this is very slow! Does anyone know how to access the graphics memory area directly for SVGA? (I don't know the base address for SVGA). Any help would be appriciated.
Adonai
Code:
code segment
assume cs:code
org 100h
program:
jmp start
; data area...
xpos dw 100
ypos dw 100
len dw 100
col db 4
dir db 0
start:
; set svga mode...
mov ax,4f02h
mov bx,0101h
int 10h
; draw a line...
call line
; wait for keypress...
mov ah,00h
int 16h
; set text mode
mov ax,0003h
int 10h
; terminate.
mov ax,4c00h
int 21h
; Line routine
line:
mov cx,len
xor di,di
lp1:
push cx
mov ah,0ch
mov bx,0001h
mov al,col
mov cx,xpos
mov dx,ypos
cmp dir,00h
je xl1
yl1:
add dx,di
jmp drawl
xl1:
add cx,di
drawl:
int 10h
inc di
pop cx
loop lp1
ret
ends
end program