Page 1 of 1

GAPI drawing problem

PostPosted: Dec 17, 2002 @ 5:14pm
by CharlyV
We need your help to solve our GAPI drawing problem for the coming AtariST emulator called " CastCE " !

here a part from the code :

register unsigned short *line_o = (unsigned short *)(GXBeginDraw_()+(320*gapiypitch+row*gapixpitch));
register unsigned int *line_i = (unsigned int *)(((unsigned char *)membase)+vid_adr);
for (col=0; col<20; col++) {
*line_o = color[((r4>>12)&15)];
(unsigned char*)line_o-=gapiypitch;
*line_o = color[((r3>>12)&15)];
(unsigned char*)line_o-=gapiypitch;
*line_o = color[((r2>>12)&15)];
(unsigned char*)line_o-=gapiypitch;
*line_o = color[((r0>>12)&15)];
(unsigned char*)line_o-=gapiypitch;
*line_o = color[((r4>>8)&15)];
(unsigned char*)line_o-=gapiypitch;
*line_o = color[((r3>>8)&15)];
(unsigned char*)line_o-=gapiypitch;
*line_o = color[((r2>>8)&15)];
(unsigned char*)line_o-=gapiypitch;
*line_o = color[((r0>>8)&15)];
(unsigned char*)line_o-=gapiypitch;
*line_o = color[((r4>>4)&15)];
(unsigned char*)line_o-=gapiypitch;
*line_o = color[((r3>>4)&15)];
(unsigned char*)line_o-=gapiypitch;
*line_o = color[((r2>>4)&15)];
(unsigned char*)line_o-=gapiypitch;
*line_o = color[((r0>>4)&15)];
(unsigned char*)line_o-=gapiypitch;
*line_o = color[(r4&15)];
(unsigned char*)line_o-=gapiypitch;
*line_o = color[(r3&15)];
(unsigned char*)line_o-=gapiypitch;
*line_o = color[(r2&15)];
(unsigned char*)line_o-=gapiypitch;
*line_o = color[(r0&15)];
(unsigned char*)line_o-=gapiypitch;
}
GXEndDraw_();


the source buffer is a 320*200 4 bit color (16 color), the palette is precalculate in Color[16] which is define as array of short

Normaly this piece of code would draw a line (320 pixel) , that's draw a totally green line in 3850 and in 3760 that's draw a green monochrome line , without gapi that draw a line with good color.

are the Gapiypitch and Gapixpitch are well used?

Thanks in advance ...

CharlyV, on behalf of schtruck

PostPosted: Dec 17, 2002 @ 9:28pm
by Dan East

PostPosted: Dec 18, 2002 @ 1:01am
by Digby

PostPosted: Dec 18, 2002 @ 8:39am
by schtruck
ok to explain more, i would like to take my horizontal line from my memory buffer (a line from the ST video screen buffer) which is 320 pixel witdh and copy it to handled screen in lanscape mode.
in fact i would like to make a standard routine using Gapi which will be certainly slower than my direct video access routine for IPAQ but surely compatible with many PPC.