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 > bad lines how many cycles
2007-11-24 18:44
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

2007-11-24 19:45
Oswald

Registered: Apr 2002
Posts: 5027
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.
2007-11-24 19:47
chatGPZ

Registered: Dec 2001
Posts: 11145
sprites steal 2 cycles, plus 1 for initial setup :)
2007-11-24 20:11
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...



2007-11-24 20:19
Oswald

Registered: Apr 2002
Posts: 5027
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.
2007-11-24 20:23
Oswald

Registered: Apr 2002
Posts: 5027
another topic we havent touched is the bus takeover mechanism of the VIC which can steal up to 3 cycles from the cpu..
2007-11-24 20:24
chatGPZ

Registered: Dec 2001
Posts: 11145
that doesnt work accuratly, since the actual cpu cycles which are left also depend on the type of instruction(s) used in that line :)
2007-11-24 20:26
Testa
Account closed

Registered: Oct 2004
Posts: 197
thanks man... things get clear now... very cool!!
2007-11-24 20:26
Oswald

Registered: Apr 2002
Posts: 5027
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 ;)
2007-11-24 20:37
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.....

2007-11-24 20:43
chatGPZ

Registered: Dec 2001
Posts: 11145
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
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
Yogibear/Protovision
hedning/G★P
Avalanche/Atlantis
Mr SQL
eryngi
Devia/Ancients
El Jefe/Slackers^sidD
Guests online: 77
Top Demos
1 Next Level  (9.8)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.7)
5 Edge of Disgrace  (9.6)
6 Comaland 100%  (9.6)
7 Uncensored  (9.6)
8 No Bounds  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 Layers  (9.7)
2 It's More Fun to Com..  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Rainbow Connection  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Booze Design  (9.3)
3 Censor Design  (9.3)
4 Crest  (9.3)
5 Performers  (9.3)
Top Diskmag Editors
1 Jazzcat  (9.4)
2 Magic  (9.4)
3 hedning  (9.2)
4 Elwix  (9.1)
5 A Life in Hell  (9.1)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.073 sec.