Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in 
CSDb User Forums

Forums > C64 Coding > Sprite sorting for DYSP or alike?
2017-10-02 12:27

Registered: Jul 2004
Posts: 132
Sprite sorting for DYSP or alike?

Arising from the other threads about sorting, i asked myself if one needs a proper sprite sorter for "controlled" effects like a DYSP or a for moving sprites in a circle-manner?

As i have not coded a multiplexer of this kind before up to now, i was puzzled if there was a smarter way round to achieve a proper movement like so?

A hammer-until-things approach from the top of my head could be something like stepping through Y values and then setting up the needed IRQs for that. Or analysing the movement on compiletime and setting up 1..x Tables for the IRQ-D012-Values..

What would you recommend me as a multiplexer n00b to do?
2017-10-02 13:25

Registered: Dec 2001
Posts: 8586
find symmetries. eg a simple sinus can simply be splitted horizontally in a few zones. (circle is the same thing). no need for sorting in such cases :)
2017-10-02 13:31

Registered: Jul 2004
Posts: 132
you mean like for 24 sprites define 3 zones and then put the needed sprites into those zones?

what you mean by "finding symmetries"? doesn't quite ring a bell on how or what was this helps for the ordering?

am i thinking too complicated (again)?
2017-10-02 13:42

Registered: Dec 2001
Posts: 8586
if you put N objects evenly on a circle, and then cut the circle in half horizontally, each half contains exactly N/2 objects. that makes having 16 sprites on a circle trivial and obvious :) and you can repeat the process on the halves (not really symmetric now, ok). the same can be done on sinus-movements (and a lot of other things).
2017-10-02 13:46

Registered: Jul 2007
Posts: 355
Consider a simple sinus Y-movement. At any given time, half of the sprites will be moving upwards, and half of them will be moving downwards. Place the first half in sprites 0-3 and the second half in sprites 4-7. Now you can just apply a round-robin schedule to each half.

Did you mean something like that, groepaz?
2017-10-02 13:48

Registered: Jul 2007
Posts: 355
You beat me to it. =)
2017-10-02 15:00

Registered: Jul 2004
Posts: 132
@LFT: as far as i understand it, that implies to have the full sinus on screen all the time?

meaning if one doesn't have the full data on screen, one can't take full effect on similarities and such.

so if i understand it correctly you would all analyze the movement in beforehand/on compile time?
2017-10-02 15:05

Registered: Dec 2001
Posts: 8586
you just look at the full period, it doesnt really matter if all of it is visible all the time - the logic behind it stays the same.
2017-10-03 14:44

Registered: Feb 2009
Posts: 209
If the length of your y movement table is a multiple of the number of objects, say 32 objects and 128 values in the movement table, then the y values used by those objects will repeat every 4 frames. Just create 4 separate multiplexing code blocks, then alternate between them. No sorting needed, and you will always know in each code block how many cycles will be used by sprites on each line throughout the screen.
2017-10-03 14:48

Registered: Dec 2001
Posts: 8586
yeah, dividing whatever your effect does into "animation frames" is another thing that helps a lot
2017-10-03 14:55

Registered: Jan 2005
Posts: 344
That's what I usually did. Split the movement into 'frames', so for example after 8 updates you reset the Y-positions to their 'frame 0' state and move sprite pointers.

For sideborder stuff involving graphics on screen with badlines, I'd usually write separate routines for each frame.

Absolutely no need to sort anything, but the y-movement is fixed.
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
Users Online
Heavy Stylus/RGCD
Guests online: 43
Top Demos
1 Uncensored  (9.7)
2 Edge of Disgrace  (9.7)
3 Coma Light 13  (9.6)
4 Comaland 100%  (9.6)
5 The Shores of Reflec..  (9.6)
6 Wonderland XII  (9.6)
7 Lunatico  (9.6)
8 We Come in Peace  (9.5)
9 Incoherent Nightmare  (9.5)
10 Wonderland XIII  (9.5)
Top onefile Demos
1 FMX Music Demo  (9.6)
2 Daah, Those Acid Pil..  (9.5)
3 Pandemoniac Part 2 o..  (9.5)
4 Treu Love [reu]  (9.5)
5 Merry Xmas 2017  (9.4)
6 Arok 20 Invitation  (9.4)
7 Dawnfall V1.1  (9.4)
8 In Memoriam BHF  (9.4)
9 Dawnfall  (9.4)
10 Synthesis  (9.4)
Top Groups
1 Oxyron  (9.4)
2 Booze Design  (9.4)
3 Censor Design  (9.4)
4 Finnish Gold  (9.4)
5 Crest  (9.3)
Top Organizers
1 Burglar  (9.9)
2 Sixx  (9.9)
3 Irata  (9.8)
4 Wotnau  (9.7)
5 MWS  (9.7)

Home - Disclaimer
Copyright © No Name 2001-2018
Page generated in: 0.059 sec.