| |
Hypnosis
Registered: Mar 2015 Posts: 36 |
Cycles to get into IRQ routine
How many cycles does it take from an IRQ trigger to the start of the IRQ routine, assuming the CPU finished the instruction when it triggers? It should be around 6-9 cycles but I'm not sure how many. |
|
... 53 posts hidden. Click here to view all posts.... |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
"Seven cycles are used to "setup things" "
from what I was told, irq is a hacked JSR inside the cpu, probably the +1 cycle is the status reg to stack. |
| |
Copyfault
Registered: Dec 2001 Posts: 478 |
To work around that 1-cycle CIA-irq-trigger-latency between the different CIA revision I always use the combination of raster irq + CIA timer for dejittering.
But I know there are situations in which the double timer method is a must... doesn't Codebase have some example code for CIA type detection including the corresponding code adjustments ready to use? |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
if not, there are plenty such routines in the VICE testrepo :) |
| |
Hypnosis
Registered: Mar 2015 Posts: 36 |
I solved it by treating it as another jitter cycle. |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: I solved it by treating it as another jitter cycle.
My standard approach as well, unless you really really need that one extra cycle in your super optimised raster code. |
| |
Bitbreaker
Registered: Oct 2002 Posts: 508 |
And how can a demo effect profit from all this knowledge? :-D |
| |
lft
Registered: Jul 2007 Posts: 369 |
Typical application: 8-bit sample playback. NMI triggers a routine which must be cycle-exact, and it happens 156 times per frame so every saved cycle matters.
When using distributed jitter correction (different code variants in the 0100-08ff range), you have to take the CIA difference into account. However, you don't necessarily have to detect the CIA version, it can be enough to initialise the timer from within an NMI handler. |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: And how can a demo effect profit from all this knowledge? :-D
They already did... First time I did it was in the vector balls on top of 4x4 fli tunnel in The Wild Bunch f.e. |
| |
Flavioweb
Registered: Nov 2011 Posts: 463 |
Opening sideborder using stable cia based irq... just stop working if running on -wrong- cia... |
| |
Hypnosis
Registered: Mar 2015 Posts: 36 |
In my case it is 8-bit sample playback. I'm doing the memory saving option first with dynamic cycle delay in code. |
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 - Next |