Hello!
3 weeks ago I started to search the secrets of vesa programming... and now I can forwrd with this problem.. :( I know I learning very slow, but... I think the important is that I want to learn :mrgreen: So here is my code:
section .code
start:
mov ax,data
mov ds,ax
mov es,ax
mov ax,stack
mov ss,ax
mov sp,stacktop
jmp main
PutPixel:
push eax
push es
push ecx
push edx
push ebx
lea eax,[edx+4*edx]
lea eax,[eax+4*eax]
xor edx,edx
mov ebx,65536
shl eax,5
add eax,ecx
div ebx
mov ecx,edx
cmp eax,CurBank
je Lbl
mov [CurBank],eax
mov dx,ax
mov ax,4f05h ;SetBank
xor ebx,ebx
int 10h
Lbl:
pop ebx
mov ax,0A000h
mov es,ax
mov [es:ecx],bl
pop edx
pop ecx
pop es
pop eax
ret
main:
mov ax,0x4f02
mov bx,0x103
int 0x10
;-----------------------------------------
mov bl,1 ;color
xor edx,edx
LoopY:
xor ecx,ecx
LoopX:
call PutPixel
inc ecx
cmp ecx,800
jne LoopX
inc edx
inc bl
cmp edx,256
jne LoopY
;-----------------------------------------
xor ah,ah
int 16h
xor ah,ah
mov al,0x3
int 0x10
mov ax,0x4c00
int 0x21
section .data
s resb 256
CurBank dd 0
section .stack stack
resb 2048
stacktop:
I wrote this code in nasm. And then used tlink. The problem is that this is very very slow for filling the screen... I know that I have to use the video memory.. but I can't.. :( I read many tutorials but I still can't use.. Tutorials didn't write an example :(
Please if somebody can help me to do a faster code or something... Thanks in forward