iVLM^3

My God...It's full of stars - Neon, Psychedelia, Colourspace, Trip-a-Tron and all flavours of VLM...
User avatar
zbandito
Baaaaaa!
Baaaaaa!
Posts: 2916
Joined: Sat May 18, 2002 10:00 pm 0
Location: Portland, Oregon
Contact:

iVLM^3

Post by zbandito »

I've been thinking about a hardware unit for the GC which would abstract controller inputs to a USB signal for use with VLM3. Originally I was thinking about trying to turn it into an actual product, and I think there may still be potential there, but at this time I can't dedicate the resources to it to produce it myself. I call it the iVLM^3. ;)

What does this hardware give you? Well, by plugging into the 4 controller input ports on the GC and then accepting USB signals in its place the GC can be controlled by a PC. This would allow you to record controller input signals and whatnot, then play them back in any sequence or whatever. The VLM3 then becomes scriptable. But further, buy abstracting the controller input signal to USB you can do Audio/MIDI-USB translation -- making it possible for musicians to directly and specifically control, script, and interact with the VLM3 directly from their instruments [piano keyboards, guitars, drums, etc.]. Actually, the VLM3 could be reactive to all sorts of different kinds of input at that point -- even video, satellite data, motion capture data, network data,... any kind of analog or digital input that can be accepted and translated by a PC could control the VLM3.

I envision some open-Source, cross-platform software that could provide scripting/sequencing and input translation, and open documentation on how to construct the actual iVLM^3 hardware. I've done some basic block layout diagrams, and I will try to link to some GC pinout specification data or something. One way I have been looking at accomplishing this is via controller adapters; the Xbox controllers are USB so if I could just find an adapter that should solve most of the hardware issue [in conjunction with a special USB cable; the kind with the extra resistor or whatever it is that allows a computer to computer connection]. Of course the easiest thing would be if Yak specifically coded support for this over ethernet, but that isn't really a guarunteed outcome of the Unity project [Unity is the focus, after all]...

So, thoughts? Recommendations? Suggestions? Contributions?

:D

Image
User avatar
moobaa
Sheepie Whore
Sheepie Whore
Posts: 16118
Joined: Sun Sep 29, 2002 8:08 am 0
XBL Gamertag: petee moobaa
PSN: moobaa
Location: Sydney, Australia

Post by moobaa »

"Probably need resistors or something here".

:D :lol: :P
User avatar
zbandito
Baaaaaa!
Baaaaaa!
Posts: 2916
Joined: Sat May 18, 2002 10:00 pm 0
Location: Portland, Oregon
Contact:

Post by zbandito »

hehe... did I mention I'm not an EE? :roll:

It shouldn't actually be that complex of a circuit though.. resistors in those places were more of a precaution than an absolute necessity
User avatar
moobaa
Sheepie Whore
Sheepie Whore
Posts: 16118
Joined: Sun Sep 29, 2002 8:08 am 0
XBL Gamertag: petee moobaa
PSN: moobaa
Location: Sydney, Australia

Post by moobaa »

Heh, for some reason it just reminded me of "Mummy's Magic Purse". :P

Yes, that's the way my brain is wired ;)
Dave
Baaaaaaa!
Baaaaaaa!
Posts: 8035
Joined: Mon Apr 22, 2002 6:35 pm 0

Post by Dave »

:twisted:
Last edited by Dave on Sat Apr 24, 2004 7:23 pm 0, edited 1 time in total.
User avatar
zbandito
Baaaaaa!
Baaaaaa!
Posts: 2916
Joined: Sat May 18, 2002 10:00 pm 0
Location: Portland, Oregon
Contact:

Post by zbandito »

yeah, injecting my own Wavebird signals was my original plan, but I had decided that it wasn't the easiest/best/cheapest route for a couple of reasons. First, you have to invest in 4 Wavebird controllers and Bluetooth transceivers, and then you have to know the frequencies they operate on and stuff... With the right gear (which I don't have) it's not hard to sweep over the frequencies, but I could never find any documentation of the official, precise operating frequencies. There were some indications that new Wavebirds operate on Bluetooth, but it was a long time ago that I looked into it. One obvious advantage of going wireless is not having to engineer much of a custom circuit...though interference, however unlikely, is still a possibility [particularly as Bluetooth/wireless devices proliferate].... It might make programming a bit more of a challenge, since the Bluetooth devices would likely be USB devices, but more of a communications device rather than a simple HID....
Dave
Baaaaaaa!
Baaaaaaa!
Posts: 8035
Joined: Mon Apr 22, 2002 6:35 pm 0

Post by Dave »

:twisted:
Last edited by Dave on Sat Apr 24, 2004 7:23 pm 0, edited 3 times in total.
User avatar
zbandito
Baaaaaa!
Baaaaaa!
Posts: 2916
Joined: Sat May 18, 2002 10:00 pm 0
Location: Portland, Oregon
Contact:

Post by zbandito »

Thanks for the links. I dunno if the OptiPac would work as it is, but that company seems to do some of their own hardware development.. I had contacted a few manufacturers in the far East to see if there was anything available that I could use but there is no product currently available, and I didn't want to give too many details since at the time I wanted to develop it into a product myself. Lik-Sang has a lot of those USB adapter thingys, but unfortunately even if you buy 2 and cut/solder them, you still have 2 female GC controller ports, and no male plugs. You could get the male plugs by buying GC controller extension cables, though (or open the cube and solder the wires directly to the controller daughterboard :twisted: ) It would probably be useful for accepting and analyzing the GC controller data, presuming the conversion box doesn't totally alter the signal.
User avatar
Ahchay
Baaaaaaa!
Baaaaaaa!
Posts: 6125
Joined: Tue Apr 23, 2002 10:23 am 0
Location: Londinium
Contact:

Post by Ahchay »

I did find a site with *some* technical info on the gamecube controller ports.

/me reaches for google

Hmm. Lost it :(

I did find this page which has some useful info on hacking controllers, unfortunately, there's very little hard information on the cube controllers out there.

Best results I've had were from taking apart a third party controller and attempting to hack that - results have been mixed though.

Cheers
Chris
the bizzarre ratings of an ignorant, deluded old fool
User avatar
zbandito
Baaaaaa!
Baaaaaa!
Posts: 2916
Joined: Sat May 18, 2002 10:00 pm 0
Location: Portland, Oregon
Contact:

Post by zbandito »

Software wise, this seems like it wouldn't be too hard to do something with DirectX, but I really do not want to require a Windows PC for this. Anyone have suggestions for *nix implementation? Seems like that would be the best route, seeing how Linux is available for x86 and PowerPCs..

This site has excellent information about NGC controllers. It seems the person doing the research was interested in trying to use the NGC controller on a PC, but the data looks quite relevant. I've mirrored the text it here just in case. ;)
Nintendo Gamecube Controller Pinout

The controller connects to the Gamecube through a proprietary 6-pin connector, with screen. The official Nintendo controller only seems to wire 5/6 of these pins, and of those only one seems to be used for data transfer between the console and the controller. With the exception of the power supply, the function of the remaining pins is unknown and is not described here. All the information here comes from an examination of the controller with oscilloscope and multimeter. Therefore, I make no guarantee that any of this information is accurate, and you use it at your own risk...

This is a work in progress, and these are just my early notes (11th December 2002). Since writing this, I've found that a Gamecube to USB interface exists already: it's called the Skillz Cube Connection USB and is only sold by Lik-Sang as far as I'm aware. I've not had the opportunity to try this, but apparently it only works with the original wired Gamecube controller (it's not compatible with the Wavebird or any 3rd party controllers). If anyone has useful information to add to this page, please drop me a line (contact details are on index page).

    James Ward, 11th December, 2002.

Connector Pinout

This is a view of the controller socket on the front of the console, looking into the socket. The numbering scheme is my own.

Image

Pin Colour J1 Function

1 Yellow 2 5V power supply (used by rumble motor).

2 Red 3 DATA line: bi-directional data to/from console, pull-up to 3.43V

3 Green 4 Ground.

4 White 5 Unknown (measured 0V, nothing visible on 'scope)

5 - - Unknown: not connected by official controller (measured 0V).

6 Blue 1 3.43V logic supply.

7 Black 6 Cable shielding / ground.

In the table above, the pin number on the left corresponds to the diagram of the controller socket. The colour code is that of the cable from the official Nintendo Controller (different models might vary), noting that one pin is not used in this case. The third column marked J1 refers to the pinout of the connector inside the controller, which you will only be able to get to if you have the appropriate security screwdriver bit (or improvise your own handmade tool). The function column on the right is my best guess at what each pin is for.

Power Supply and Rumble Motor

There are two power rails on the connector, a 3.43V supply that is probably used for the logic, and a 5V supply that appears to be used to power the rumble motor (and perhaps logic also). The 3.43V supply is only what I measured on a PAL Gamecube, which isn't necessarily the same as the 'nominal' voltage of the supply of course. The ground (3) and shield (7) appear to be connected together.

The 5V power used by the rumble motor is always on, and the motor is controlled by a command sent to the controller. i.e. the controller contains a power transistor to switch the motor on/off, rather than the console doing this. The Yellow 5V power line goes directly to the +ve terminal of the rumble motor, and it looks like the -ve terminal of the motor is attached to a transistor.

I've not measured the current drawn by the controller yet.

Serial Data Interface

The controller uses one bi-directional data line (Pin 2 - Red) to communicate with the console. This appears to be an active high 3.43V logic signal, using a pull-up resistor to hold the line high, and driving it low with an open-collector transistor when a low-bit needs to be transmitted. Communication is initiated by the console sending a 24-bit string to the controller, after which the controller responds with 64-bits of button state and joystick data.

The controller seems to have an internal pull-up resistor (measured 745 ohms) between the 3.43V power rail (Pin 6 - Blue) and the DATA line (Pin 2 - Red).

Test 1: No controller attached

With no controller attached, the gamecube appears to probe for a controller by pulling DATA (Pin 2 - Red) low every 12 to 14ms, clocking what appears to be eight low bits, then letting DATA go high again. Each data bit is approximately 5us duration, with a visible spike between each bit (maybe 1us) where the bus goes high again briefly. The image below shows the signal on the DATA line, with the 'scope triggered on the negative edge.

Image

Test 2: Controller attached

With an official controller attached, there is an interval of about 6.7ms between successive updates. Each update looks to last a little over 450us. The sequence starts with a 24-bit command from the console:

    0100 0000 0000 0011 0000 0010

The last two bits of this sequence appear to be the 'rumble' control. The pattern is normally '10', but seems to change to '01' when the motor is running. After a rumble the pattern sometimes remains '00' for a while, but eventually reverts to '10'. It's not yet clear whether these are a simple enable and drive signal, or if some initialisation sequence is required as with the N64 controller.

This sequence is probably a command word from the console. Although I've not seen the other bits change in this word, I'm sure they have some function codes (for example, there may be commands to reset the controller, or query what kind of hardware is attached to the console).

After the 24-bit command word, there is a short delay (about 15us, the data line being high) before the controller responds. After this period, the controller responds with a string of bits that contain the state of all the buttons along with joystick position data. From examination with an oscilloscope, the sequence appears to be as follows:

    000, Start, Y, X, B, A, 1, L, R, Z,
    DPadUp, DPadDown, DPadRight, DPadLeft,
    JoyX (8-bit signed), JoyY (8-bit signed),
    CX (8-bit signed), CY (8-bit signed),
    Left (8-bit), Right (8-bit)

Finally, the data line returns high again. Above, the L/R buttons are the end-stops on the L/R shoulder buttons. Note that between A and L there is a bit that always appears to be high. Also, I haven't seen the three leading zeros change. The buttons (and extra bits) make up a 16-bit field, the analogue controls make up a further 48-bits. Therefore, the GC sends a 24-bit command to the controller, and the control responds with a total of 64-bits. On the oscilloscope, the data bits look to be 5us, which gives a total of (64+24+3)*5us = 455us. This is assuming that the 'scope time-base is accurate.

Here is an example of what a complete data string looks like on the 'scope. In this figure, point A is the start of the 24-bit command word sent by the console, and point B marks the start of the 64-bit response from the controller. The quality of the image is quite poor, but it's actually possible to see the individual data bits. 

Image

The bit-pattern looks the same regardless of which controller port is used, so I guess that the control word doesn't contain a port identifier. If the console is reset, the first rumble bit seems to go low initially and then returns high after a few seconds. The same thing happens when you power on the console initially. In general, the communication with controllers seems to happen almost immediately when the console is turned on, so it seems likely that there is some dedicated interface here, rather than something that needs to be set up programmatically by the CPU.

Finally, here is a close-up view of the individual data bits when transmitting binary 0100. This shows the presence of the short spikes in between every data bit, presumably where the transistor is switched off (internal bus tri-stated?) and the data line floats high again.
Image
Larger versions of the images are available
http://www.int03.co.uk/crema/hardware/g ... ntrol.html


I found This Image Gamecube PS/2 Keyboard adapter.. I think you can convert USB and PS/2 signals fine, but it looks like the adapter is a little bit funky about certain keys and it doesn't do mouse input... :x :?
This adapter allows you to connect any keyboard or PS controller into your Gamecube. The Playstation controller function supports all buttons, including the analog controls. The keyboard connector can accept any PS/2 keyboard and is perfect for playing games such as Phantasy Star Online. Please note that special funtion keys are mapped differently:

Also note the following buttons do not work correctly when tested with Phantasy Star Online:

-CAPS Lock does not function
-NUM Lock is always on
Additional Adapter Funkiness

This Dreamcast adapter can take both PS/2 mouse and keyboard IF you use 2 adapters, which could maybe be attached to another converter to work on PlayStation2, and then converted to Gamecube with a third adapter... :lol: Sounds like there were some bugs in previous implementations of this type of hardware:
Connect either a PS/2 Mouse or Keyboard to the Dreamcast console. The perfect match to play any ego shooter like Quake, Halflife or others on the Dreamcast console. This version has several bugs fixed in comparism with the similar Total Control 5 unit.
Last edited by zbandito on Mon Sep 08, 2003 10:21 am 0, edited 2 times in total.
User avatar
zbandito
Baaaaaa!
Baaaaaa!
Posts: 2916
Joined: Sat May 18, 2002 10:00 pm 0
Location: Portland, Oregon
Contact:

Post by zbandito »

Here is some information on USB
Data on the USB flows through a bidirectional pipe regulated by the host controller and by its subsidiary hub controllers. Bus mastering allows allocation of USB's 12-Mbps bandwidth in two ways. USB can dynamically allocate bandwidth portions to various peripherals as needed, and it can reserve bandwidth for isochronous data transfers by specific peripherals. You can connect as many as 127 peripherals to one another by plugging USB's simple rectangular cable connectors into multiport hub controllers. The maximum cable-segment length for USB is 5m.

USB transfers signals and power over a four-wire cable, with two wires used for a differential signal and the other two wires for power and ground
http://www.reed-electronics.com/ednmag/ ... 2df_03.htm


There is also a USB to Parallel adapter available. The Skillz USB Cube connector might translate the signal into HID protocol. The gamecube wouldn't understand if it was fed back the translated HID signal. James Ward (above) has been working with the signals via a parallel port... I'm not sure if this could support 4 controller ports though :?

http://www.nextag.com/serv/main/buyer/p ... t=35948794
Image
User avatar
zbandito
Baaaaaa!
Baaaaaa!
Posts: 2916
Joined: Sat May 18, 2002 10:00 pm 0
Location: Portland, Oregon
Contact:

Post by zbandito »

detailed pictures of a disassembled GC controller:

http://www.lik-sang.com/master.php?navb ... gcopen.inc
User avatar
randomdude
Baaaaaa!
Baaaaaa!
Posts: 4609
Joined: Sat Aug 02, 2003 3:54 am 0

Post by randomdude »

Hey there, im not sure I have the knowledge to contribute, but id sure as hell like to try.

Recently I've been playing with PIC microcontrollers. Theese are funky, a 18-pin DIP chip that you flash with asm code, and then they can control stuff, like embedded devices. the playstation 1/2 'modchips' use a PIC.

You can get pics with usb, rs232, etc. How about someone (maybe me, if I can) builds a pic-based chip that sits between the stickports on the GC and multiplexes them into a single serial bitstream? then some coder guru can write some pretty software for the host machine.

How does that sound? I have no idea if I could actually do it, as I say im jsut playing with theese chips ATM. If anyone wants to give me some feedback, it would be appreciated... :)
User avatar
randomdude
Baaaaaa!
Baaaaaa!
Posts: 4609
Joined: Sat Aug 02, 2003 3:54 am 0

Post by randomdude »

oh, I forgot. you can get PICs with inbuilt ADC's so you could have an idiotproof 'plug stereo jack here' port..
User avatar
zbandito
Baaaaaa!
Baaaaaa!
Posts: 2916
Joined: Sat May 18, 2002 10:00 pm 0
Location: Portland, Oregon
Contact:

Post by zbandito »

I've been discussing some of this with the excellent James Ward, who did the GC controller research that is mirrored above. He has some very relevant information and insights relating to the controller signal and the GC.

Probably the best way to accomplish this will be to use the computer to 'push' the buttons and control sticks on the pad, and then allow the pad to essentially act as a microcontroller interface between the PC and GC. Timing and signal generation seems to be somewhat tricky, and a native USB device would require quite a bit of development. Sending native GC commands might not really be feasible over the parallel port due to timing issues. So perhaps the best solution will be to use Parallel to control button presses only, then allow the pad to generate the actual control data for the GC (as Ahchay was indicating above). Then in a later implementation, perhaps you could integrate USB->parallel adapters like linked above.

Digital button presses will be very easy; analog controls will be more involved. Analog controls will probably require an ADC (analog to digital converter) or a 'RC Integrator'. I'm not sure what an RC Integrator is, yet, but supposedly it would be the less elegant of the two solutions ;)

I've published the full emails on my site; there are a lot more details than I have covered here. Click the link below to read them:

http://www.sejus.com/earth2willi/forums ... ?p=848#848
Post Reply