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 > Using built-in timers
2007-05-30 17:18
jonathon
Account closed

Registered: May 2007
Posts: 4
Using built-in timers

Hi all,

I haven't found much online for using Timer A and B. Any reason why not?

I've been able to get Timer B working counting the number of times Timer A counts down to 0, in both one-shot and continuous mode, and then changing sprite data accordingly. It seems to work just as well as counters in an interrupt or NOPs.

Any reason why Timer A and B are not used very often, from what I have seen?
2007-05-30 17:51
Radiant

Registered: Sep 2004
Posts: 639
Nope, the timers are very practical. Go ahead and (ab)use them! Also, see Vandalism News #43 for a tutorial by Ninja/The Dreams on how to create stable raster interrupts using the timers.
2007-05-31 04:35
Oswald

Registered: Apr 2002
Posts: 5094
probably because the timers are straightforward, once you know which bit does what you can use them.

here is a very good reference:
http://unusedino.de/ec64/technical/aay/c64/ciamain.htm

why they arent used? well, probably since there is not much use of them. however though the fastest ways to make stable rasters all use the timers. then they could be used to make line slopes, but nobody tried so far, coz it would be probably too inaccurate. also some stretchers are using the timers. the twister in real, error 23, and the grey stretcher part in royal arte also makes heavy use of them.
2007-05-31 08:26
yago

Registered: May 2002
Posts: 333
Almost all K2 Demos use timers.
We basically devide our code in 3 pieces:

1) idle loop
2) raster-irq
3) timer-irq

With this technique, we can, for example, load the next part inside the idle-loop, and still run code* inside the timer-irq.

*code which is too long to run inside raster-irq

2007-05-31 10:19
Style

Registered: Jun 2004
Posts: 498
I dont think he's talking about NMI interrupts, more the timers themselves.

I only ever use them for raster stabilisation myself.
2007-05-31 11:05
Radiant

Registered: Sep 2004
Posts: 639
I know for example JackAsser also uses timers extensively, in combination with raster IRQ's, to great effect.

Myself, I've barely looked at them...
2007-05-31 11:12
enthusi

Registered: May 2004
Posts: 677
They're generally used for tape-loaders!! (!!)
2007-05-31 12:03
JackAsser

Registered: Jun 2002
Posts: 2014
@jonathon: I've also observed this behaviour (i.e. the non using timer community) and my personal explanation is that people in general like to code demo stuff and to do that you usually start learning how to setup a raster IRQ, then u're just lazy to do anything else. IMO, both polling and using timers are used WAY too seldom when it really would suit better.

A classic example: U want to do multiplexing or some other raster based effect => then use raster IRQ. But at the same time you wish to remove the upper and lower border. Now do to this simple; use an NMI timer (which has priority over IRQ) to remove the border thus save ALOT of hazzle.
2007-05-31 12:08
chatGPZ

Registered: Dec 2001
Posts: 11386
another useful application is to have raster stuff in nmi with timers (highest priority) plus another timer irq (lower priority) to do whatever else.
2007-05-31 17:53
trident

Registered: May 2002
Posts: 91
It is also possible to make a nice DYSP by setting a timer for 63 cycles and then do a jmp ($dc04) every raster line. By setting up appropriately timed routines at $3f00, $3e00, $3d00, etc., it is possible to get stable X timing.
2007-06-01 03:35
Style

Registered: Jun 2004
Posts: 498
thats what I meant :)
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
Peacemaker/CENSOR/Hi..
Soya/Fairlight
Conjuror
Andy/AEG
kbs/Pht/Lxt
zscs
BYB/Hokuto Force
XmikeX
t0m3000/hf^boom!^ibx
Brataccas/HF
rexbeng
McMeatLoaf
megasoftargentina
Technotron/I-I F
CA$H/TRiAD
Guests online: 117
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 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (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 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top NTSC-Fixers
1 Pudwerx  (10)
2 Booze  (9.7)
3 Stormbringer  (9.7)
4 Fungus  (9.6)
5 Grim Reaper  (9.3)

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