Path: chuka.playstation.co.uk!news From: Chris Chadwick Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: CLUT troubles! Date: Wed, 06 Aug 1997 01:14:57 -0700 Organization: PlayStation Net Yaroze (SCEE) Lines: 57 Message-ID: <33E83281.A05@dial.pipex.com> References: <33E1AB7A.1DEE@dial.pipex.com> <33E1CBFC.42D@interactive.sony.com> <33E38861.2EC9@dial.pipex.com> <33E608B8.1225@interactive.sony.com> NNTP-Posting-Host: ad123.du.pipex.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 2.02 (Win95; I; 16bit) Developer Support wrote: > > Chris Chadwick wrote: > > > > Hi Stuart > > > > I've attached a zip file containing a simple example to demonstrate the > > problem (I hope you get it OK as I haven't sent an attached file before :) > > It uses ClearImage() instead of MoveImage() to simplify things but the > > problem is the same. > > > > Curiously, now that I've extracted the relevant code from my project > > for the example, I now can't seem to change *any* of the CLUT entries; > > not even the first 16 as I could before! > > > > I'm a bit worried that you say you have no problems changing all CLUT > > entries. Perhaps I've missed something, but i can't think what. > > > > Your info that CLUTs have to be 16 pixel aligned has cleared-up the > > 'shifted colour' problem. Thanks, I did not realize this. > > > > I'll post this to the newsgroups as well in case anyone else is > > interested. Thanks for your quick response ;) > > > > Chris > > > > PS I'm using GNU development in case you need to know. > > > > OK, it seems that your CLUT is getting cached, and hence the changes are > not taking effect. The only way I can think of fixing it is if you draw > at least two different sprites, (or the same sprite with a different > CLUT location). This will clear the CLUT and reload your altered one the > next time round. > > There maybe a better fix, I'll look into it. > > Stuart Sorted! :) All behaves as expected when I add a second 8-bit sprite to the OT although it has to have it's display attribute bit set otherwise it doesn't work so, at the moment, I'm just using a 1x1 sprite with negative screen coords. All the other other sprites I'm displaying are 4-bit so I gather this was why I was only able to alter the first 16 CLUT entries: they were being changed in the CLUT buffer frequently for the various 4-bit sprites, but my single 8-bit sprite meant that entries 16-255 were never getting reloaded into this buffer... I had no idea a CLUT cache was being used! Thanks for solving a particularly puzzling problem, Stuart - you're a star ;) Chris