Cube64-DX - Ameliored GC controller to N64 adapter.

Discussion in 'Nintendo Game Development' started by DarthCloud, Mar 29, 2011.

  1. DarthCloud

    DarthCloud Fiery Member

    Joined:
    Dec 26, 2007
    Messages:
    874
    Likes Received:
    14
    Cube64-DX - Improved GC controller to N64 adapter.

    I just got last week my new logic analyzer: http://www.pctestinstruments.com/

    Awesome little device!

    I've been using the original Cube64 adapter made by Micah Dowty back in 2004 to play my N64 games since 2005. Since then I've saw several bug and some frustrating limitation.

    So in an attempt to improve the Cube64 adapter (and playing with my new LA ;) ) I decided to create a project called Cube64-DX:

    http://code.google.com/p/cube64-dx/ <= This is a URL (I hate how the forum display link)

    So far what I've done:

    1- Added support to "legacy" n64 0xFF command used by early n64 games like Mario 64, SW: Shadows of the Empire, Cruis'n USA.. This command ask for controller identity just like to more conventional 0x00 command.

    2-Some game like Cruis'n USA don't like the rumble pak and you end-up in a error screen of death ;) To pass this screen you need to remove the rumble pak and reset the game. Obviously you can't do that with an GC controller. So I added a little key combo (AL+AR+X) so you can set the controller to display as a controller with empty slot. Doing this on boot of Cruis'n USA allow to avoid the error screen. This can be also used to simply disable the rumble feedback too.

    3-Added support to PIC12F683 since their is not much space to add more instruction into flash in previously supported PIC.

    4- Added support for the Wavebird, this needed a special init to work.

    5- Added the ability to save up to 4 keys map preset. Using the combo keys AL+AR+"one of the key pad direction" you can select one of the 4 presets into the eeprom. You can change the key map as usually. When you switch to a preset it is saved in the eeprom so next time you boot the last preset you used will be load automatically!

    Personally I use this to have a different key config for platform game, racing, fps, combat.


    The only bug left I guess is that rumble emulation don't work with golden eye, I took a look with my LA and I saw that the game made several read/write to the rumble pak with somewhat random data. Currently the adapter support only sending CRC for write of 32 time the same byte which all CRC stored in a table. Unfortunately the current pic used are too slow to implement a real CRC.

    To support golden eye rumble I will need to change for a faster PIC something running over 40MHz so I can implement the CRC for real.

    I guess the 20MHz PIC are already pushed to their limit, the smaller one do not even have enough flash memory to add feature like wavebird and multi key map.

    The only thing I could add is support for an hardware mux controlled by the PIC that could allow switching between the adapter and a real N64 controller. Why this? You could then put a controller pak into the real n64 controller and then when you need saving you just toggle the mux so the n64 can read/write to memory card, and then you switch back to the gamecube controller for playing.


    For the version using faster PIC I plan to add the same thing at a software level, this way I could choose where to route each packet coming from the n64. Controller poll request would be keep for the adapter just like rumble command. But peripheral command like memory card saving/load, transfer pak, bio sensor could be routed to a real n64 controller without any action from the user.

    With those fast PIC I guess I could also add 128k SPI eeprom on the adapter so I could have a 4 bank memory card emulated. Since those PIC have hardware I2C protocol I could also add support for the Wii classic controller as input in addition to GC pad.


    BTW, I didn't tested the older PIC since I didn't received my mcirochip order yet ;)

    I can only confirm that the 12F683 that I use to develop work perfect!! Anyway their is no reason to still use the older PIC since they are too small to hold the new features!
     
    Last edited: Mar 29, 2011
    link83 and n64coder like this.
  2. APE

    APE Site Supporter 2015

    Joined:
    Dec 5, 2005
    Messages:
    6,416
    Likes Received:
    138
    Looks like I need to get myself a logic analyzer and have some fun.

    Awesome work, can't wait to see what happens next.

    You think it might be remotely possible to add in memory pak support? Obviously the Gamecube controller doesn't have a memory card slot but the device you use to interface with might be able to have a slot for the memory pak put in. I'm exhausted so proper contemplation isn't really possible. ;-)
     
    Last edited: Mar 30, 2011
  3. pcc10

    pcc10 Rapidly Rising Member

    Joined:
    Jun 14, 2009
    Messages:
    81
    Likes Received:
    0
    Will you be making these adapters to sell? If so, I'll buy a few and I'm sure there are others who would be interested as well.
     
  4. DarthCloud

    DarthCloud Fiery Member

    Joined:
    Dec 26, 2007
    Messages:
    874
    Likes Received:
    14
    No, the adapter cost nothing to build theoretically (like 5$) but getting the n64 extension cable and the gamecube one will cost like 20$.

    I don't know the GPL v2 very well but I'm pretty sure I can't sell this anyway.
     
  5. DarthCloud

    DarthCloud Fiery Member

    Joined:
    Dec 26, 2007
    Messages:
    874
    Likes Received:
    14
    I would be possible yes, but it would need a pic with a lot of IO, and I don't really want to make it that complex since it's a DIY adapter. I think it's better to add an n64 controller input, and use the official controller as a peripheral input for memory, tranfert pak operation. So in short you plug in an GC controller for controlling and receiving rumble feedback and you plug an n64 controller too for to used accessory like memory card, transfert pak and bio sensor.
     
  6. Shakey_Jake33

    Shakey_Jake33 Robust Member

    Joined:
    Dec 18, 2006
    Messages:
    230
    Likes Received:
    1
    You would be able to sell. As long as you publically release the source code, there's no restriction on using the code commercially.
     
  7. n64coder

    n64coder Robust Member

    Joined:
    Mar 25, 2009
    Messages:
    248
    Likes Received:
    1
    Nice investigative work on this project.
     
  8. Annoying_one

    Annoying_one Peppy Member

    Joined:
    Dec 24, 2006
    Messages:
    338
    Likes Received:
    9
    nice project. i must make a few
     
  9. syntax error

    syntax error Spirited Member

    Joined:
    Jan 29, 2011
    Messages:
    108
    Likes Received:
    0
    I have an AD330XL around here.
    That is the accelerometer chip used in the Wii.
     
  10. derekb

    derekb Well Known Member

    Joined:
    Jan 7, 2009
    Messages:
    1,964
    Likes Received:
    44
    nice work, I would definitely buy one of these if you produced them, even moreso with a clean wavebird solution
     
    Last edited: Mar 30, 2011
  11. APE

    APE Site Supporter 2015

    Joined:
    Dec 5, 2005
    Messages:
    6,416
    Likes Received:
    138
    Good point. If I had access to the equipment I'd likely have cast a replacement analog stick out of solid metal by now. :banghead:
     
  12. DarthCloud

    DarthCloud Fiery Member

    Joined:
    Dec 26, 2007
    Messages:
    874
    Likes Received:
    14
    The problem is getting both the n64 and gc connector. The only way I know to get some is buying extension cable. But seller on ebay ask way to much for then. I did buy some but it's not a solution even for small scale production.
     
    Last edited: Mar 30, 2011
  13. DarthCloud

    DarthCloud Fiery Member

    Joined:
    Dec 26, 2007
    Messages:
    874
    Likes Received:
    14
  14. link83

    link83 Enthusiastic Member

    Joined:
    Mar 22, 2008
    Messages:
    526
    Likes Received:
    8
    Great work DarthCloud :)

    I just wondered if this supports the analog stick position button reset combination of L+R+START?

    Also, does this correctly map the GameCube's analog stick (256 steps) to the N64's analog stick (168 steps)?
     
  15. Nully

    Nully Dauntless Member

    Joined:
    Nov 23, 2010
    Messages:
    738
    Likes Received:
    102
    Do you think you could make a tutorial on making it? Using pictures of course.
     
  16. DarthCloud

    DarthCloud Fiery Member

    Joined:
    Dec 26, 2007
    Messages:
    874
    Likes Received:
    14
    The joystick axis reset is handled just like it does on the GameCube with the X+Y+Start combo.


    168 step for N64???

    A don't know the actual resolution of the hardware in the controller but what is contained in the buttons status packets send by the N64 controllr is Two's complement data on 8bits for each axis (-128 to 127)

    The game cube use 8bits also for each axis in the packets but it's an unsigned value (0 to 255) centered on 0x80. So it's a direct translation without any resolution lost.

    Yeais I could put that in the project Wiki, will try to do one this Week-end!
     
    Last edited: Mar 30, 2011
  17. pcc10

    pcc10 Rapidly Rising Member

    Joined:
    Jun 14, 2009
    Messages:
    81
    Likes Received:
    0
    If I send you some n64 and gc connector extension cables, will you make me two adapters?
     
  18. DarthCloud

    DarthCloud Fiery Member

    Joined:
    Dec 26, 2007
    Messages:
    874
    Likes Received:
    14
    I'm very sorry but I'm not going to build the adapter for anyone.

    I'm both working and going to university so a don't really have the time to build the adapter, ship the adapter, after sale support, etc...

    My contribution here is the do the missing RE work, improving the project and then posting the source publicly.

    In fact I'm hacking on this for nearly a week and I'm currently neglecting some of my university projects ;)

    I'm going to post an easy to follow "how to" this weekend on how to put this together with not much soldering. I'm sure you have at least one friend that could pickup the instruction and do it for you :).
     
    Last edited: Mar 30, 2011
    Nully likes this.
  19. Nully

    Nully Dauntless Member

    Joined:
    Nov 23, 2010
    Messages:
    738
    Likes Received:
    102
    I'm looking forward to the tutorial.
     
  20. pcc10

    pcc10 Rapidly Rising Member

    Joined:
    Jun 14, 2009
    Messages:
    81
    Likes Received:
    0
    OK, not a problem. If anyone out there can build me two adapters, PM me. Thanks.
     
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page