Path: chuka.playstation.co.uk!news From: "Craig Graham" Newsgroups: scee.yaroze.programming.codewarrior Subject: Re: Now I'm getting REALLY mad! Date: 18 Dec 1997 02:18:16 GMT Organization: PlayStation Net Yaroze (SCEE) Lines: 204 Message-ID: <01bd0a92$e4e72b20$LocalHost@Angela1.intelligent-group.com> References: <34902D9A.A58C5281@tin.it> <01bd094f$aa411420$6c0b0a0a@newcastle.twowaytv.co.uk> <3496FC87.B1AD07DF@tin.it> NNTP-Posting-Host: l125.mistral.co.uk X-Newsreader: Microsoft Internet News 4.70.1155 Giulio wrote in article <3496FC87.B1AD07DF@tin.it>... > CRAIG GRAHAM wrote: > > > The bug's in CodeWarrior aren't generally related to the code generation > > - they tend to be linker/debugger related. > > I'll tell you an example of CW compiler big BUG: > I've defined a Struct named SpriteType with a pointer to a GsSPRITE > inside it and some other stuff for motion and animation clocks etc... > Then I have defined a pointer to that struct and a simple variable > related to that (just think at Sprite, *SpritePtr). > Well I have tried to use an array of Sprite (no problem) and some > SpritePtr as globals. You have to know that I have got no errors from > the compiler (because there was no error) but CW refused to allocate > memory for the pointer and I had had to define a Sprite Pippo[1] to use > a pointer to a SpriteType. Hmm. I've tried to recreat what you describe and may not have got it (post the code if this is wrong): typedef struct { int test_var1; GsSPRITE *sprt; } Sprite; Sprite *ptrSprite1,*ptrSprite2,arrSprite[1]; main() { ptrSprite1=NULL; //ptrSprite2=NULL; arrSprite[0].test_var1=4; } When compiled, the sbss link map section looks like: .sbss section layout Starting Virtual address Size address ----------------------- 00000000 000004 80090240 4 ptrSprite1 main.c 00000004 000008 80090244 4 arrSprite main.c No memory was allocated for ptrSprite2 - but if you uncomment the line I commented out, then another entry will appear in sbss for ptrSprite2. It's just been optimised out by the compiler as it wasn't referanced. If you look at ptrSprite1 and arrSprite in the variables window, you'll see arrSprite 0x80090244 ptrSprite1 0x00000000 The reason for that is easy. arrSprite is (in theory) a pointer to something that exists. ptrSprite1 isn't pointing at anything. The number in the variable window is the contents of the pointer. To get the memory address allocated to ptrSprite1, click on it and select "Copy To Expression". Now, edit the expression to read &ptrSprite1 (ie. the address of the pointer variable). You should see: &ptrSprite1 0x80090240 All working fine. One bug I have come across is having a C file with nothing but variables in it will cause the symptoms you're seeing (no memory allocated to the vars). Stick the vars into a file with code in it as well and the problem goes away. > An array of only an item to make a pointer that CW understands and > allocates memory for that ugly thing!!!! > Maybe I'm wrong and it's an error of mine, but why Metrowerks told me > nothing about this? Post your code, I'm happy to take a look at it (as would anyone). > And about the debugger, where I can read the globals I have defined in > my projects? I have to see how they change during program flow but I was > not be able to find them in any debugger windows and I can see them only > if a use them in a function defined to use them as parameters. Globals are listed in the browser window. Click on the file with the global you want to look at, a list of globals from that file then appears in the globals pane of the browser window. > You write as you have big experience in game programming, lucky you... > I have no big experience in game programming but I have developed > programs for the university about neural networks, operational > research, robotics and automation and my knowledge of C is good enough > to think that if I could have a better C compiler-debugger-linker-ecc I > could use the little time I have learning game programming and not "How > to make patches for CW bugs" Come now, as I said before, you're working with a limited market embedded system here. That you're getting any sort of dev system for the money is amazing enough. The bugs in Code Warrior aren't nearly that bad. Of course there are better compilers that folks use at Uni (on workstations, mainframes and PC's). I used them myself, but you have to accept that they have much larger potential markets esp. on the PC (even then, Visual C++ has as many debugger problems as code warrior), and proportionally more time & effort goes into them. You have to make allowances..... > > It's a good point to start at - do some small ones, include a few flash > > effects > > in each one, add the effects together into a big one, voila... > > I have already written that I have done and tested some libraries for > the PSX (SoundLib, PadLib, SpriteLib, VideoLib, FontLib, BgLib) and that > I know a little programming, I don't want lessons in programming THANKS That's a shame - I always want lessons in programming. I left college thinking I was shit hot, then met some folks who were so much better than me it was embaressing. But I learned loads from them, and still do. There's always more to learn... > if you want to give me and the group suggestions you are welcome but > don't be arrogant if you want to be considered a friend, PLEASE. I don't like to think of myself as arrogant. What I described was how I actually work. I still do actually, if I want a new effect I do it stand alone, then do a library with it in, then I can add it into other code. It all builds up from known working bits. > > There isn't really a Junior developers/senior developers divide - anyone > > can become a full licensed developer - just call Sony, tell them your ideas > > and fork out the money for their developer tools. We did. Be warned though, > > it's nowhere near as easy to use as a Yaroze..... > > This is the point: I mean that junior developers are persons which have > little experience in game programming and so need more time and help to > became a senior more experienced developer. Not really, I'd not written a commercial game ever before becomming a developer. I did system software for Interactive TV (OS design, Virtual Machine implementation), and before that Spacecraft electronics design. I just read an article on Rare, and they said that the guys who wrote Goldeneye on the Nintendo had never written a game before that either (it's their first project). > It's too easy to say " Anyone can become a full licensed > developer ", you need experience and support to become a full senior > developer, at last I think this way. Good ideas and talent count for a lot as well. I'd hope they count for more.... but ok, I take your point. Sony are very free with the dev kits really though, compared to Nintendo anyway. It took a long time to get approval, but that's mostly proving that a team with no track record can come up with the goods. You could buy a dev kit without concept approval, but it might be a waste of money as they could then refuse to allow a release. Here's the path to being a developer (well, the one we took): 1) Email Sony to say you want to be a developer. 2) Email Sony again 'coz they've ignored the first mail. 3) Phone, fax, NDA, etc... 4) Meet Sony to explain you ideas. 5) Go away until you've got some concept graphics (storyboards, renderings, etc). 6) Meet Sony again. 7) Go away until you've got some more concept graphics. 8) Get approval. Hurray - you're now a developer. 9) Don't tell anyone anything beyond this point or you're not a developer for long ;( > I don't like football... I only wish a big software house next to my > house that could help me to make my ideas become true. Move house. That's what I had to do.... Craig. Note to Paul Holman & co at Sony Dev Support (who may read this): I'm fairly sure I've not breached the NDA here. Contact me if there's a problem....