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: 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?
2018-08-12 11:30
JackAsser

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

Registered: Oct 2014
Posts: 490
There is a hand over time, you should consult the PRG for details.
2018-08-12 13:26
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.
2018-08-12 13:29
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.
2018-08-12 14:48
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.
2018-08-12 15:13
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! :)
2018-08-12 15:32
chatGPZ

Registered: Dec 2001
Posts: 11386
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
Freeze/Blazon
Guests online: 112
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 No Listen  (9.6)
3 Party Elk 2  (9.6)
4 Cubic Dream  (9.6)
5 Copper Booze  (9.6)
6 Rainbow Connection  (9.5)
7 Dawnfall V1.1  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 Antitrack  (9.8)
3 OTD  (9.8)
4 Fungus  (9.8)
5 S!R  (9.8)

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