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 > sid timing ntsc/pal
2006-12-18 15:16
Trifox
Account closed

Registered: Mar 2006
Posts: 108
sid timing ntsc/pal

hi c64 experts, i am wondering how to play a tune on ntsc AND PAL machines with the same speed, using the rasterinterrupt leads to different timing on ntsc, i heard about a timer interrupt in c64 is this one suitable for using in a playing routine =?!
2006-12-18 16:04
Oswald

Registered: Apr 2002
Posts: 5094
guess the timers are clocked differently, but there's a bit somewhere that tells u wether u r pal or ntsc, the more experienced ones will tell you.
2006-12-18 16:05
algorithm

Registered: May 2002
Posts: 705
Either use the CIA timers or update the song around 1.25 raster frames (or similar) prob would be if the demo features raster effects, etc
2006-12-18 18:47
MRT
Account closed

Registered: Sep 2005
Posts: 149
What about NMIs (None Maskable Interrupts)? You can time them on a fixed number of clockcycles.

Though I would think that getting the exact correct timing on both pal and ntsc will always be problematic when you have badlines and stuff like that.
2006-12-18 19:37
JackAsser

Registered: Jun 2002
Posts: 2014
Hehe, you can never acheive that using timers, since the timers ALSO are based on the core clock. You simply have to detect if the machine is PAL clocked or NTSC clocked, then also detect if the tune is a PAL tune or an NTSC tune. Based on that you adjust your timer.
2006-12-18 20:21
Graham
Account closed

Registered: Dec 2002
Posts: 990
For a PAL tune simply set timers to 19656 clock cycles, for a NTSC tune use 17095 cycles. There is a small difference in clock speed, but since all SID logic is also based on it, it's best to ignore it and keep RELATIVE speed 100% as it is supposed to be. Otherwise some ADSR and other effects might sound different.
2006-12-18 23:12
JackAsser

Registered: Jun 2002
Posts: 2014
@graham: good point!
2006-12-19 06:36
Krill

Registered: Apr 2002
Posts: 2980
Hmm, to me, the same replay speed always was more important than some minutely adjusted adsr/filter outcome. But that's a matter of taste i guess. :)

And raster interrupts are no big problem if you have some "error margin" before your raster irq handlers, i.e., let them be triggered a couple of lines before actually doing anything, then wait for your line in a busy loop, then do whatever; plus make sure your timer nmi handlers re-enable irqs as soon as possible.
2006-12-19 15:23
Raf

Registered: Nov 2003
Posts: 343
Graham is right , additionally the sound pitch will change approx 0.5hz (if I computed it properly).

www.vulture.c64.org
2006-12-19 16:25
Laxity

Registered: Aug 2005
Posts: 459
depends on the note you're talking about... :)
2006-12-20 13:38
Trifox
Account closed

Registered: Mar 2006
Posts: 108
hi, thx for the informations, i see the timing is a real problem, how many ntsc computers are sold then ? ;)


it is a bit disappointing, because i just have all my animations ready to work under ntsc and pal, but now is the sound issue, you with perfect ears, would you recognize a 0.5Hz speed adjustment in a song ? that is usually played with 50Hz i think yes ... ;(
 
... 3 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 - Next
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
sebalozlepsi
t0m3000/hf^boom!^ibx
nameless
katon/Lepsi De
Exile/Anubis
Airwolf/F4CG
Mojzesh/TGR🇬🇧
Jazzcat/Onslaught
CA$H/TRiAD
Rico/Pretzel Logic
astaroth/TRSI
REBEL 1/HF
Guests online: 111
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 The Demo Coder  (9.6)
6 Edge of Disgrace  (9.6)
7 What Is The Matrix 2  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 X-Mas Demo 2024  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Booze Design  (9.3)
2 Oxyron  (9.3)
3 Performers  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Fullscreen Graphicians
1 Joe  (9.7)
2 Sulevi  (9.6)
3 The Sarge  (9.6)
4 Veto  (9.6)
5 Facet  (9.6)

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