Universal PCB (eventually) thread

Start should be button 9, Select is button 10, the fourth punch should be 5, and the fourth kick should be 7.

EDIT: This information is inaccurate as of the 1.B release.

My current (horrible) plan is to put the UPCB over on top of the button wires, and my 360 pcb in the middle (where the old pcb was)… freaking ugly, but it fits!

If you have the madcatz pad, I put the UPCB between the two circular supports. After that You can angle the madcats so that it fits in between the circle supports at a 45 degree angle and sits on top of the UPCB. I attached the upcb to the plastic and the madcatz to the steel plate.

Yeah, the “EX1” and “EX0” don’t register when in PC mode. They do show up when I bypass and use the madcatz PCB.

Also apparently Vista is just a bitch with some USB devices after SP2, it only registers about every 1 in 10 tries to plug it in. Blargh, first time I’ve had something shitty happen with it.

When you say they don’t register, are they lighted up like they are pressed, or do they never light up? The list of controllers in the control panel outlet should have the version number of the firmware, followed by a couple of letter; it should be either BP or XP for yours; can you verify what it says?

If the buttons for the extras are dark, and the firmware version is XP, then I made a mistake and put the wrong revision of the firmware on; If you’re using those extra two buttons and the program button, you’ll want the BP version. If you’re not using the program button, you’ll want the B version.

And I do highly recommend using the program button.

In regards to PS3 and diagonals.

I have a somewhat related project and working on PS3 support, http://jvspac.kirurg.org/, and just want to share a couple of findings.

I sniffed the descriptors from my old cordless rumble pad 2 that works with the PS3, and found some differences.

If you change this:

0x09, 0x39,                    //   USAGE (Hat switch)

0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x07, // LOGICAL_MAXIMUM (7)
0x35, 0x00, // PHYSICAL_MINIMUM (0)
0x46, 0x0e, 0x01, // PHYSICAL_MAXIMUM (270)
0x65, 0x14, // UNIT (Eng Rot:Angular Pos) --70
0x75, 0x04, // REPORT_SIZE (4)
0x95, 0x01, // REPORT_COUNT (1) // 1 byte
0x81, 0x02, // INPUT (Data,Var,Abs)

to this:

0x09, 0x39,                    //   USAGE (Hat switch) - same as rumble

0x15, 0x00, // LOGICAL_MINIMUM (0) - not on rumble pad
0x25, 0x07, // LOGICAL_MAXIMUM (7) -same as rumble
0x35, 0x00, // PHYSICAL_MINIMUM (0) - not on rumble
0x46, 0x3b, 0x01, // PHYSICAL_MAXIMUM (315) - changed to 315
0x65, 0x14, // UNIT (Eng Rot:Angular Pos) - same as rumble
0x75, 0x04, // REPORT_SIZE (4) - same as rumbe
0x95, 0x01, // REPORT_COUNT (1)
0x81, 0x42, // INPUT (Data,Var,Abs) - modified to 42

diagonals on the d-pad works on the PS3. Both versions works on XP, so don’t ask why - I hate HiD descriptors… Also neutral should be 0x08, not 0x0F…

My code for translating stick input to hat buffer is a little different as I get a 4 bit field via JVS, I tried being clever but ended up with a simple translation array:

unsigned char jvsstick2usbhat[16]={ // 4 bits, 9 legal states
	0x8,  // 0=neutral
	2,  // 1=right
	6,  // 2=left
	0x8,  // 3=illegal - left&right)
	4,  // 4=down
	3,  // 5=down right
	5,  // 6=down left
	0x8,  // 7=illegal - down,left & right)
	0,  // 8=up
	1,  // 9=up right
	7,  // 10=up left
	0x8,  // 11=illegal - up, left right
	0x8,  // 12=illegal - up, down
	0x8,  // 13=illegal - up, down, right
	0x8,  // 14=illegal - up, down, left
	0x8  // 15=illegal - up, down, left right
	};

   //p1stick:  bit0=right,bit1=left, bit2=down, bit3=up
hidbuffer[0][4]=jvsstick2usbhat[p1stick];

Works flawlessly in Tekken 5 DR, which is the only game I’ve got so far - don’t use the analog inputs at all, I just leave them.

Zim, you’re officially my hero now. I’ll give it a try, test it out and report back in a couple of hours.

http://img158.imageshack.us/img158/1559/zimscreamoptimizedqv8.jpg

Worked awesome, so big thanks to invzim for spotting the problems in the descriptor.

Version 1.B (1.11) released. Changes
-USB code tweaked to support PS3 properly. Currently no Home button support, but Im working on that, and if appears that if you have an up to date firmware, Home button is not required for BC games. I played some Tekken 3 and SFA:3 just peachy with it.
-USB buttons tweaked around to match what the PS3 expects, so Short is [], Strong is triangle, etc.
-Added stick mode to the USB support in case any PS3 or PC games get conflicts between the XY stick and the POV hat. Holding Start when plugging in will make the POV hat (PS3 d-pad) the only one reported, and holding select when plugging in will make the XY stick (PS3 left analog stick) the only one reported. By default, both are reported.

Feedback is definitely welcome, so please try it out and let me know how it goes. I definitely want to hear about PS2 BC games, PS3 fighters (T5DR, VF5, whatever) and the PSN download games like SotN since I couldnt test either.

Sweet! Also very interested in PS2 BC games as I only have the 40gb version myself. If you or anyone else have ANY clue as how to issue the ps button press, let me know.

edit: or is that just another name for home button? time to google… :slight_smile:

Oh shit, where can I buy two assembled UPCBs right now? This is what I was waiting for.

I dont know if it was a 40gig or 80 gig at the neighbors house I tested, but, when putting in a PS1 game, it would boot straight up and start, no home button press. I’m hoping PS2 and PSN games are the same now, because I know his firmware was up to date. I tried CvS2, Alpha Anthology, and Rez, and all would not play even though the BC list for 80gig models say they should work fine.
Yes, the PSX button I have been calling ‘home’. I dont know for sure what the proper term is.

PM me with what all you’ll need; do you need cables or can you make them yourself? If you’re putting them in HRAP cases I can do the install for you pretty easily. Let me know what you need and PM me, or check the trading outlet thread for the kit prices.

This is huuuge! Thanks to the invzim and Toodles combo. When I get my upcb installed, I’ll give feedback with my friend’s 60gb model.

I just gave up on google and ordered a logitech cordless precision ps3, as it is the cheapest I could find that has the PS button and is supposed to work under XP aswell (so I can sniff the descriptors&traffic). Will let you know how it turns out - for my project it is sort of essential to have the PS button to exit games etc.

The PS3 I tested with has the newest firmware installed, and after you boot the PS2 game it still asks you to press the home button or the PS2 emulation won’t recognize the controller. I know people say you shouldn’t have to press the home button in new firmwares but unless it’s a setting in the crossbar it still shows that behavior when I tested it.

EDIT: Just to confirm, it doesn’t ask for the home button to be pressed on PS1 games.

Well, crap. I tried adding a bunch of extra buttons to see if the PS3 would treat any of them as the Home button, and none of them brought up the ‘Quit gate, Reassign controllers, etc.’ screen. It doesn’t look like the support Sony added for older PSX->USB converters included any home button support. Yes, I know the Pelican has a home button, but it pretends to be a true SIXAXIS. Sadly, it looks like this is the route I’ll have to take. I already tried using the descriptor from a VSHG, but it wasn’t recognized at all on the PS3.

So, getting the UPCB to emulate a SIXAXIS is what I’m working on now.

The six-axis is a nightmare, and it’s not even hid compliant.

What trouble did you have with the VSHG? A friendly person sent me the VSHG hid descriptor as a binary dump with traffic, and I will try it when I get home from work.

This is REALLY annoying and pissing me off a bit. The sniffed HID descriptor from the VSHG seems corrupted in a way, and input doesn’t work under XP or PS3. The first part of the descriptor is ok, and starts with a 13 button description, where the PS button is 13. When using the first part with 13 buttons and hat, pressing button 13 doesn’t do anything on the PS3. Hopefully the logitech will have a sane hid descriptor.

Here’s the one I tried from the VSHG; absolutely nothing was recognized on the PS3, so I figured the VSHG might detect whether plugged into a PC or PS3 and change descriptors as needed.



//Descriptor from VSHG 
rom struct{byte report[PCUSB_HID_RPT01_SIZE];}PCUSB_hid_rpt01={
 0x05, 0x01,					// USAGE_PAGE (Generic Desktop)
 0x09, 0x05,	  				//Usage gamepad
 0xA1, 0x01,					// COLLECTION (Application)
 0x15, 0x00,					//   LOGICAL_MINIMUM (0)
 0x25, 0x01,					//   LOGICAL_MAXIMUM (1) --10
 0x35, 0x00,					//   PHYSICAL_MINIMUM (0)
 0x45, 0x01, 					 //	PHYSICAL_MAXIMUM (1)
 0x75, 0x01, 					//   REPORT_SIZE (1)
 0x95, 0x0d,					//   REPORT_COUNT (13)
 0x05, 0x09,					//   USAGE_PAGE (Button) --20
 0x19, 0x01, 					//   USAGE_MINIMUM (Button 1)
 0x29, 0x0d, 					//   USAGE_MAXIMUM (Button 13)
 0x81, 0x02, 					//   INPUT (Data,Var,Abs)
 0x95, 0x03, 					//     REPORT_COUNT (3)
 0x81, 0x01, 					//Input something or other --30
 0x05, 0x01,					// USAGE_PAGE (Generic Desktop)
 0x25, 0x07, 					//   LOGICAL_MAXIMUM (7)
 0x46, 0x3b, 0x01, 				//physical maximum 315
 0x75, 0x04, 					//Report size 4    --39
 0x95, 0x01, 					//Report count 1
 0x65, 0x14,					//unit: English angular position
 0x09, 0x39, 					//usage: hat switch
 0x81, 0x42,					// Input something or other
 0x65, 0x00, 					//Unit:none    --49
 0x95, 0x01, 					//report count 1
 0x81, 0x01, 					//Input something or other
 0x26, 0xff, 0x00, 				// LOGICAL_MAXIMUM (255)
 0x46, 0xff, 0x00, 			// PHYSICAL_MAXIMUM (255)  --59
 0x09, 0x30, 
 0x09, 			//--62
 0x31, 0x09,
 0x32, 0x09, 
 0x35, 0x75, 
 0x08, 0x95, 
 0x04, 0x81,   //--72
 0x02, 0x06, 
 0x00, 0xff, 
 0x09, 0x20, 
 0x09, 0x21,
 0x09, 0x22,   //82
 0x09, 0x23, 
 0x09, 0x24, 
 0x09, 0x25, 
 0x09, 0x26,   //90
 0x09, 0x27, 
 0x09, 0x28, 
 0x09, 0x29,
 0x09, 0x2a, 
 0x09, 0x2b,  //100
 0x95, 0x0c, 
 0x81, 0x02, 
 0x0a, 0x21, 
 0x26, 0x95, 
 0x08, 0xb1, 
 0x02, 0xc0   //--112
}; 


The buffer to send was 19 bytes, and here's the code for it I used. 

buffer[0]=buffer[1]=0;
	buffer[2]=0x08;
	buffer[3]=buffer[4]=buffer[5]=buffer[6]=0x80;
	buffer[7]=buffer[8]=buffer[9]=buffer[10]=buffer[11]=buffer[12]=buffer[13]=0;
	buffer[14]=buffer[15]=buffer[16]=buffer[17]=buffer[18]=0;
	//setup POVhat 
	
		if(!Stick_Up)
		{
			buffer[9]=0xff;
			if(!Stick_Left)
				{ buffer[2]=0x07; buffer[8]=0xff; }
			else 
			{
				if(!Stick_Right) 
					{ buffer[2]=0x01; buffer[7]=0xff; }
				else
					{ buffer[2]=0x00; }
			}			
		}
		else
		{ //stick's not up
			if(!Stick_Down)
			{ //but it is down
				buffer[10]=0xff;
				if(!Stick_Left)
					{ buffer[2]=0x05; buffer[8]=0xff; }
				else 
				{
					if(!Stick_Right) 
						{ buffer[2]=0x03; buffer[7]=0xff; }
					else //its just down
						{ buffer[2]=0x04; }
				}				
			}
			else
			{ //sticks not down nor up
				if(!Stick_Left)
					{ buffer[2]=0x06; buffer[8]=0xff; }
				else 
				{
					if(!Stick_Right) 
						{  buffer[2]=0x02; buffer[7]=0xff; }
					else //its neutral
						{ buffer[2]=0x08; }
				}				
			}
		}
			
	
	if(!Stick_Jab) { buffer[0]|=0b00000001; buffer[14]=0xFF; } //NO idea about the [14]. It seems to want to send an analog byte for every digital button bit.
	if(!Stick_Short) { buffer[0]|=0b00000010; buffer[13]=0xFF; } 
	if(!Stick_Forward) { buffer[0]|=0b00000100; buffer[12]=0xFF; } 
	if(!Stick_Strong) { buffer[0]|=0b00001000; buffer[11]=0xFF; } 
		
	if(!Stick_Fierce) { buffer[0] |=0b00010000; buffer[15]=0xFF; } //Fierce ==L1
	if(!Stick_Roundhouse) { buffer[0] |=0b01000000; buffer[17]=0xFF; } //RH==L2	
#ifdef EXTRA_BUTTONS	
	if(!Stick_Extra0) {  buffer[0] |=0b00100000; buffer[16]=0xFF; } //Fourht punch == R1
	if(!Stick_Extra0) {  buffer[0] |=0b10000000; buffer[18]=0xFF; } //Fourht Kick == R2
#endif
	if(!Stick_Start && !Stick_Select && Stick_Jab)  { buffer[1]|=0b00010000; } //PS HOME button bitches!
		else //one or both is not pressed or Jab IS pressed. 
		{
			if(!Stick_Start) { buffer[1] |=0b00000010;} 	
			if(!Stick_Select) { buffer[1] |=0b00000001;} 
		}
//button numbers are based on the wiring of a hacked VSHG in a HRAP case. god only knows what
//may have been switched around. 
//buttons: jab short forward strong RH fierce 
// #10 is start, #9 is definitely select #13 is Home
//7 and 8 are the extendeds? R1 and R2 I hope
//no idea about 11 and 12, prolly L3 and R3. Nothing on the VSHG PCB activates it. 




CodyK sent me a log of a VSHG in action; I cant see the descriptor itself in that, but the reported data matches whats in that code.

As for emulating the SIXAXIS, well, it’s all up to Sony. I’ll try what I can.

Cmon people, step up and help toodles and invzim.

If you have an HRAP3 or a Hori fighting stick 3 for ps3, here’s all you need to do

download this:

http://www.pcausa.com/Utilities/UsbSnoop/default.htm

(invzim, that’s what I used, but if you have a better utility, by all means suggest it; toodles the dump I sent you was from some commercial demo that has since expired).

Start up the program, then plug your stick into the PC, it should show up in the list (if it didn’t, clck “refresh”). Click on the line that showed up for the stick, click “install”, click “replug”.

Then tap the PS button a couple times, click “pause log”. Email the log file or post it up here.

Should take about 5 minutes of your time.

The logs you sent were plenty good. To have similar logs from a hrap would be interesting.
What bugs me is that neither the vshg nor sixaxis have sane hid descriptors, but the stuff that has to do with the PS button is ok, it just doesn’t work when we do the same thing.

Toodles: it’s the last part of the vshg that doesn’t make sense:
0x09, 0x2b, // USAGE (Secondary Flipper)
0x95, 0x0c, // REPORT_COUNT (12)
0x81, 0x02, // INPUT (Data,Var,Abs)
** 0x0a, 0x21,0x26, ** // ???
0x95, 0x08, // Report count (8)?
** 0xb1, 0x02, // ?**
0xc0 // END_COLLECTION

There is nothing in the hid standard that is 0x0a, but regardless, the buttons are first, and the traffic shows no activity this far into the buffer, so it shouldn’t really matter. Unless of course codyk is a secret sony agent messing with our heads :smile:

Once the sniffer is installed for the stick, it’d be really nice to unplug it and replug it, so it does the initial transfers with the HID descriptors.
So far, both that sniffer and Snoopy don’t record the second descriptor ( the Interface and HID class specific descriptors) in a way that’s easily converted to butting into the Microchip descriptor code. Working on it still.