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 > Stable Raster via Timer
2003-12-28 19:40
Copyfault

Registered: Dec 2001
Posts: 478
Stable Raster via Timer

Maybe some of you advanced coders can help me with the following oddity. I'll keep out the basic routine for stabilizing rasters with the timer method, as it is presumably known to everyone!

If we ignore Illegal Ops for the moment, the max. number of cycles occuring in the main prog is 7 (when executing an indexed RMW). When it comes to the different values the variance can take, there should also be 7 (0 to 6 cycles). I wrote some (working!) routines, but I always end up having 8 different variance values. Of course one can live with it, but I wonder where this 8th state comes from!

If necessary, I'll deliver more details. I'd be really happy to understand this behaviour!

Yours, Copyfault
 
... 65 posts hidden. Click here to view all posts....
 
2004-01-02 20:33
Cybernator

Registered: Jun 2002
Posts: 154
The timer is triggered once each frame, rite? Do you trigger it _exactly_ at the same cycle each frame? If not, this could make additional cycle later. (According to my theory ;)
2004-01-02 22:38
Copyfault

Registered: Dec 2001
Posts: 478
No, not once per frame! Before *any* IRQ occurs, I sync the timer so that it'll give me the same variance values on every non-bad-line Raster-IRQ! But unfortunatly these values lie within a range of 8! Also don't have a clue what other delay sources there might be... Isn't it possible that every *additional cycle* (those ones occuring when pagecrossing with a branch-instruction or pagecrossing with an indexed MW-instruction or when a branch-condition is fulfilled) cannot be interrupted? This would explain it at least...
2004-01-04 11:22
MagerValp

Registered: Dec 2001
Posts: 1078
So maybe that's the problem then - you have a 0-1 cycle jitter in your timer stabilization routine, which together with 0-6 cycles of instruction jitter gives you 0-7 cycles jitter in the raster code.
2004-01-04 11:26
Cybernator

Registered: Jun 2002
Posts: 154
I've tested this on CCS and there's 8 cycle variance, too! The type of the CIA has nothing to do with this, because a raster-irq is used. Having the possibilities to freeze the program and check the position of the beam, I've placed a breakpoint at the IRQ. The cycle (Beam-X) was moving in range from $0B - $12.
Ok, let's count them (: $0B, $0C, $0D, $0E, $0F, $10, $11, $12. Something definitely ferments here. :)

And this is definitely the most interesting topic I've even seen.

@MagerValp: Forget my theory. ;-)))
2004-01-04 13:07
Graham
Account closed

Registered: Dec 2002
Posts: 990
whatever i do, i only get 7 variance values, even with that INC Bcc code.
2004-01-05 14:27
WVL

Registered: Mar 2002
Posts: 902
@ Graham :

I tried to send you some e-mail, but your old cruise-adress doesn't work anymore, can you contact me? werner@vanloo.org!
2004-01-06 13:30
Ninja

Registered: Jan 2002
Posts: 411
First, a great new year to all of you who didn't get stuck in those "flame-discussions" ;)

@copyfault: yup, i also get 8 values.

@groepaz: Doc Bacardi once used a method with 2 timers. Well, he's crazy enough :)

@raven: I prefer using a timer because it's faster than double interrupt and I never needed all 4 timers at the same time up to now. But it's a matter of taste, after all...

BTW what is now the "Xbow-Method"? Back then, when GO64! was a magazine, he described at least 6 methods.
2004-01-06 17:56
Cybernator

Registered: Jun 2002
Posts: 154
Having 2 timers makes the stuff slightly easier. One of them is used to generate IRQs, while the other (the auxilary) is used to sync the raster. The auxilary timer follows the main one with a difference of a few cycles. Why would one do this? Simple, when the main timer generates IRQ, it counts-down from the start value (62). The auxilary timer will then have values in range from 0-7. So having the value, you do this:

lda #7
sec
sbc $value in auxilary timer
and #7 ; just in case :)
sta delay+1
lda #0

delay: beq <doesn't matter where :)>

lda #$a9
lda #$a9
lda #$a9
lda #$a9
bit $ea

- Neat, eh? :)
2004-01-07 07:52
Hoogo

Registered: Jun 2002
Posts: 105
Another very simple way I remember: You place 8 Sprites on the screen, each 8 Pixel to the right, overlapping. Then you watch the collision-register with lda, beq *-3. You find the jitter in the number of set bits. Not elegant, but very easy to do.
2004-01-07 11:17
Ninja

Registered: Jan 2002
Posts: 411
@Cybernator: But why would one use a timer just to generate IRQs when you can use Raster-IRQs instead? Well, I can think of some special cases but in general the Raster-IRQ will do fine, no?
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 - 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
kbs/Pht/Lxt
rambo/Therapy/ Resou..
algorithm
Impetigo/Crescent
Krill/Plush
𝘁𝗡𝗚/FairLight
MWR/Visdom
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 Diskmag Editors
1 Magic  (9.8)
2 hedning  (9.6)
3 Jazzcat  (9.5)
4 Elwix  (9.1)
5 Remix  (9.1)

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