Path: chuka.playstation.co.uk!scea!greg_labrec@interactive.sony.com From: mperdue@iquest.net (Mario Perdue) Newsgroups: scea.yaroze.programming.2d_graphics Subject: Re: pixels Date: Mon, 07 Jul 1997 20:36:33 GMT Organization: SCEA Net Yaroze News Lines: 54 Message-ID: <33c14f5a.23551302@205.149.189.29> References: <33c122d9.168381829@news.scea.sony.com> NNTP-Posting-Host: firewall.hrtc.net X-Newsreader: Forte Free Agent 1.1/32.230 On Mon, 07 Jul 1997 17:13:32 GMT, jamin1@psu.edu (Jamin Frederick) wrote: >Hi, how's it going? I'm working on my pixel-by-pixel collision >detection algorithm, and I've run into a problem of actually trying to >access pixel data of sprites. It seems like I won't be able to access >the data the lies in the video memory once it has been transferred >from the main memory, since there are no api calls to do this, plus, >trying to access this memory probably interferes with the video >syncing and drawing mechanism. The only thing left to do is use the >pixel data that's been in main memory from the loaded TIM. >The only thing is, that this memory could be otherwise used for >something else. You can transfer image data from the frame buffer to main memory using StoreImage(). >So I have pixel data both in the video memory AND in main memory, >which is sort of redundant, but main memory is the only way to go. > >My question is, is there any way to replace data that's already been >loaded from siocons? For example, if I loaded my TIM at 0x80090000, >and then during program execution, I transfer this from main memory to >video memory, so that I no longer need what's at 0x80090000, is there >any easy way to reload data back into this position for use? Since you have a pointer to the memory in question, you can pretty much do anything you want with it. I'm told the Japanese web site has a program for loading overlays, but I havn't seen it. Is it easy? ..Define easy. :^) >The reason I want this to be answered is that I guess I'm planning to >make my pixel-by-pixel algorithm based on pixel data in main memory, >and I don't want it to be a silly approach. I mean, if someone >actually does want to reclaim use of that main memory, that is, then >the algorithm will totally fail! > >In general, is it a waste of space to have all your image data sitting >in main memory? That depends on the program. If you're short of memory, then it's a waste. If you've got memory to spare, then it's not a waste. >Is there any way your program heap can plow past some >of this data, once it's been utilized? Or perhaps have a spot just >for incoming data and use I/O to reload into that spot during program >execution...which only CodeWarrior people can do at this point? As I said above, you've got a pointer to this area and you own the machine (i.e. you don't have any other programs to share resources with.) You can do whatever you want with it. Mario