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

[MiNT] VDI Device Independant format



Hello,

I was reading
http://toshyp.atari.org/en/VDI_fundamentals.html#Device-independent_20format
and I just wanted to make sure that I understand it right. Of course
Memory in the machine is not layered like the image shows it, and although
the doc says the planes are placed contiguous placed in memory, I'm not
really sure about that. (maybe because I think to much about Atari ST
interleaved format when reading the doc)

Let's assume I want to read color data of the device independent screen
data. And Let's assume 16x16 pixel screen data is located at 0x0e1024...

Instead of writing how I understand the doc, I just type some pseudo code,
I think I that expresses my thoughts better:

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;

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...

Thanks for reading & possible answers! :)

-- 
Greets,
Ole