| |
Copyfault
Registered: Dec 2001 Posts: 475 |
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.... |
| |
Stryyker
Registered: Dec 2001 Posts: 468 |
Has there been a decent bit of theory written about using timers for stable raster interrupts? Or did I miss it in C= Hacking? |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
still, here there's only 7 different delays for a main program using that opcode, tested on a C128DCR.
you are using timers? i hope that you know that there are different CIAs in different machines, and some of them have a delay of 1 cycle on IRQs while others have not. |
| |
Copyfault
Registered: Dec 2001 Posts: 475 |
Quote: Has there been a decent bit of theory written about using timers for stable raster interrupts? Or did I miss it in C= Hacking?
Marko Mäkelä wrote an article for c=hacking, issue 10! Basically it deals with stabilizing rasters on a VIC-20, but I think it quite ok to understand the theory. You can find it on his homepage
http://www.hut.fi/Misc/cbm/vic20-demos.html |
| |
Copyfault
Registered: Dec 2001 Posts: 475 |
@Graham: this means one generally has to take 0-7 cycles of variance into consideration in order to avoid troubles on machines with those Delay-Cia's?
When does such a delay-cycle occur? It can't be constant, because this would only lead to (by one cycle) shifted variance values - but in fact we got 8 different ones. |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
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. |
| |
Copyfault
Registered: Dec 2001 Posts: 475 |
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 ;))! |
| |
Copyfault
Registered: Dec 2001 Posts: 475 |
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? |
| |
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 ;)
|
| |
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? |
| |
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. |
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 - Next |