| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Control port to SID ADC mapping
According to wiki:
"The X/Y inputs for paddle controllers are read out by two A/D converters in the MOS6581/8580 sound interface device, as they are analog values that can go from 0 to 255. Every control port can have two paddles attached, and since the SID chip only has two A/D converters, there is a register for switching which port should be read. The paddle buttons are also attached to the keyboard matrix."
"there is a register for switching which port should be read"
Which register is this? |
|
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Nm, found it: http://unusedino.de/ec64/technical/aay/c64/cia10.htm |
| |
oziphantom
Registered: Oct 2014 Posts: 490 |
There is a hand over time, you should consult the PRG for details. |
| |
TWW
Registered: Jul 2009 Posts: 545 |
If you plan to use 1 port, the time to align the sid to the port isn't really an issue. working with both, yeah this is a pain in the ass. |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: If you plan to use 1 port, the time to align the sid to the port isn't really an issue. working with both, yeah this is a pain in the ass.
Using port 2 at the moment, works fine now. I accidently routed both ports to the SID (undocumented %11). Works fine in VICE but causes all sorts of spurious reads on real HW. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
yes, VICE doesnt emulate both ports being selected. on the real thing you'll get something like the average value (actually not, you get the result of two resistors in parallel, the reciprocal sum. and with two mice the result will be complete bolloks :))
also "hand over time" is kinda wrong. the sample period is 512 cycles, so it samples for 512 cycles and then latches the sampled value. so if you want to read both ports, just wait about 10 rasterlines after switching. |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: yes, VICE doesnt emulate both ports being selected. on the real thing you'll get something like the average value (actually not, you get the result of two resistors in parallel, the reciprocal sum. and with two mice the result will be complete bolloks :))
also "hand over time" is kinda wrong. the sample period is 512 cycles, so it samples for 512 cycles and then latches the sampled value. so if you want to read both ports, just wait about 10 rasterlines after switching.
Awesome Groepaz, thanks for the sample time. I wait more than enough then! :) |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
and i was wrong of course, you need to wait 20 rasterlines, ie two times the sample period :) |