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....
 
2003-12-30 14:45
Copyfault

Registered: Dec 2001
Posts: 478
Quote: it is a stable delay, so either you have it or you don't. so on one machine you will only get 7 different delays. maybe there's some other delay playing in? i can assure you that with a max 7 cycles opcode you will have max 7 cycles irq delay.

You mean max 7 different delay values, don't you? May I send you my source_code, or even worse: should I post it here *pleasedontforceme* ;)? I checked the prog again yesterday and get 8 different values!

Thanks for all the comments and the patience you guys, espescially Graham, had up to now. Hopefully the question can someday be answered to my full content (though most probably it won't reveal anything tremendous I think ;))!
2003-12-31 02:18
Copyfault

Registered: Dec 2001
Posts: 478
So, just came back from our bunker! I tested my rout again on different systems and always ended up with 8 different values. I think this has something todo with the branch-instructions. Try the following (also "easy";)) main prog:

MAIN
INC $adr,X
BPL MAIN
BMI MAIN

I also tried to get 9 different variance-values when using an 8-cycle-Illegal-Op instead of the INC $adr,x , but unfortunatly this did not give me any coherent values.

Please try the rout above and tell me what variance values you get-I deeply hope there will be 8 different ones, too!

Another question related to this topic: how can I distinguish between Delaying- and Nondelaying-CIA's?
2003-12-31 20:53
raven
Account closed

Registered: Jan 2002
Posts: 137
This may be a stupid question, but why even use
timers for getting stable raster?
There are easier & more elegant ways of doing it, like
the double-irq (my favourite) which is well documented
in C=Hacking & there's also CrossBow's way which works great as well.

So why timers? leave them free for better things ;)
2004-01-01 19:15
Cybernator

Registered: Jun 2002
Posts: 154
@Copyfault: There're two different CIAs: 6526 (old) and 6526A (new). (I guess there're also 85xx versions). The old CIA makes additional delay of one cycle when an IRQ occurs. I don't know in which case, though. This is what I read at comp.sys.cbm, and in my case they always worked the same way.

@Raven: What is Xbow's way of stable-raster?
2004-01-02 00:44
White Flame

Registered: Sep 2002
Posts: 136
Okay, this might be an incredibly dumb response, but if the delay can be 0-7 cycles, then it can be one of eight (count 'em: 0,1,2,3,4,5,6,7) different variances in the delay.
2004-01-02 02:09
chatGPZ

Registered: Dec 2001
Posts: 11386
mmmh yeah i'd be interisted about "xbows method" too :)
afaik there are generally 4 ways... 1) dividing and busy waiting (bad, needs several rasterlines to sync) 2) double irq (prolly the way of choice for general use) 3) lightpen register fiddling (also bad, since it fucks up when pressing space) and last not least 4) double timers (might look more tricky than double irq, but has some neat properties and needs even less time to sync). the latter seems to be a little bit underestimated on c64 (on some other systems its the only way for stable raster)....hcl seems to like it however :o)
2004-01-02 02:30
chatGPZ

Registered: Dec 2001
Posts: 11386
mmmh forgot... anyone tried to come up with a (preferably simple and reliable) way to detect if the cia delays one additional cycle or not then? :)
2004-01-02 08:08
Graham
Account closed

Registered: Dec 2002
Posts: 990
groepaz: there's a 5th way to achieve a stable irq, you can use a badline to correct the timing. this will mess up a few colors but in some cases this might be a good way to do.

and a 6th way: using sprites and well placed instruction you can have self-correcting timing. the earliest stable irqs accidently used that, for example in the old sideborder demos by 1001 crew.
2004-01-02 17:34
Copyfault

Registered: Dec 2001
Posts: 478
Oops-I'm sorry, maybe I should have been more precise when I started this topic! I don't use double timers but a raster IRQ for the main interrupt and *one* timer to sync! Maybe there is another delay when combinig it that way???

Now about those "old" delaying CIA's: does this additional cycle only occur when triggering a timer IRQ, or do I get different timer values on entering an IRQ *in general*??? This would confuse me...

Did someone test this INC-BPL-BMI-loop? Like to know if I'm totally wrong with my assumption or not...
2004-01-02 18:43
chatGPZ

Registered: Dec 2001
Posts: 11386
mmmmh...i remember the sprite thingy (never thought about using it for stable raster though...peacey used it for scrolling fli gfx around :=P) but could you explain what you mean by the "use a badline" thing?
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
Holy Moses/Role
The Syndrom/TIA/Pret..
Andy/AEG
CA$H/TRiAD
Microshark/Damage(HUN)
Mihai
The Phantom
rikib80
Freeze/Blazon
Guests online: 102
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.049 sec.