hi, now i know the screen buffer flat address, but i dont know how the screen framebuffer managed, i mean how do i convert (x,y) to get the flat address position?

thanks
Posted on 2002-10-18 21:34:38 by dion
Posted on 2002-10-19 18:59:29 by x86asm
hi x86asm, how are u, long time no see ;)
ummm... i want to ask these:
1. could u explain me what pitch meant? please tell me more details ;)
2. how do u get this info from? might be directx help? but, how do u know the Non-DDRAW calculation?
3. i've though for a while and write out these two possible calculation:

example:
screen resolution = 800*600 with 20h bpp
given(x,y) position
1st possible calc : flataddr = A + ((y*800)+y+x)*(bpp/8);
2nd possible calc : flataddr = A + ((x*800)+y+x)*(bpp/8);

which one is right? or both false? do i made a mistake here?

Posted on 2002-10-20 06:24:30 by dion
The pitch is the number of bytes in one scanline. It is not necessarily equal to ScreenX*BytesPerPixel I think this is for alignment/speed reasons. The Non-DDRAW is the one I used in DOS for the 320x200 screen mode (invoked by setting ax to 0013h and invoking int 10h). BogdanOtanu was the one that explained this pitch to me before because I was exactly where you were! May I ask if you will be using DirectDraw?

I looked for an explanation on the pitch on the web:

http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/ddraw7/directdraw7/ddover_5bnb.asp

Link 2- Some unknown DDRAW tutorial site (it shows the formula for using pitch)http://modena.intergate.ca/personal/iago/dirxtut/dd3.htm
Posted on 2002-10-20 12:41:51 by x86asm
hi x86asm, i think we must make something clear here. i saw bpp definition in MSDN that said that it stands for bits per pixel, not byte per pixel. then about ur formulas :

quote: