Path: chuka.playstation.co.uk!news From: laura smith Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: Dynamic PIXEL & CLUT Creation ? Date: Tue, 29 Apr 1997 09:58:57 +0100 Organization: Sony Computer Entertainment Europe Lines: 59 Message-ID: <3365B851.57E8@interactive.sony.com> References: <01bc521b$8ea98440$0411e8c3@cma> <336382dd.2607875@news.playstation.co.uk> NNTP-Posting-Host: 194.203.13.10 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.01 (Win95; I) Alex Amsel wrote: > > On 26 Apr 1997 08:25:04 GMT, "Chris Allmark" > did quoth at me: > > >I'm trying to create (as a test) a single pixel in VRAM without using a TIM > >file. > >I have tried to write a value (1 << 5) to a VRAM location for my pixel, and > >16 x (0x7FFF) for my 15 bit color values. I have then assigned my sprite to > >the pixel location, and the clut (4 bit) to the CLUT. It doesn't work. > > > >I have assumed that the 4 bit pixel value (0001) points to the second > >address in the CLUT to find out what colour it should be. What am I doing > >wrong ? > > I'm a little confused by what you mean but I'll try and help... > > If writing a pixel direct to the screen buffer, remember that it must > be done with LoadImage and that the values are 16 bit (1,5,5,5) and > cannot refer to cluts. > > If trying to set up a sprite by directly writing to vram remember that > if the sprite is 16 colours (4 bit) then 1 'pixel' of vram = 4 > 'pixels' of your sprite. > > i.e. Each vram pixel is 16 bits long, and in those 16 bits you have > pixel 1 | pixel 2 | pixel 3 | pixel 4 > > For an 8 bit clut it would be 2 pixels per vram word rather than 4. > > Remember you must use LoadImage, and remember that as a non blocking > function it returns before actually having copied the pixel. Use a > DrawSync to ensure it has done so. > > If you have done all this then perhaps you could post the source to > look over? > > Does the sprite work if you initialise vram from a normal time file? > > * Alex Amsel * Into Beyond Web Design & JAVA Programming * > * http://www.intobeyond.com * WWFC Utter Rubbish 1996-7* > MM - "Steve Corica is every bit as good as that Kinkladze" If you look at the SCEE 2d2 demo, I think part of that directly writes colours into CLUTs and into arrays, then loads them onto the frame buffer. Main causes of error when programming this: (i) pixel compression differs under 4, 8 and 16 bit modes (ii) ensure finish of loading to VRAM, using DrawSync(0) (iii) GsSPRITEs need correct bit-depth flag (again, 4, 8, 16) Hope this helps Lewis