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.

 
... 20 posts hidden. Click here to view all posts....
 
2011-07-18 19:29
Oswald

Registered: Apr 2002
Posts: 5094
that means there should be 4 cycles free for a d018 write on a badline + 8 sprites. Maybe I was doing something wrong :)
2011-07-18 20:25
ready.

Registered: Feb 2003
Posts: 441
wow, a full bunch of replies! Thanx.
Actually I experienced exaclty what Oswald said:

Quoting name
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!


just adding one more NOP after the IRQ stabilizing code (double IRQ method) would either get rid or mantain the flickering. And the flickering flickers between correct sprite data and wrong sprite data, so it is the $d018 which seems to be "locked" if written at the wrong moment.

Since I was getting stable results by just adding 1 NOP after the stabilizing code, I thought about adding or not adding that NOP depending on the need (thus on the vertical position of the scroll). In fact the NOP sometimes is good, sometimes is bad. Adding a lookup table for the NOPs to add might do the trick.

Still I didn't quite get the RMW trick, any coding reference for it? Any demo using it? I will give it a try anyhow.

2011-07-18 20:55
algorithm

Registered: May 2002
Posts: 705
It should not flicker if the irq is stable. you may need to change the timing in the stable irq routine. dynamically adjusting when the raster IRQ takes place would require adjustments to the stable routine depending on the line/whether it matches with the same line as sprites etc. once solid, If one nop is too less and two nops is too much have you tried removing a nop and including something such as a bit $ea (3 cycles)?
2011-07-18 21:00
Skate

Registered: Jul 2003
Posts: 494
I had a similar problem using 4 sprites + sideborders. I still don't know what to do at the 168th line. 168th line is the killer for me. It comes from sprite height (21*8). even if you start from a badline (setting everything earlier), at the 168th line relative to your starting point... there you go, a badline which you need to change sprite pointers and open sideborders at the same time. tadaa.... :) Maybe answer to your question also solves my problem. I know there is a dirty trick for that but couldn't figure out myself. Since I don't examine other coders' demo codes, I was helpless. :)
2011-07-18 21:03
algorithm

Registered: May 2002
Posts: 705
@Skate: Could you not use the partial sprite method so that the sprites below have part of the bottom few data (same as the data at the bottom of the current sprites) this way you can change sprite pointers earlier rather than at a badline?
2011-07-18 21:16
algorithm

Registered: May 2002
Posts: 705
@ready. I should read properly. hehe. I had a similar issue with the multiplexer (the interference sprite underlay) in Algodancer 2 in regards to what oswald had mentioned. $d018 was either too early or too late. This was padded with i believe an inc/dec or something similar along the lines which latched $d018 to the correct area.
2011-07-19 06:24
ready.

Registered: Feb 2003
Posts: 441
@Algorithm: I could also use the trick you suggested to Skate of partial sprites, but then I'd have almost no RAM left for the VIC, since I have to double the sprites and I want to use some chars/bitmap too (@Mr.SID first post).

The sprite multiplexer is quite feasible with $d018 if you want it static, all you have to make sure is that you don't change $d018 on badlines.

I have to think more about how to solve this issue.
2011-07-19 06:33
JackAsser

Registered: Jun 2002
Posts: 2014
@Ready: For a sprite upscroller the extremly simple solution is not to pack the sprites back 2 back, nobody will notice nor care anyway. Have a gap of 2 raster lines or something and get on with it.
2011-07-19 07:17
algorithm

Registered: May 2002
Posts: 705
@ready. You dont need to double the amount of sprites. The duplication would only be around two lines of sprites.
2011-07-19 07:25
ready.

Registered: Feb 2003
Posts: 441
@algorithm: yes if I used a static screen with fixed y-sprite positions, but since sprites are moving up, a bad line can happen at any sprite line.
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
Mibri/ATL^MSL^PRX
MWR/Visdom
Peacemaker/CENSOR/Hi..
Mike
WVL/Xenon
deetsay
icon/The Silents, Sp..
csabanw
Guests online: 117
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 Swappers
1 Derbyshire Ram  (10)
2 Jerry  (9.8)
3 Violator  (9.7)
4 Acidchild  (9.7)
5 Cash  (9.6)

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