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: 705
@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: 5094
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: 5094
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: 902
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: 424
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: 902
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
Chesser/Blazon
Bieno/Commodore Plus
Nordischsound/Hokuto..
Ymgve
HOL2001/Quantum
Dymo/G★P
Brush/Elysium
Guests online: 91
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 Triad  (9.3)
5 Censor Design  (9.3)
Top Fullscreen Graphicians
1 Joe  (9.7)
2 Sulevi  (9.6)
3 The Sarge  (9.6)
4 Veto  (9.6)
5 Facet  (9.6)

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