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 > Timing with y-moving sprites
2006-08-17 10:14
Mantiz
Account closed

Registered: Apr 2006
Posts: 36
Timing with y-moving sprites

Hi,
I have been trying to figure this thing out for a while.
What I have now is a stable raster routine so opening the sideborders is for example no problems at all.

What I wonder is how you can have sprites moving in the Y direction over these lines and still keep the timing, because it will change depending on which and how many sprites there are crossing it. No need to take care of badlines is required in this example.

Do I need to use NMI interrupts or is there another way, for example do a calculation somewhere else on the screen how many sprites there will be on a certain line and from that set up an appropriate delay for every line in the sideborder/raster/whatever routine you need to be stable with a changing amount of sprites over it? I've been trying the later approach but my code gets rather messy.

 
... 15 posts hidden. Click here to view all posts....
 
2006-08-18 16:03
Oswald

Registered: Apr 2002
Posts: 5094
lol, funny to see that every coding question results in a who can do it better debate :)
2006-08-18 16:55
Graham
Account closed

Registered: Dec 2002
Posts: 990
The whole demo scene is a "who is better" debate.
2006-08-18 16:58
chatGPZ

Registered: Dec 2001
Posts: 11386
other than the cracking scene ofcourse :=D
2006-08-18 17:41
Jetboy

Registered: Jul 2006
Posts: 337
Quote: other than the cracking scene ofcourse :=D

O'realy? :D
2006-08-18 22:20
Mantiz
Account closed

Registered: Apr 2006
Posts: 36
Thank you people, I am using the routine HCL described and it works good. I had a little bit of trouble finding out how to get the cia to start counting on the beginning of the rasterline but I added some nops etc to time it to start at the right place.

I have a question regarding the method that Groepaz suggested, I know that you can stretch/unstretch sprites on every rasterline, but how can you stretch them even more than that? Is the idea that you place a transparent sprite on the uppermost line where your sprites will be located, stretch it down until you reach the place where your real sprite should be displayed, unstretch, change the sprite pointer, display it and change sprite pointer again to the transparent and stretch it for the remaining number of lines? Isn't it going to need an awful long stretch if you are going to have an effect on a very large portion of the screen.

And while talking about stretching, if using the timing method that I currently have, there isn't enough time to change the sprite y-stretch on the lines where the borders are open, because the lda $a9 needs to be there. Is this correct? I guess it could be done if the loop is unrolled, because you can get rid of the dex and bpl. Gotta try that out :)

Cheers!
2006-08-19 02:40
Stryyker

Registered: Dec 2001
Posts: 468
What you can do is have the first sprite line empty. You can stretch one sprite the whole screen if you wish. You stretch the blank line until you come to where you want it then turn off the stretch. It means eachraster line needs code to keep stretching (or not stretch).

With changing sprite pointers you can make 1 sprite have the detail equivalent of multiple sprites layered in the Y direction.

Say you stretch each sprite line 5 times you get 165 lines for the same sprite, like:

sprite line: sprite pointer:
0:0
0:1
0:2
0:3
0:4
1:0
1:1
1:2
1:3
1:4
2:0
etc.

So line 0 is shown for 5 consecative lines but by changing the sprite pointer it shows new data. Also on the last line of the 5 line stretch you don't stretch so the VIC internal counters move on to the next line. By being creative with how it is used you can do many things once impossible.
2006-08-19 06:44
Jetboy

Registered: Jul 2006
Posts: 337
You may wonder how can you change multiple sprites this way - each would need pointer change each line - so it seems too cycle consuming. There is solution to that - switch character screen memory location each line - this way sprite pointes change for all 8 sprites at once (they are stored at the end of character screen memory - so they change with character memory change). This however is only good if you dont require asynchronic streches, coz this method fails there.

And i guess unroling the loop is the way to go.
2006-08-19 10:41
chatGPZ

Registered: Dec 2001
Posts: 11386
when i coded this (looooong ago .=D) i just used d017, with a blank first line in each sprite like jackasser explained. then you just need one register write each line which modifies all 8 sprites. (and the table for d017 changes can be calculated outside the rastercode).
2006-08-19 13:21
Quetzal

Registered: Jul 2002
Posts: 71
I've done DYSP at various times using either NMI interrupts or a method very similiar to the one HCL outlined above. The NMI versions were more trouble than it was worth and had some rather bizarre bugs, but that's more than likely due to my inability to code in a way that any normal person would do it than anything else.

Incidently, I once made an intro for PARALAX that had DYSP capability built in for the sideborder scroller, but never got around to actually installing the extra code to move each sprite individually in Y. So the scroll just bounced up and down as a whole. Talk about a wasted effort!
2006-08-19 19:04
Mantiz
Account closed

Registered: Apr 2006
Posts: 36
I simply can't thank you guys enough for your help on this subject. Finally understanding how things are done means a lot for me. I guess for seasoned coders, this stuff is child's play. It'll be a while before I know enough to be able to contribute with my knowledge, but I hope you like beer in case our roads will cross someday... :-)

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
tlr
Epyx/TSA
Mythus/Delysid
Quetzal/Chrome
t0m3000/hf^boom!^ibx
Guests online: 116
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 X-Mas Demo 2024  (9.5)
7 Dawnfall V1.1  (9.5)
8 Rainbow Connection  (9.5)
9 Onscreen 5k  (9.5)
10 Morph  (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 Webmasters
1 Slaygon  (9.6)
2 Perff  (9.6)
3 Sabbi  (9.5)
4 Morpheus  (9.4)
5 CreaMD  (9.1)

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