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


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

Registered: Jun 2002
Posts: 1989
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: 1989
Nm, found it: http://unusedino.de/ec64/technical/aay/c64/cia10.htm
2018-08-12 12:26
oziphantom

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

Registered: Jul 2009
Posts: 541
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: 1989
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
chatGPZ

Registered: Dec 2001
Posts: 11108
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: 1989
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
chatGPZ

Registered: Dec 2001
Posts: 11108
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
Apollyon/ALD
Matt
csio/monarchy c+4
Board Rider/Commodor..
ThunderBlade/BLiSS
Jammer
Guests online: 238
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 The Ghost  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.8)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 Rainbow Connection  (9.5)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Onscreen 5k  (9.5)
8 Wafer Demo  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 S!R  (9.9)
3 Mr Zero Page  (9.8)
4 Antitrack  (9.8)
5 OTD  (9.8)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.048 sec.