I knew, I was doing something wrong, but anyway I am happy.
though I learned byte manipulation yesterday...
> This seams almost right, just use & instead of && as && isn't a bitwise
> operator and don't bother subtracting blue, and green. Eventually you'll
> blue = lo & 31;
> green = (lo >> 5) + ((hi & 7) << 3); // The bits that are dropped are
> red = hi >> 3; // forgotten, those added are 0
> Just make sure hi and lo are declared as unsigned bytes, cause else right
> shifting will not always add 0 to the vacant positions...
> > Organization: Telia Internet
> > Newsgroups: comp.graphics.algorithms
> > Date: Tue, 30 Jan 2001 13:39:53 GMT
> > Subject: Re: Antialiasing & SVGA palette problem
> > Thanks, you know when starting at something new, sometimes one just
> > doesn't have a clue....
> > I preffer to use the 5:6:5 color mapping. I also know how to
> > pack the rgb-values in a lo-byte and a hi-byte and put them
> > into the video memory.
> > The code is in my putpixel(x,y,r,g,b) routine
> > But I also need a getpixel(x,y,r,g,b) routine to retrieve the rgb values
> > from a certain point.
> > Is this the right method for this purpose, or is there a faster way
> > to do this?
> > , hi = the higher byte value
> > , lo = the lower byte value
> > , blue = (lo && 31)
> > , green = ((lo - blue)>>5) + ((hi && 7)<<3)
> > , red = ((hi - green)>>3)>>3
> >> Oh man. 16 bit collor means there is no palette!
> >> 16 bit, right? so you can have:
> >> 1) 1bit empty | 5 bit red | 5 bit green | 5 bit blue
> >> 2) 5 bit red | 6 bit green | 5 bit blue
> >> you write the color info directly into the video memory, there is NO
> >> PALETTE.
> >>> hi there !
> >>> I have some SVGA routines here to be used in my new 3d
> >>> demo. I decided to use the the 640x480 and 16-bit color mode (65536
> >> colors)
> >>> (I think it is the 111h mode)
> >>> but I don't know how to setup the palette!!!
> >>> One thing I know is that there is a lo-color and a hi-color
> >>> and the red is 0-31, green 0-63, blue 0-31
> >>> Do I need two memory locations? If so, where the hell are these?!
> >>> So, I need help with this. Until then I will be stuck!
> >>> One more thing...
> >>> Is there any fast ways to do antialiasing of line segments ?
> >>> .
> >>> Bye/JMR