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

Re: [MiNT] libgem16: vs_color



Am 18.01.2010, 23:26 Uhr, schrieb Helmut Karlowski <helmut.karlowski@ish.de>:

3) I have just learned that the 68020+ allow word and long access on odd addresses. Can the stack be on an odd address, too ? If it is the case, the stack may have been on an odd address for a long time... You should trace the addresses of some local variable in the caller of vs_color(), and its caller... until you find where the stack becomes odd.

Yes - thanks! ;)

Here is the calling-history:

      {
        short xy[2];
        BLOG((0,"Recover palette: phys=%d virt=%d xy=%lx",
          C.P_handle, C.Aes->vdi_settings->handle, screen.palette, xy));
set_syspalette( /*C.P_handle */C.Aes->vdi_settings->handle, screen.palette);
      }

I added xy[] just to see the address (even). screen.palette is a pointer to 1536 bytes.


void
set_syspalette(short vdih, struct rgb_1000 *palette)
{
  short i, pens, rgb[3];
//if( C.fvdi_version == 0 ) return; /* as long as this doesn't work reliable */

  if (screen.planes > 8)
    pens = 256;
  else
    pens = 1 << screen.planes;

//  display("set syspal - %d pens", pens);
  BLOG((0,"set_syspalette:vdih=%d rgb=%lx", vdih, rgb));
...

Here rgb is odd. Now tell me!

--
Helmut Karlowski