I wouldn't mind building these but every time someone says "PIC" I re-realize I don't have any programmers and get all Sad Panda-y.
Cube64-DX - Ameliored GC controller to N64 adapter.
Nintendo Game Development
Its discussed in this thread:-http://nfggames.com/forum2/index.php?topic=3574.0
168 steps seems to be the upper limit, theres a video on youtube by micro which shows the N64 analog sticks resolution in real time:-
http://www.youtube.com/watch?v=sGbzKzpL9gY
If you try and use 256 steps (eg 1:1) the controls in certain games mess up, like Blast Corps as you can hopefully see in the above video.
In the thread I linked above micro used the following equation to get 168 steps from 256 steps:-
256*4=1024
1024*21/128=168 steps
There is also one more thing I recently noticed which confirms micro's discovery. I thought that if 168 steps is the actual N64 analog sticks resolution then surely emulator authors have to take this into account...and in fact they do! If you load up Project64 with the N-Rage input plugin and select 'Configure Controller Plugin' then you can see that the default analog sticks range is set to 66%, and considering that most analog sticks have a resolution of 256 steps you can work out that 66% of 256 equals 168.96 steps - almost exactly what micro said was the upper limit.
I really appreciate your hard work DarthCloud, cant wait to try using a Wavebird on the N64

I tried Turok 1 and yes the adapter does suffer from this bug.
So bug open, will likely fix this tonight!
And Blast Corps ordered


I should mention that I added the first line of the equation I showed, since I think micro's code actually reads 1024 steps directly from the replacement analog sticks potentiometer - but of course thats not possible for this since the GameCube data only gives you 256 steps. There might be an even shorter equation to give 168 steps from 256 steps?

<EDIT> In fact you could use the following equation instead:-
256*21/32=168 steps
Dont know why I didnt think of that before! I'm not that great at maths, so there still might be an even shorter/better way?
Also, I dont see this mentioned a lot, but there is plenty of really interesting/useful information in Nintendo's patents, for instance here are some patents for the N64 controller, and on page 20 of the first link it shows the N64 controller data layout:-
http://www.google.com/patents?id=XjoYAAAAEBAJ&printsec=abstract&zoom=4
http://www.google.com/patents?id=jIEDAAAAEBAJ&printsec=abstract&zoom=4
http://www.google.com/patents?id=mVgHAAAAEBAJ&printsec=abstract&zoom=4
http://www.google.com/patents?id=bhQIAAAAEBAJ&printsec=abstract&zoom=4
http://www.google.com/patents?id=7wcLAAAAEBAJ&printsec=abstract&zoom=4
N64 Analog Stick:-
http://www.google.com/patents?id=NH4WAAAAEBAJ&printsec=abstract&zoom=4
http://www.google.com/patents?id=rVUIAAAAEBAJ&printsec=abstract&zoom=4
N64 Controller Pak:-
http://www.google.com/patents?id=gqsYAAAAEBAJ&printsec=abstract&zoom=4
http://www.google.com/patents?id=GW0FAAAAEBAJ&printsec=abstract&zoom=4
N64 Rumble Pak:-
http://www.google.com/patents?id=4rwQAAAAEBAJ&printsec=abstract&zoom=4
Some info about the GameCube Controller interface?:-
http://www.google.com/patents?id=VH4QAAAAEBAJ&printsec=abstract&zoom=4
GameCube Wavebird Controller:-
http://www.google.com/patents?id=sYUUAAAAEBAJ&printsec=abstract&zoom=4
There are many more patents available, and many have different/extra information, so it might be worth searching through google patents?

I will also need to work on 16bit on a 8bit micro.
It will look something like this
(GC_Value*16+GC_Value*4+GC_Value) / 32
Why this way? Cause multiplying and dividing with nice binary number allow to only shift the number to the left to multiply and shift then to the right to divide.
divide 0b0100 by 2? shift right => 0b0010
multiply 0b0100 by 2? shift left => 0b1000
Since the pic only have a rotation command that put back to the LSB the bit kick out of the MSB I will need to used some mask to clear it. And since I need to work on 16bit I will need to copy the kick out bit of the LSByte to the first bit of the MSByte.
I already see the headache coming

I see, so will you have to use 160 steps instead of 168 steps?
Good luck with the coding :nod:
Good luck with the coding :nod:
I look forward to building the adaptor :thumbsup:
I must admit this quite challenged my ASM writing skill
It's working great! Games like Cruis'n USA that was very sensitive with the adapter feel like normal with this fix
.I guess the code could be optimise, but I don't see how currently
anyway it's working.I look forward to link83 building me an adapter...... 

Great work DarthCloud 
Wow, how interesting! I wonder why nobody realised this before?
I just have a few questions if you dont mind:-
- Did you test the analog stick range on multiple GameCube controllers? (Just in case one is worn out)
- Is it just a coincidence that 24+232=256? (Maybe 24 is in the 'deadzone' which can vary from controller to controller?)
- Is the GameCube analog sticks 208 step range caused by the octagonal restrictor plate?
- Do all controller analog sticks not allow the full range? (Wii, PlayStation, Xbox, etc)
[EDIT] I just found this site:-
http://wiki.dolphin-emulator.com/index.php?title=GameCube_pad
It seems to confirm that the 24 reading is within the GameCube analog sticks deadzone, so perhaps it is important to keep all 256 steps, otherwise some third party GameCube controllers might malfunction?
Also N64 analog stick should have similar deadzone area according to the patents, so using 256 steps might give it a more accurate feel? (Both should have deadzone area of 0-15% where no movement will occur)
Also just thought you might want to know in the code you quoted:-
I think it should be [-84, 83] so that it equals 168 including the zero?
Lastly, is there any chance the google code page could have the ASM/HEX file as a direct download on the downloads page?:-
http://code.google.com/p/cube64-dx/downloads/list
Just thought it might make it easier.
Sorry but I am really busy at the moment, I havent even got time to build one for myself at the second
OH: Plus its going to take a while for me to get all the parts together (PIC, extension cables, etc)

I just have a few questions if you dont mind:-
- Did you test the analog stick range on multiple GameCube controllers? (Just in case one is worn out)
- Is it just a coincidence that 24+232=256? (Maybe 24 is in the 'deadzone' which can vary from controller to controller?)
- Is the GameCube analog sticks 208 step range caused by the octagonal restrictor plate?
- Do all controller analog sticks not allow the full range? (Wii, PlayStation, Xbox, etc)

[EDIT] I just found this site:-
http://wiki.dolphin-emulator.com/index.php?title=GameCube_pad
It seems to confirm that the 24 reading is within the GameCube analog sticks deadzone, so perhaps it is important to keep all 256 steps, otherwise some third party GameCube controllers might malfunction?
Also N64 analog stick should have similar deadzone area according to the patents, so using 256 steps might give it a more accurate feel? (Both should have deadzone area of 0-15% where no movement will occur)
Also just thought you might want to know in the code you quoted:-
Lastly, is there any chance the google code page could have the ASM/HEX file as a direct download on the downloads page?:-
http://code.google.com/p/cube64-dx/downloads/list
Just thought it might make it easier.
OH: Plus its going to take a while for me to get all the parts together (PIC, extension cables, etc)

But keeping the whole gc range is what I've done first but it's was making it impossible to reach max speed once translated to n64. If the GC never reach 256, and you map 256 as 168 for the n64.. then you can never reach max value on the n64...
Too feel like a real controller you must used the real range value otherwise you get the feeling that the stick is too sensitive.
Will this run on Atmega8?
Since I can't find a cheap and easy to build pic programmer
Since I can't find a cheap and easy to build pic programmer

Don't waste time building a programmer get a cheap JDM prorgammer on ebay.
And use WinPic800 as software to program.
eabay has some 10-15 dollar programmers with one free PIC12F683
Found some bugs today in my Wavebird implementation. Fixing will need some big change.
http://code.google.com/p/cube64-dx/issues/detail?id=8
http://code.google.com/p/cube64-dx/issues/detail?id=8
Any news on that tutorial, man?
If you look at the Wiki section on the project page I already uploaded some Tutorial. Only the one about building the adapter is missing.
I need to update schematic too. Same thing but with 12F683 shown.
Have you measured how much current the rumble on the GCN controller takes?
How much current can you draw from N64's 3.3V line? Has anyone tried pushing that yet?
How much current can you draw from N64's 3.3V line? Has anyone tried pushing that yet?
Original thread: https://assemblergames.com/threads/cube64-dx-ameliored-gc-controller-to-n64-adapter.32204/