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 > full screen sprite mux scroller
2011-07-18 14:43
ready.

Registered: Feb 2003
Posts: 441
full screen sprite mux scroller

hello all,
I am coding an upscroller but I'd like to put it in upper and lower border, thus I am using sprites for displaying text, just like +2K end part.

I got the main code to work: I have a stable irq (1-cycle jitter), I move up by one raster line all raster IRQs when I want to move up the text/sprites and that works. I use the $d018 trick to change sprite pointer and that works.

But I am having trouble with bad lines, which still cause flickering when I change $d018 during one of them.

How could I have the $d018 write happen when I want? I tried to move the IRQ entry point earlier in the position of a bad line, but that does not help: then $d018 changes too early and sprites are displayed wrong.

I cheked the +2K code but I could not get out with it.

thanx for help,
Ready.

2011-07-18 14:52
Mr. SID

Registered: Jan 2003
Posts: 424
Do you need the bad lines, i.e. is there gfx behind the scroll?
2011-07-18 16:49
algorithm

Registered: May 2002
Posts: 705
Are you certain that the jitter is removed when you decrease or increase the raster? Maybe at a specific position the jitter occurs.? Try a dec Inc d020.
2011-07-18 18:12
Oswald

Registered: Apr 2002
Posts: 5094
I once made a stable IRQ for this and on badlines with the d018 "trick" I was always either too late or too early, when just changing the timing by 1 cycle!

I guess the solution is to use the RMW trick, in short: using inc/dec d018 at the right horizontal "position" will recover 1-2 cycles back for you from the VIC!

if you make a calculation there's hardly any cycle for the cpu on badline+8 sprites.

GFX data needs 40 bytes read by the VIC
character pointers (badline) = another 40
Sprite pointer 8 bytes
Sprite data 24 bytes

-> 112 bytes to read. VIC runs on 2 mhz thus it has 126 cycles on a line. 126-112=14 -> 7 cpu cycles free. What eats up those 7 cycles is an answer up to someone more qualified than me.
2011-07-18 18:47
algorithm

Registered: May 2002
Posts: 705
Ready mentioned flickering hence why it may seem that when the raster interrupt is starting at a specific area of the screen (in combination of sprites) this may be causing the issue)
2011-07-18 18:51
Oswald

Registered: Apr 2002
Posts: 5094
I might be wrong, but as I said I have done a stable irq, and on a badline+8sprites I couldnt get it right. So if my code was correct 1 cycles jitter will be not enough, and he'll need to use the RMW trick (inc/dec), which recovers a few cycles from the VIC.
2011-07-18 18:57
Wile Coyote
Account closed

Registered: Mar 2004
Posts: 646
(with wishing to hijack this thread in anyway)

On the subject of full screen height scrollers, during:

GFX-Col.1 [logos]
GFX-Col.1 [Logos]

WHW Design attempted (at my request ;) a scroller that scrolls down the screen rather than up the screen. Is scrolling down more difficult than scrolling up, as the scroll is slow, something WHW admits to.
2011-07-18 19:06
algorithm

Registered: May 2002
Posts: 705
It can very well be that the RMW method is required, although i was under the assumption that changing the raster position of an interrupt can interfere somewhat with the stable IRQ timing if the stable IRQ routine is based on the raster position. Ofcourse if this is not the case, then try the RMW method.
2011-07-18 19:08
Mr. SID

Registered: Jan 2003
Posts: 424
Quoting Oswald
GFX data needs 40 bytes read by the VIC
character pointers (badline) = another 40
Sprite pointer 8 bytes
Sprite data 24 bytes

-> 112 bytes to read. VIC runs on 2 mhz thus it has 126 cycles on a line. 126-112=14 -> 7 cpu cycles free. What eats up those 7 cycles is an answer up to someone more qualified than me.


The rest of the cycles are used by the CPU. The VIC only takes over the bus during the non-border part of the screen (where it needs to read the screen data) and when it needs to read a sprite but gives the bus back to the CPU when it doesn't need it. But during most of those cycles the CPU can't read anything, because the VIC has already requested the bus again, so the CPU can only finish the current opcode and store a result.
2011-07-18 19:14
Oswald

Registered: Apr 2002
Posts: 5094
Quote: Quoting Oswald
GFX data needs 40 bytes read by the VIC
character pointers (badline) = another 40
Sprite pointer 8 bytes
Sprite data 24 bytes

-> 112 bytes to read. VIC runs on 2 mhz thus it has 126 cycles on a line. 126-112=14 -> 7 cpu cycles free. What eats up those 7 cycles is an answer up to someone more qualified than me.


The rest of the cycles are used by the CPU. The VIC only takes over the bus during the non-border part of the screen (where it needs to read the screen data) and when it needs to read a sprite but gives the bus back to the CPU when it doesn't need it. But during most of those cycles the CPU can't read anything, because the VIC has already requested the bus again, so the CPU can only finish the current opcode and store a result.


sounds correct, questin is how many cycles b4 the vic really needs the bus does this special state happen
2011-07-18 19:20
Mr. SID

Registered: Jan 2003
Posts: 424
The bus takeover takes three cycles, during which the CPU just finishes the current instruction and will halt on the first read (the one that would fetch the next opcode).
 
... 20 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 | 3 - 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
MWR/Visdom
deetsay
WVL/Xenon
grennouille
rime/Fancy Rats
Mike
Peacemaker/CENSOR/Hi..
Mibri/ATL^MSL^PRX
icon/The Silents, Sp..
csabanw
Guests online: 115
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 Censor Design  (9.3)
5 Triad  (9.3)
Top Graphicians
1 Mirage  (9.8)
2 Archmage  (9.7)
3 Pal  (9.6)
4 Carrion  (9.6)
5 Sulevi  (9.6)

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