On Thu, Mar 30, 2006 at 09:27:15PM +0100, Chris Young wrote:
> 
> What does HD.pixelMap contain?  I'm a little confused as to what is
> being put into the bitmap:
> 

This is where the host specific pallette information is stored, it's an 
array of rgb values stored as (up to) 32 bit values. On windows it's stored
as a 15bit value with 5 bits each for R, G and B

These values are setup in DispKbd_InitHost()
  HD.red_prec    = 5;
  HD.green_prec  = 5;
  HD.blue_prec   = 5;
  HD.red_shift   = 10;
  HD.green_shift = 5;
  HD.blue_shift  = 0;

They describe the size in bits of each part, and number of bit offsets 
into the 32bit buffer of each part.

See DoPixelMap_Standard() and DoPixelMap_256() to see it build up 16 and 
256 entry indexes by using the values of the emulated VIDC pallette to 
base. The VIDC1 pallette is 16 32bit values, the format of which is 
described on page 10 (Section 5.2) of this PDF.
http://www.home.marutan.net/arcemdocs/datasheets/VIDC-1bpp%20300.pdf


> dibbmp[pixs]     = (unsigned short)HD.pixelMap[pixel &15];     
> dibbmp[pixs + 1] = (unsigned short)HD.pixelMap[(pixel>>4) &15];

I've cut and pasted in the line above, as it makes more sense with both.

'dibbmp[]' is the windows specific 15/16 RGB bit output buffer, 'pixs' is 
the position in the output buffer that represents the x,y position that 
'pixel' points too in the emulated video memory. 'pixel' is a pointer to 
8bit's worth of data, so in the 4bpp mode that this code comes from it 
represents 2 pixels worth of data. The data in the video memory that 
'pixel' points to is a logical colour (not an RGB value), that you must 
look up in the pallette table (hence the HD.pixelMap lookup), the &15 and 
>>4 are to break the 8bits worth of pixel data into 2 4 bit parts.

Hope this helps, and is accurate, as I had to work out most of it myself 
by reading the code :)

Peter


-- 
Peter Howkins
[EMAIL PROTECTED]


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
arcem-devel mailing list
arcem-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/arcem-devel

Reply via email to