Path: chuka.playstation.co.uk!news From: Alex Herbert Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: CLUT troubles! Date: Wed, 04 Feb 1998 18:23:40 +0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 59 Message-ID: <34D8B22B.2C7F21D@ndirect.co.uk> References: <33E1AB7A.1DEE@dial.pipex.com> Reply-To: aherbert@ndirect.co.uk NNTP-Posting-Host: dialin2-19.ndirect.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.04 [en] (Win95; I) A solution to this and other CLUT problems... DOUBLE BUFFER YOUR CLUTS! When manipulating CLUTs it can make things a lot easier. Simply prepare a modified CLUT at a different VRAM location to your original CLUT. Now when you use the second CLUT the correct colours will be displayed. The first clut is now available for modification... etc etc... Alex Herbert Chris Chadwick wrote: > Can anyone *please* explain what's happening here: > > I have a simple 8-bit (256-colour) TIM displayed as a > sprite. I want to copy new CLUT entries into the > 256-colour CLUT associated to the sprite by using > MoveImage(), which works when I change CLUT entries > 0-15 (inclusive), but I can't seem to over-write > entries 16-255. The same is true if, for example, > I use ClearImage() to over-write each CLUT entry > in turn by pressing a joypad button: I'm able to > change entries 0-15 but anything else is ignored. > > I've printed all the relevant variables as I go and > all seems fine. I've even used a 'test' TIM which > simply shows blocks of all 256 colours in the CLUT - > using the above example, as I keep pressing the button > each colour changes as I'd expect until it gets to > CLUT entry 16 then, nothing! > > Another oddity I discovered is that if I place the > CLUT with a tpage X offset other than 0 (i.e. not > aligned with the left-hand edge of the tpage) then > simply displaying the sprite causes all colours to be > 'shifted' in the displayed image by however many the > CLUT tpage X offset is e.g. If I have my CLUT at > frame buffer address X=1, Y=480 (instead of X=0, Y=480) > then pixels in the image that should be displayed using > CLUT entry 1 are displayed with the colour of CLUT > entry 0 etc. Again, I've displayed all settings and all > is reported as normal: the GsSPRITE member .cx is shown > as 1 but appears to be using 0!? :( > > I wasn't aware CLUT's have to be aligned with tpages, > certainly, Tim Tool allows them to be positioned anywhere! > > I hope I've explained the problems cleary enough. > Any help would be *much* appreciated! > > Thanks in advance, > > Chris