From mint-bounce@lists.fishpool.fi Mon Jan 18 03:17:14 2010 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=lDBErrVp5LkMq3ZmyBiWC9g4ynFdSXx3aWISABDtKm0=; b=UnqSqRlMZM6GiASbYrCxI+2shoel5uLjiIvUCimz/CymZ5FLDFc6ox15Y6nJD1yeDk ofyksEcXwhlxbCSM1apGEH+gKnXpHa1NUriAWi2WzzM4+tSlL69zz5H8HJv075GVxg+z Y3vZ+pCgV94e78y0x2Fg095ZtkPK+kqHsu5jc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=L/wT+B5GddpOzkiNdDIliWJvZvGkW1O4dVBNd35QNJtMO3y3kOUc2y0ElkCg2ffccA BzEiz98M3qgH6ofB9xW//N8EaQW6R/ah5X4dltQ7auuLGF2YZ2Yw93HGDtI/g2C+jXPX xd6HYAoWaQLjQdw2O/Ib/tpZ/+K25xQD24BJ0= MIME-Version: 1.0 In-Reply-To: References: Date: Mon, 18 Jan 2010 19:13:40 +1100 Message-ID: <11a6f2b11001180013o35e3b05cxe577d3585fc7179b@mail.gmail.com> Subject: Re: [MiNT] libgem16: vs_color From: Paul Wratt To: mint Content-Type: text/plain; charset=ISO-8859-1 X-ecartis-version: Ecartis v1.0.0 Sender: mint-bounce@lists.fishpool.fi Errors-to: mint-bounce@lists.fishpool.fi X-original-sender: paul.wratt@gmail.com Precedence: bulk List-help: List-unsubscribe: List-Id: X-List-ID: List-subscribe: List-owner: List-post: Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.sparemint.org id o0I8HDB5019668 On Mon, Jan 18, 2010 at 9:48 AM, Helmut Karlowski 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