| |
Testa Account closed
Registered: Oct 2004 Posts: 197 |
bad lines how many cycles
how many cycles on a bad line
when i do for example a routine to open the sideborders i do:
delay 44 cycles + 4 sprites = 52 cycles
stx $d016 good line
sta $d016,x
stx $d016 bad line
sta $d016
at the bad line there are 8 cycles used by stx $d016 sta $d016, 1 cycle by the x index at the good line and 8 cycles for the 4 sprites. . this means 17 cycles are used
but when i make fli grafix witch use a bad line each line by making the 3 lower bits of $d012 and $d011 equal
i count 23 cycles..
lda tabel1,x 4
sta $d011 8
lda tabel2,x 12
sta $d018 16
bit $ea 19
nop 21
inx 23 cycles
etc
why are 17 cycles used in the example of the borderroutine and 23 cycles in the example of the fli grafix..
i am coding for several years now and i still dont get this
what do i miss here... (i hope no braincells ... hehe)
greetings from mcd
|
|
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
63-40=23 without sprites. 40 extra cycles are needed for the VIC on bad lines to read the characer pointer data.
sprites do steal cycles aswell, thats why you get less where they're used. they steal 1-2 cycle as VIC runs effectively at 2Mhz when reading sprite data,thus it can read 3 bytes for one line of sprite in less than 2 1 mhz cycles. using consecutive sprites will steal less cycles, as the CPU needs some time to stop and give the bus over to the VIC. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
sprites steal 2 cycles, plus 1 for initial setup :) |
| |
Testa Account closed
Registered: Oct 2004 Posts: 197 |
thanks for your reply but i still dont get where the missing 6 cycles in the example of the borderroutine are.
stx $d016
sta $d016 = 8 cycles
sta $d016,x = steals 1 cycle
4 sprites = 8 cycles
40 cycles for reading char data
= 57 cycles and not 63 cycles...
|
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
4 sprites <> 8 cycles. if you can do a stable raster you can measure how many cycles they steal exactly with a cleverly positioned inc/dec d021. then put/remove 4 sprites on top if it and measure. |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
another topic we havent touched is the bus takeover mechanism of the VIC which can steal up to 3 cycles from the cpu.. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
that doesnt work accuratly, since the actual cpu cycles which are left also depend on the type of instruction(s) used in that line :) |
| |
Testa Account closed
Registered: Oct 2004 Posts: 197 |
thanks man... things get clear now... very cool!! |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
delay 44 cycles + 4 sprites = 52 cycles + ~3 bus takeover for charptrs+ 1 bus takeover for sprites + 9 instruction = ~63
groepaz, when removing sideborders u always use the same opcodes
btw, the bus takeover mechanis is the same for sprites iirc, thus it can be up to 3 cycles aswell... lets wait for jackasser to lighten us up ;) |
| |
Testa Account closed
Registered: Oct 2004 Posts: 197 |
why are there in the fli example no bus takeover cycles for char pointers needed... or has that something to do with sprites on that line.... i get it for 99% now...
very interesting matery.....
|
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
Quote:groepaz, when removing sideborders u always use the same opcodes
he uses stx/sta in his example, you want to measure with dec/inc. very different. the "cycles" measured by inc/dec wont apply to a routine using sta/stx at all :) |
... 10 posts hidden. Click here to view all posts.... |
Previous - 1 | 2 - Next |