OBEX P1 Nunchuck & Classic Controller code working with P2
Rayman
Posts: 14,646
I've adapted @JonnyMac's P1 Nunchuck driver to work on P2.
Only issue is that I had to set the I2C frequency down to 20 kHz to make it work.
Think it should be at 100 kHz.
Not exactly sure what's going on... Might have to break out a scope later if can't figure it out...
All better now after some slight changes to the i2c driver.
Got this classic controller code working on P2 too.
Only issue is that I had to set the I2C frequency down to 20 kHz to make it work.
Think it should be at 100 kHz.
Not exactly sure what's going on... Might have to break out a scope later if can't figure it out...
All better now after some slight changes to the i2c driver.
Got this classic controller code working on P2 too.
Comments
- I think you can safely remove the whole NC_NINTENDO codepath and type selection, the other one should work with genuine controllers, too
- Might be useful to have a check that a nunchuk is actually connected (after initialization, registers FE/FF should read $0000 - if they don't, something else is connected, if it's $FFFF there's nothing connected or it failed to init)
Now works at 100 kHz.
Shoot. Spoke too soon. Had P2 clock at 40 MHz for this... Doesn't work at 160 MHz...
Added one extra delay and now works at up to 300 MHz P2 clock.