http://GameProgrammer.Com

Programming

GP Mailing List
     Thread Index
     Date Index

ATXGPSIG List
     Thread Index
     Date Index

Google
>

Home

Wise2Food



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mode 13h



make a pointer to 0xA000
unsigned char *VidMem=0xA000. This makes a pointer to tha vid. mem.
Mode 13h is a linear buffer where 1 byte represents one pixel. u can
plot a pixel by writing the color of tha pixel to tha particular mem.
loc. Since the data in the vid. mem. start from (0,0) and proceeds
along tha row, the first 320 bytes represents tha first row., u get tha
idea. so tha formula to calc. tha byte at (x,y) on screen will be :

pos=y * 320 + x;
VidMem[pos]=color;

where color is tha color of tha pixel u wanna plot. Keep it under 255,
as Mode 13h s'portz only that much. thazz why tha data type on VidMem
also is defined as unsigned char... so that u wont end up writing
NEthin' oth' than 0-255. Hope this helped.

Nikhil.

--- Peter Peterssen <getoutnow@Hotmail.com> wrote:
> Hello..
> 
> Mode 13H. Wow. Then, perhaps you can tell me how the
> heck I draw a dot on 
> the screen like X and Y ?
> 
> I do call 0xA0000 and the use the..
> outportb(0x3c9, red);
> outportb(0x3c9, green);
> outportb(0x3c9, blue);
> 
> .. for the background layout and then ..
> 
> b= 0;
> pokeb(0xa0000, B,30)
> 
> .. for the actual dot.
> 
> This doensnt work unless i add 1 to red OR green OR
> blue. ( I dont see the 
> dot on the screen).
> 
> So, as you see Im totaly lost and really dont get
> the whole thing. Do you 
> have an example how to structure something?
> 
> ______________________________________________________
> Get Your Private, Free Email at
> http://www.hotmail.com
> =================================================================
> To SUBSCRIBE or UNSUBSCRIBE please visit
> http://gameprogrammer.com/mailinglist.html
> 

__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com
=================================================================
To SUBSCRIBE or UNSUBSCRIBE please visit
http://gameprogrammer.com/mailinglist.html



  • Follow-Ups: