Path: chuka.playstation.co.uk!news From: Jake Turner Newsgroups: scee.yaroze.programming.codewarrior Subject: Re: Undefined Macros in CW Date: Sun, 18 Oct 1998 09:29:18 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 73 Message-ID: <3629A6DE.B63220F1@revolution.co.uk> References: <362917C7.8F6BC33@aol.com> NNTP-Posting-Host: 62.172.91.248 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.05 [en] (Win95; I) Omar Metwally wrote: > I tried to compile a 2-player program had the following: > > if(padd & PAD1_START) return(98); > if(padd & PAD1_SELECT) return(99); > > if(padd & PAD1_RIGHT) CheckCollision(RIGHT); > if(padd & PAD1_LEFT) CheckCollision(LEFT); > if(padd & PAD1_UP) CheckCollision(UP); > if(padd & PAD1_DOWN) CheckCollision(DOWN); > > This did not work--I checked the pad.h file and the only macros defined > are things for 1-player > stuff. The macros don't include 2-player stuff such as PAD1_DOWN; it's > just set to PADdown or something for only the 1-player controller. What > should I do to fix this problem? Look in their sample C++ code PadCPPDemo directory. Here is the 1 / 2 player return codes for padd where padd = ~(*(m_pBuffer1 + 3) | *(m_pBuffer1 + 2) << 8 | *(m_pBuffer2 + 3) << 16 | *(m_pBuffer2 + 2) << 24); And m_pBuffer1 & m_pBuffer2 are the pointers set for pad reading by libps } // controller one Read() return types const ulong kPad1_Up = (1 << 12); const ulong kPad1_Down = (1 << 14); const ulong kPad1_Left = (1 << 15); const ulong kPad1_Right = (1 << 13); const ulong kPad1_Triangle = (1 << 4); const ulong kPad1_Cross = (1 << 6); const ulong kPad1_Square = (1 << 7); const ulong kPad1_Circle = (1 << 5); const ulong kPad1_L1 = (1 << 2); const ulong kPad1_R1 = (1 << 3); const ulong kPad1_L2 = (1 << 0); const ulong kPad1_R2 = (1 << 1); const ulong kPad1_Select = (1 << 8); const ulong kPad1_Start = (1 << 11); // controller two Read() return types const ulong kPad2_Up = (1 << 12 + 16); const ulong kPad2_Down = (1 << 14 + 16); const ulong kPad2_Left = (1 << 15 + 16); const ulong kPad2_Right = (1 << 13 + 16); const ulong kPad2_Triangle = (1 << 4 + 16); const ulong kPad2_Cross = (1 << 6 + 16); const ulong kPad2_Square = (1 << 7 + 16); const ulong kPad2_Circle = (1 << 5 + 16); const ulong kPad2_L1 = (1 << 2 + 16); const ulong kPad2_R1 = (1 << 3 + 16); const ulong kPad2_L2 = (1 << 0 + 16); const ulong kPad2_R2 = (1 << 1 + 16); const ulong kPad2_Select = (1 << 8 + 16); const ulong kPad2_Start = (1 << 11 + 16); // ControllerType return values const ulong kMouse = 0x1; const ulong kNeGCon = 0x2; const ulong kStandard = 0x4; const ulong kJoystick = 0x5; -- Jake Turner : Token Rocket Scientist ========================================= Practive VI it may save your life one day