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 > Trig raster irq with sprites enabled.
2012-04-30 10:42
Flavioweb

Registered: Nov 2011
Posts: 463
Trig raster irq with sprites enabled.

This is the scenario:
- stable irq by raster polling + inverted cia timer
- sprites 3 to 7 enabled moving on y axis
- first value read from dc04 is $30
- irp triggered on no badline

i can stabilize irq correctly, without sprites, using a table of values 0-7 starting from offset $30 going backwards in table and reading these values accordingly with dc04 to set bpl branch offset.

I thougth that to compensate also sprites delay, i need to rebuild table considering also cycles fetched at line start by sprites data.
I calculated 3 cycles of BA setup + 2x4 cycles for sprite data = 11 cycles.
Rebuilt table with values $12 - 00, of course starting at offset $30 and added relative cmp #$c9 to adjust bpl targets with new values.

Still have perfect stable raster, but first opcode cycles after stabilization is executed forward or backward even spriter are on trigger line or not.

How can i do to correctly compensate cycles stoled by sprites?
What i'm missing?
 
... 10 posts hidden. Click here to view all posts....
 
2014-09-18 07:34
lft

Registered: Jul 2007
Posts: 369
Don't know if you considered this already, but if the IRQ happens while the CPU is stalled (due to sprite fetch right at the rasterline switchover, can't remember if it's sprite 2 or 3 causing it), then the total latency is one cycle less than what you'd otherwise expect. It seems the 6510 performs the first step of IRQ processing (probably synchronising the signal) even though it is stalled.
2014-09-18 19:58
Flavioweb

Registered: Nov 2011
Posts: 463
Lft... interesting.
I suppose that the use of the word "halted", while the processor waits for the vic leave the bus free, don't mean really "stopped", but more likely, "waiting".
If "some strange" happens while CPU "wait", maybe -internally- something can be done.
Accordingly with
http://wiki.nesdev.com/w/index.php/CPU_interrupts
(IRQ and NMI tick-by-tick execution)
"1 PC R fetch opcode (and discard it - $00 (BRK) is forced into the opcode register instead)"
could be that "no real memory access" is done but, instead, some kind of "virtual bus access" that in fact it does not happen and "force" $00 into the opcode register.
At the same time the vic accessing the bus.
If my theory is correct, however, this should happen for every IRQ that happens during a badline/sprite fetch...
Previous - 1 | 2 - 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
DJ Gruby/TRiAD
Guests online: 96
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 Triad  (9.3)
5 Censor Design  (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.033 sec.