Hi,
salil_bhagurkar wrote:Okay.. i do get an error with ax=0x4f...
If VBE returned AX = 0x004F, then the function returned "success"...
salil_bhagurkar wrote:I allocate a video buffer of 1024*768*4 and put that address in ecx.
Um...
Imagine you're using 1024 * 768 with 256 colours and it takes 1 MB of the video card's memory for this video mode. Because the video card has more than 1 MB of memory you can have more than one frame of video data in the video card's memory at the same time.
To tell the video card to display the first frame from the video card's memory you'd use "ecx = 0x00000000". To tell the video card to display the second frame from the video card's memory you'd use "ecx = 0x00100000".
For example, if the video card's RAM is mapped at 0xE0000000 in the physical address space and the video mode uses 1 MB of the video card's memory, then you could do something like:
- - use VBE to tell the video card to display data from offset 0x00000000 in it's memory
- upload a new frame of video data into the video card at 0xE0100000 in the physical address space
- use VBE to tell the video card to display data from offset 0x00100000 in it's memory
- upload a new frame of video data into the video card at 0xE0200000 in the physical address space
- use VBE to tell the video card to display data from offset 0x00200000 in it's memory
- upload a new frame of video data into the video card at 0xE0000000 in the physical address space
- use VBE to tell the video card to display data from offset 0x00000000 in it's memory
- upload a new frame of video data into the video card at 0xE0100000 in the physical address space
- use VBE to tell the video card to display data from offset 0x00100000 in it's memory
- upload a new frame of video data into the video card at 0xE0200000 in the physical address space
- use VBE to tell the video card to display data from offset 0x00200000 in it's memory
Of course you could probably use the same function for other things, like scrolling (e.g. pretend the video mode is 1024 * 4096, fill it with data and then use VBE to select which 768 screen lines are actually displayed). This might actually be an easier way to get used to things and make sure the function does what I think it does. For example, get any sort of video displayed on the screen and then try something like this:
Code: Select all
mov ebp,0
.foo:
mov ax,0x4f07
mov bx,0x0002
mov ecx,ebp
int 0x10
*put a small delay here*
add ebp,4 ;Let it roll over from 65535 to 0
and ebp,0xFFF
jmp .foo
This should slowly scroll the screen to the left...
Cheers,
Brendan