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

Re: [MiNT] libgem16: vs_color



On Mon, Jan 18, 2010 at 9:48 AM, Helmut Karlowski
<helmut.karlowski@ish.de> wrote:
> I've spend some time to find out why vs_color isn't working in XaAES.
>
> I think it's not XaAES but it is libgem.
>
> I found that in vs_color.c the variables in the stack overwrite themselves,
> though I don't know why this happens.
>
> I have a working version now by making the arrays static:
>
>
> void
> vs_color (short handle, short index, short rgb[])
> {
>  static short vdi_intin[4] = {0,0,0,0};
>  static short vdi_control[VDI_CNTRLMAX] = {0};
>  short *ptr;
>
>  VDI_PARAMS(vdi_control, vdi_intin, 0L, vdi_dummy, vdi_dummy );
>
>  ptr = vdi_intin;
>
>  *(ptr ++) = index;           /* vdi_intin[0] = index */
>  if( (long)vdi_params.control & (long)1 )      <- this is true if arrays not
> static!
>
>
> Now also pixel-detection works in the original way using vs_color, as well
> as restore-palette.
>
> Someone will have to find out why the arrays are overwritten (I have placed
> Cconws-output in vs_color to detect these), I don't understand it.
>
> BTW: The CLOBBERED_REGS-patch by Vincent has no effect, because the inlined
> code in gem_vdiP.h isn't used.
>

This is really good news Helmut, thanks a lot for the work here, as
you can see it had hidden effects, and that is a big load off my mind
for a start, which will benefit all branches, great work, now it just
needs to finalized..


Paul