Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in 
CSDb User Forums


Forums > C64 Coding > Control port to SID ADC mapping
2018-08-12 11:19
JackAsser

Registered: Jun 2002
Posts: 1471
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?
2018-08-12 11:30
JackAsser

Registered: Jun 2002
Posts: 1471
Nm, found it: http://unusedino.de/ec64/technical/aay/c64/cia10.htm
2018-08-12 12:26
oziphantom

Registered: Oct 2014
Posts: 235
There is a hand over time, you should consult the PRG for details.
2018-08-12 13:26
TWW

Registered: Jul 2009
Posts: 444
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.
2018-08-12 13:29
JackAsser

Registered: Jun 2002
Posts: 1471
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.
2018-08-12 14:48
Groepaz

Registered: Dec 2001
Posts: 8904
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.
2018-08-12 15:13
JackAsser

Registered: Jun 2002
Posts: 1471
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! :)
2018-08-12 15:32
Groepaz

Registered: Dec 2001
Posts: 8904
and i was wrong of course, you need to wait 20 rasterlines, ie two times the sample period :)
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Sub Zero
swasti
Fred/Channel 4
Peiselulli/tRSi
Bieno/Commodore Plus
Marq/Fit^Lieves!Tuor..
AlexC
Perff/No Name
Guests online: 35
Top Demos
1 Uncensored  (9.7)
2 Comaland 100%  (9.7)
3 Unboxed  (9.7)
4 Edge of Disgrace  (9.7)
5 Coma Light 13  (9.6)
6 The Shores of Reflec..  (9.6)
7 Old Men in Used Cars  (9.6)
8 C=Bit 18  (9.6)
9 Wonderland XII  (9.6)
10 Lunatico  (9.6)
Top onefile Demos
1 Arok 20 Invitation  (9.6)
2 FMX Music Demo  (9.6)
3 Rewind  (9.6)
4 Daah, Those Acid Pil..  (9.6)
5 Merry Xmas 2017  (9.5)
6 Crystal Gazer  (9.5)
7 Pandemoniac Part 2 o..  (9.5)
8 Official X2018 Report  (9.5)
9 Party Horse  (9.4)
10 Dawnfall V1.1  (9.4)
Top Groups
1 Oxyron  (9.4)
2 Booze Design  (9.4)
3 Censor Design  (9.4)
4 Finnish Gold  (9.3)
5 Arsenic  (9.3)
Top Fullscreen Graphicians
1 Joe  (9.9)
2 Veto  (9.8)
3 Jailbird  (9.6)
4 Mirage  (9.6)
5 Mermaid  (9.5)

Home - Disclaimer
Copyright © No Name 2001-2018
Page generated in: 0.053 sec.