Path: chuka.playstation.co.uk!news From: James Shaughnessy Newsgroups: scee.yaroze.programming.gnu_compiler Subject: Re: -O Optimising levels Date: Fri, 13 Mar 1998 01:35:35 +0000 Organization: Bacardi Ferrari V12 Lines: 39 Message-ID: <35088D67.2048@manc.u-net.com> References: <6e905o$sv61@emeka.playstation.co.uk> NNTP-Posting-Host: manc.u-net.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.0 (Win95; I) Lewis_Evans@Playstation.sony.com wrote: > double buffering' during game. (Do you write everything to the same > rectangular > offscreen area of VRAM each frame, and then MoveImage to > whichever buffer is being drawn/displayed??). That is exactly it, but there is only one display buffer, all the drawing is done on the 640x512 virtual screen, except for the the on-screen stuff like the digital timer, lives count etc. I considered this to be the best option for my game format as having a split screen mode is simply done by MoveImaging two 320x128 areas during the vertical blank. (So if there's 250 bullets floating around the screen and both players are near them, even though there'd be 500 bullets VISIBLE on the screen the code only has to draw 250. When I could compile my game with -O2 the speed increase (regarding on-screen bullets) was amazing -- It could easily handle well over 500 bullets with no slow down. But without it, and both player have, say, lasers and spiralfire nasty slowdown does occur. > Other than that, try isolating which part(s) of the code are going > astray under optimisation, and use -O2 because that's bestest Since getting the Yaroze about 10 weeks ago I've been busy developing my game and learning the PSX -- I'm amazed how much I picked up in the first week alone. I had got it to do something that I only dreamt of ever managing on a PC. Funny because this -O optimisation problem is the only real hurdle I've come across. And I'm gonna jump it soon. Gravitation v1.0 is about 4000 lines long total and isolating a problem now is a bit harder than when it was simple. I guess I'll need to learn to use GDB or something to see where my game crashes and because of what variable when compiler optimised? Thanks, Jim -- ----------------------------------------- James Shaughnessy james@manc.u-net.com http://www.netyaroze-europe.com/~shaughnj -----------------------------------------