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

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

Registered: Jul 2009
Posts: 441
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: 1354
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: 8713
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: 1354
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: 8713
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
celticdesign/G★P/M..
ZeSmasher/F4CG
Bo Zimmerman
Harry Potthead
Sledge/Fairlight
Chrom_
Dymo/G★P
Guests online: 55
Top Demos
1 Uncensored  (9.7)
2 Comaland 100%  (9.7)
3 Edge of Disgrace  (9.7)
4 Coma Light 13  (9.6)
5 The Shores of Reflec..  (9.6)
6 Wonderland XII  (9.6)
7 Lunatico  (9.6)
8 We Come in Peace  (9.6)
9 Incoherent Nightmare  (9.5)
10 Wonderland XIII  (9.5)
Top onefile Demos
1 FMX Music Demo  (9.6)
2 Daah, Those Acid Pil..  (9.6)
3 Pandemoniac Part 2 o..  (9.5)
4 Arok 20 Invitation  (9.5)
5 Party Horse  (9.5)
6 Treu Love [reu]  (9.5)
7 Dawnfall V1.1  (9.4)
8 Merry Xmas 2017  (9.4)
9 In Memoriam BHF  (9.4)
10 Dawnfall  (9.4)
Top Groups
1 Oxyron  (9.4)
2 Booze Design  (9.4)
3 Censor Design  (9.4)
4 Finnish Gold  (9.4)
5 Crest  (9.3)
Top Graphicians
1 Mirage  (9.8)
2 Archmage  (9.7)
3 Razorback  (9.7)
4 JonEgg  (9.7)
5 DocJM  (9.7)

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