Path: chuka.playstation.co.uk!scea!greg_labrec@interactive.sony.com From: mperdue@hrtc.net (Mario Perdue) Newsgroups: scea.yaroze.programming.2d_graphics,scea.yaroze.programming.codewarrior Subject: Re: Sprite/OT trouble Date: Sun, 03 Aug 1997 04:41:23 GMT Organization: SCEA Net Yaroze News Lines: 49 Message-ID: <33e4076f.24640019@205.149.189.29> References: <01bc9f6f$da300e60$37f135ce@jjustice.iquest.net> <01bc9f7a$4e1bc300$63f135ce@jjustice.iquest.net> NNTP-Posting-Host: firewall.hrtc.net X-Newsreader: Forte Free Agent 1.1/32.230 Xref: chuka.playstation.co.uk scea.yaroze.programming.2d_graphics:184 scea.yaroze.programming.codewarrior:156 On 2 Aug 1997 20:25:56 GMT, "John Emmer" wrote: > OK, following up my own post (and adding the CodeWarrior group) to add >something else I've noticed. I currently have this version of the PadRead >function in my program: > >u_long PadRead(void) >{ > return(~(*(bb0+3) | *(bb0+2) << 8 | *(bb1+3) << 16 | *(bb1+2) << 24)); >} > > Two things: First, compiling without the 'void' (i.e. just using empty >brackets) in the prototype or header, CodeWarrior placed a little red arrow >next to the function call in the loop from my previous post (i.e. just >"padValue = PadRead();") - but did not report an error. With the void >specified, I get no red arrow. (In neither case did I state 'void' in the >actual function call.) > Second, either way, I've noticed in the stepwise debugger that the little >dashes in the left column which indicate what line of code is executing are >pointing at the two (blank) lines _beneath_ the closing bracket of this >function. Does that mean this function is not compiling right, and what >would cause that? > Additionally, I've noticed that in Mario's WalZ game, he sends this >function a parameter of type long, although the function makes no use of >any parameters. What purpose does this serve? > Thanks! > >-- > John Emmer Video Game Enthusiast, Philosopher, Fledgling Programmer > jjustice@cs.bsu.edu jjustice@iquest.net jpemmer@bsuvc.bsu.edu > > Vectrex; 7800, Supercharger, Lynx, Jaguar; NES, SNES, Virtual Boy; > Turbo Duo & Express; SG, SGCD, 32X, Saturn; 3DO; PlayStation, Yaroze; >C64, A600, A1200, P100; Arcade Centipede, Spy Hunter, Neo-Geo; BA, MA, ABD > > You noticed that too. When I first used PadRead() I just pasted it in from another sample and didn't pay much attention to it. Since then I have changed it to look like this: u_int PadRead(int id) { return(~(*(padBuffer[id]+3) | *(padBuffer[id]+2)<<8 )); } The id tells which controller to read. Mario