Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user Harvey ! (Registered 2024-11-25) You are not logged in - nap
CSDb User Forums


Forums > C64 Productions > Sprites over rasterbars: where?
2012-04-27 13:06
Flavioweb

Registered: Nov 2011
Posts: 463
Sprites over rasterbars: where?

Someone can tell me a demo/intro name where are sprites movin' over rasterbars?
Or, at least, sprites without movement over rasterbars?
Tnx.
2012-04-27 13:27
Skate

Registered: Jul 2003
Posts: 494
There are many. I leave others to give you examples. But i will try to give you the main idea about sprites with rasterbars.

First of all, you need to think of just one rasterline (or scanline if you prefer). You need to calculate timings for that line alone. If sprites are moving among Y axis, things gets much harder because of it. Each rasterline will have different timings. But of course there are smart workarounds.

I think most popular trick is using $d017 stretch. All lines will have the same amount of sprites enabled and Y coordinates will be the same and fixed. At each line, all you do is $d017 trick. Instead of stretching all sprite lines, you just stretch the first sprite line which you should leave blank. That way you have 20 pixel high sprites instead of 21 but you will have stable timing. If inner screen is open, you need to take care of DMA lines of course. That's how it is done.

Another way is to use more than one timing routine for a few different Y coordinate changes (think about a DYSP). But after a few different frames, you go back to first timing routine and swap sprite pointers just like smooth scrolling routines (like changing $d016 a few times and sliding characters etc.). This method is harder but you are free to use all 21 lines.

Basicly these two methods have adventages/disadvantages

$d017 stretch method:
+ You are allowed to change sprite Y positions (using $d017 stretch of course) freely with any sinus tables, even variating ones.
+ If you like, you can stretch other than blank sprite lines without any extra effort.
- You are not allowed to use the full sprite area but at least one line shorter.
- $d017 trick steals a few more cycles each line.

different timing tables method:
+ You are allowed to use all 21 sprite lines
+ You have more free cycles each line
- Y changes must be well planned and hard to change once it is done. (if you don't make/use a code generator tool for it)
- You can't stretch the sprites using that method.

I hope you were looking for the techniques. I thought it's better this way than examining the codes. If you just needed the demo names, you can forget about my answer. :)
2012-04-27 13:34
Mixer

Registered: Apr 2008
Posts: 447
Just had to post this:

Mixer

+ so many others.
2012-04-27 14:09
DeeKay

Registered: Nov 2002
Posts: 363
If you don't mind that in Badlines your rasterbars are 2 pixels high and may jitter a bit on the very left, I found this cheapass Timing-table-less Rasterbar routine quite useful, which is totally independent from any sprites:

LDY #$00
LDA $Rasterbar-Table,Y
TAX
LDA $D012
CMP $D012
BNE -6
STX $d020
STX $d021
INY
BNE start+2

...forgive any errors, i cannot test right now and I haven't coded in quite a while! Also, IANAC! ;-)
2012-04-27 14:27
Skate

Registered: Jul 2003
Posts: 494
@Deekay: I didn't try the code but i guess $d012 comparison part is wrong.

lda $d012
cmp $d012
beq *-3

makes more sense to me.
2012-04-27 14:40
chatGPZ

Registered: Dec 2001
Posts: 11360
"If you don't mind that in Badlines your rasterbars are 2 pixels high and may jitter a bit on the very left"
few people are coding NTSC intros today....
2012-04-27 16:37
Peiselulli

Registered: Oct 2006
Posts: 81
Maybe look into Jars's Revenge ingame code ... there are no rasterbars, but the border is disabled (which is more time critical) with moving sprites ...
2012-04-27 17:38
Wile Coyote
Account closed

Registered: Mar 2004
Posts: 646
Pimplesqueezer 3

This was one of the first demos I got to see, and it blew my socks off. There's a great part with swinging (into side-border) sprites over rasters + grey RAWHEAD sprites moving over the same rasters. The part in question still impresses the hell out of me. The whole demo is gold.
2012-04-27 18:24
Flavioweb

Registered: Nov 2011
Posts: 463
Quoting Skate
There are many. I leave others to give you examples. But i will try to give you the main idea about sprites with rasterbars.


I hope you were looking for the techniques. I thought it's better this way than examining the codes. If you just needed the demo names, you can forget about my answer. :)


Yes, i want to know "how things works".
I don't start this thread into "coding" section, because i don't know how many people want to share his knowledge, but if someone want to help me into learning how to do sprites moving over rasterbars... any help is welcome...

Maybe some moderator will change thread section =)
2012-04-28 00:10
Codey

Registered: Oct 2005
Posts: 79
also if you use fld for your timing, your rasters will be perfect and can have sprites moving over them iirc. the only drawback is no char mode..
2012-04-28 04:02
Flavioweb

Registered: Nov 2011
Posts: 463
Quoting Peiselulli
Maybe look into Jars's Revenge ingame code ... there are no rasterbars, but the border is disabled (which is more time critical) with moving sprites ...


At a first look, seems that is used a stable irq (inverted timer) with code for every line unrolled, and jitter is compensated "on the fly" when -cycles- goes on new raster line...
I'm on right path?
 
... 7 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
celticdesign/G★P/M..
Alakran_64
bugjam
grip
Mike
EALL/HT
KEF
Scooby/G★P/Light
kbs/Pht/Lxt
psych
Jammer
Guests online: 114
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Mojo  (9.6)
6 The Demo Coder  (9.6)
7 What Is The Matrix 2  (9.6)
8 Uncensored  (9.6)
9 Wonderland XIV  (9.6)
10 Comaland 100%  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Party Elk 2  (9.6)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.6)
5 Libertongo  (9.5)
6 Rainbow Connection  (9.5)
7 Onscreen 5k  (9.5)
8 Morph  (9.5)
9 Dawnfall V1.1  (9.5)
10 It's More Fun to Com..  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Nostalgia  (9.3)
5 Triad  (9.2)
Top Crackers
1 Mr. Z  (9.9)
2 Antitrack  (9.8)
3 OTD  (9.8)
4 Fungus  (9.8)
5 S!R  (9.8)

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