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

Re: [MiNT] VDI Device Independant format



On 07/29/2010 09:42 PM, m0n0 wrote:

> base = 0x0e1024;      // imaginary address where the device independent
> screen data is stored
> LONG img_width = 16;  // dimension of device independent screen data
> LONG img_height = 16; // dimension of device independent screen data
> LONG plane_size = img_width * img_height;

IIRC this is not quite correct. The width of the bitmap would be 1 word
or 2 bytes (I think it's words, but look that up), not 16 pixels.

> WORD * plane_0 = base + plane_size * 0;
> WORD * plane_1 = base + plane_size * 1;
> WORD * plane_2 = base + plane_size * 2;
> WORD * last_word_in_plane_2 = plane_2 + plane_size - sizeof( WORD )
> 
> Would the pointers ( plane_0 - plane_2 ) point to the correct location?
> One thing I could think of is that the plane data is not contiguous - like
> the Screen Format for Atari ST in 16 color mode, but maybe it's wrong to
> think about that format when working with the VDI device independent
> format...

Yes, that's wrong ;-) The device independent bitmaps are stored with
each plane as one contiguous block, not interleaved like the ST screen
format. So your code looks OK to me.

Jo Even