Path: chuka.playstation.co.uk!news From: Marc@darkhex.com Newsgroups: scee.yaroze.freetalk.english Subject: Re: Have I mentioned this before... bgWorkArea? Date: Sat, 07 Jul 2001 23:42:48 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 104 Message-ID: <3B479068.6A486C97@darkhex.com> References: <9i4n4l$b931@www.netyaroze-europe.com> <9i4sa2$b933@www.netyaroze-europe.com> <9i7ktj$dor5@www.netyaroze-europe.com> <9i81j1$dor7@www.netyaroze-europe.com> NNTP-Posting-Host: modem-4.curufinwe.dialup.pol.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.6 [en-gb]C-CCK-MCD NetscapeOnline.co.uk (Win98; I) X-Accept-Language: en-GB,en That could be a reasonable assumption, let me make another. Maybe with the scrolling, +1 (x and Y) are some sort of caching to load the next tile quicker? Think about it, caching the next tiles used would be quicker than calculating them as they appear on the actual screen. Also, with the other calculations, remember that the full library set uses lots more additional effects that the Yaroze libs don't, I assume they merely disabled these functions than strip them from the code (hence the formula would be the same, just those extra bits not used). It's late and I've never used the Yaroze BG libs (I write my own), so I'm not sure - just throwing around some idea's :-) Marc. > Hi Max, > > I tried to work this out before and some of it makes sense... sort of... > > If the bg is scrolled to the left a few pixels, an extra tile becomes > visible on the right hand side of the screen making a total of 21 titles > across, hence the first +1 in the formula. The same applies to the y-axis > which explains the second +1. > > I'm not sure about the third +1, but it seems to suggest an extra word is > needed per row of tiles. Can't imagine why - flags maybe? I first thought > this might be a typo and left it out without any obvious problems, until I > tried a high-res interlaced mode and the bottom 2 rows of tiles were getting > messed up. I put the +1 back in and it all worked fine. > > I'm guessing that the GPU primitive for a 16x16 tile is 6 words in length > and hence the *6. I'm not sure about the +4. Flags again, maybe? > > I think the *2 is needed for double buffering. The bgWorkArea will need to > hold 2 packet workspaces as normal - the one being drawn and the one being > prepared. Not sure about the last +2. > > Oh, and the library reference says the unit is 'long', so no idea why floats > would come into it. > > Alex > > "Max" wrote in message > news:9i7ktj$dor5@www.netyaroze-europe.com... > > Hmm.. > > > > Its really the +1s and +1+1s and *6+4 etc that I don't understand besides > > this usually turns up a float value which is wierd considering the Yaroze > is > > a 32 bit integer machine and the value you get from this formula is always > > FAR bigger that you actually need. > > > > I don't think I'll ever figure this out :( > > > > Max > > > > Alex Herbert wrote in message > > news:9i4sa2$b933@www.netyaroze-europe.com... > > > Hi Max, > > > > > > According to the Library Reference (page 142): > > > > > > size=(((ScreenW/CellW+1)*(ScreenH/CellH+1+1)*6+4)*2+2) > > > > > > Hope this helps. > > > > > > Alex > > > > > > > > > > > > "Max" wrote in message > > > news:9i4n4l$b931@www.netyaroze-europe.com... > > > > Hey all, > > > > > > > > I've started up again on the 2D tutorial and I'm puzzling over this > > > > bgWorkArea size. Basically I have played around with it quite a bit. I > > > have > > > > 320 [16x16] tiles on the screen (20 tiles width x 16 tiles height) and > > my > > > > bgWorkArea is (20*16)*12 = 3840, now I get the 20*16 bit - the number > of > > > > tiles on the screen but 12 is just an arbitiary number I put in but it > > > won't > > > > work with anything less. I have also tried SCREEN_WIDTH (320) * > > > > SCREEN_HEIGHT (256) = 81920 (the number of pixels on the screen) but > > this > > > > number far outweighs what I actually need as a bare minimum... because > > it > > > > works with 3840. > > > > > > > > Can anyone tell me what the bgWorkArea size is actually mean to be? - > > > > please? > > > > > > > > Max > > > > > > > > > > > > > > > > > >