Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user Sepa ! (Registered 2024-05-13) 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: 5025
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: 332
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: 675
They're generally used for tape-loaders!! (!!)
2007-05-31 12:03
JackAsser

Registered: Jun 2002
Posts: 1990
@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: 11137
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: 75
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
Grue/Extend
hostile/HmF
kbs/Pht/Lxt
celticdesign/G★P/M..
Weasel/Padua/Hitmen/..
Exploding Fi../Techn..
Thunder.Bird/HF/MYD!..
bexxx
psych
Hagar/The Supply Team
CopAss/Leader
Operator Teleksu
blala
Guests online: 117
Top Demos
1 13:37  (9.8)
2 Next Level  (9.8)
3 Mojo  (9.7)
4 Coma Light 13  (9.7)
5 Edge of Disgrace  (9.6)
6 Comaland 100%  (9.6)
7 Uncensored  (9.6)
8 No Bounds  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 Party Elk 2  (9.7)
2 It's More Fun to Com..  (9.6)
3 Layers  (9.6)
4 Cubic Dream  (9.6)
5 Copper Booze  (9.5)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Rainbow Connection  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Booze Design  (9.3)
3 Nostalgia  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Organizers
1 Burglar  (9.9)
2 Sixx  (9.8)
3 hedning  (9.7)
4 Irata  (9.7)
5 MWS  (9.6)

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