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-19 07:29
algorithm

Registered: May 2002
Posts: 702
@ready. you can try what jackasser suggested. or if $d018 switching on badline with 8 sprites is an issue, perhaps use 7 sprites and use the $d018 method
2011-07-19 15:19
Oswald

Registered: Apr 2002
Posts: 5022
Quote: @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.

if I were going for this (I was) I'd use 5 pixel high chars, that gives you 2 rasterlines between char rows (3 char rows per sprite each 7 pixel high), and sprites can still be back 2 back. only the sprite pointer changing can be inaccurate.
2011-07-19 17:27
ready.

Registered: Feb 2003
Posts: 441
@Oswald and Jackasser: I might have to face reality and surrender to a compromise. Actually I wanted to implement something that can be "recycled", use it this time for displaying text and maybe in the future a picture or something continuos, unlike char rows. But still leave the possibility to use char displaying behind/over sprites.

I had in mind the Pearl For Pigs big sprite picture moving around the screen (borders included), but there's no char mode behind and I guess (have not checked the code) there's no bad line happening there.

I might try a few more tricks using stable raster before surrendering :)

I'd like to try the $d018 change one the line right before a bad line but after all the sprites on that line have been displayed.
2011-07-19 19:15
Oswald

Registered: Apr 2002
Posts: 5022
you may also want to try to dec/inc d018 as suggested, but make your raster stable first. then try to find the sweet spot :)
2011-07-20 13:27
ready.

Registered: Feb 2003
Posts: 441
ok, I am getting the first decent results.
First I implemetned a 100% stable raster. Used double irq method for first synch in order to start CIA1 timer A at the beginning of a raster line (loaded $dc04 with value #62).
Then my $d012 irq code looks like this:
[/code]
pha


lda $dc04
eor #63
lsr
sta *+4
bpl *+2
.fill 30, $ea
bcc *+2
bit $ea
irq_badline_patch
nop #$ff ;nop #$ff = 2 cycles, op code $80
;nop $ff = 3 cycles, op code $04

nop
bit $ea

irq_d018
lda #00 ;$d018
sta $d018
inc $d021
dec $d021

2011-07-20 13:42
ready.

Registered: Feb 2003
Posts: 441
hello again. I am getting the first good results.
I implemented a stable irq via CIA timer. I used a double irq synching routine to start CIA1 timer A at the beginning of a raster line in the upper border (to avoid bad lines). I loaded $dc04 with #62.

Then my $d012 irq looks like this (unoptimized):
irq
	pha	
	lda $dc04
	eor #63
	lsr
	sta *+4
	bpl *+2
	.fill 30, $ea
	bcc *+2
	bit $ea
irq_badline_patch
	nop #$ff ;nop #$ff = 2 cycles, op code $80
			 ;nop $ff  = 3 cycles, op code $04		
	nop
	bit $ea
irq_d018
	lda #00 
	sta $d018
	inc $d021
	dec $d021
	
	;rest of irq code: set sprite y position, new sprite pointers, badline patch for next irq.......
	


In this way $d018 is set right after the beginning of a raster line.
Bad lines are handled using a lookup table that can add (irq_badline_patch = $04) or not add (irq_badline_patch = $80) 1 cycle delay.
When bad lines cause wrong sprite pointer to display, the corresponding irq has to be anticipated by 1 raster line and eventually patched with irq_badline_patch = $04.
The tuning process is tedious as there are 21 y positions, so 21 frames to tune and for each frame there can be some bad line to fix.
Furthermore, entry irq raster line anticipation and irq_badline_patch can be fine tuned also to solve the conflict with the nmi routine I use for opening the upper/lower border.
I'll get back with results after tuning is done.
So far no need for inc/dec $d018.

Sorry for double posting, can't delete the previous one.
2011-07-21 10:17
WVL

Registered: Mar 2002
Posts: 886
Quoting ready.
I had in mind the Pearl For Pigs big sprite picture moving around the screen (borders included), but there's no char mode behind and I guess (have not checked the code) there's no bad line happening there.

No badlines there :) (if there would be, you can be 100% sure I would have shown that by displaying a nice picture ofcourse! ;))
2011-07-21 11:04
Mr. SID

Registered: Jan 2003
Posts: 421
Maybe this can give you some ideas? It has graphics behind the big sprite head.

Einstein IV
2011-07-22 04:53
ready.

Registered: Feb 2003
Posts: 441
@Mr.SID: yeah I remember that demo, amazing stuff for 1989.

Anyhow, I finally managed to get the scroller right without glitches.
Sooner or later I will put some char stuff behind. Ok, enough for today, gotta rush, as I am becoming father again :)
2011-07-22 10:01
WVL

Registered: Mar 2002
Posts: 886
Good that you got it working!

Btw, you can forget to have 8 sprites, open sideborders and a picture in the background (well, a picture with badlines at least..).

There's no multiplexer in PfP at all btw, the zoomer in the borders only has 7 sprites on the screen...
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
St0rmfr0nt/Quantum
iAN CooG/HVSC
TBH
Board Rider/Commodor..
Paulko64
Guests online: 153
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Wafer Demo  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Nostalgia  (9.3)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Webmasters
1 Slaygon  (9.7)
2 Perff  (9.6)
3 Morpheus  (9.5)
4 Sabbi  (9.5)
5 CreaMD  (9.1)

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