N64 controller joystick encoding

Includes but not limited to: SNES, Genesis, Sega CD, PlayStation 1, Nintendo 64, Dreamcast, Game Gear and I guess the Virtual Boy.

Moderator: Moderators

Post Reply
ks0ze
Posts: 2
Joined: Tue Aug 21, 2012 8:14 pm

N64 controller joystick encoding

Post by ks0ze » Tue Aug 21, 2012 8:30 pm

I am working on building a N64 to USB adapter using a PIC24FJ64GB002 microcontroller. Right now I've got everything working except the Analog joystick doesn't work as expected. Could someone please tell me how it actually does the encoding? (i.e. does the controller return the difference in position from the last time it was polled or does it actually return the current joystick position?)

Also, is the scale from 127 to -128 on the x and y axis or is it 0 to 255?

Thanks,

-Dan

P.S. I know that you can buy adapters like what I'm trying to build but this seemed like a fun way to learn to create USB HIDs

User avatar
jjhammerstein
Senior Member
Posts: 1562
Joined: Tue Nov 18, 2008 7:15 pm
Location: Southern CT
Contact:

Re: N64 controller joystick encoding

Post by jjhammerstein » Wed Aug 22, 2012 11:36 am

This would probably be useful:

http://www.instructables.com/id/Use-an- ... ontroller/" onclick="window.open(this.href);return false;
GET FREE WOW GOLD SEX VISIT MODRETRO


User avatar
evilteddy
Portablizer
Posts: 423
Joined: Tue Mar 25, 2008 2:11 am
360 GamerTag: Kirren of Smeg
Steam ID: kizzinator
Location: Newcastle, Australia

Re: N64 controller joystick encoding

Post by evilteddy » Sun Aug 26, 2012 7:19 pm

The joystick output is represented as 2s complement which does range from -128 to 127. However the actual range of any N64 joystick is much less. Using a range of -80 to 80 seems to be the best fit to a number of controllers. It's not an artifact of bad joysticks, game's are programmed to expect input within these bounds and you'll get many amusing joystick problems if you have a larger range.

ks0ze
Posts: 2
Joined: Tue Aug 21, 2012 8:14 pm

Re: N64 controller joystick encoding

Post by ks0ze » Mon Aug 27, 2012 1:13 pm

Thanks for the help. I finally got it all working (I had the bit order reversed for the joystick).

-Dan

Post Reply