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

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

Registered: Jul 2004
Posts: 131
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 15:25

Registered: Dec 2001
Posts: 8471
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 15:31

Registered: Jul 2004
Posts: 131
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 15:42

Registered: Dec 2001
Posts: 8471
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 15:46

Registered: Jul 2007
Posts: 352
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 15:48

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

Registered: Jul 2004
Posts: 131
@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 17:05

Registered: Dec 2001
Posts: 8471
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 16:44

Registered: Feb 2009
Posts: 205
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 16:48

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

Registered: Jan 2005
Posts: 312
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
Guests online: 18
Top Demos
1 Uncensored  (9.7)
2 Edge of Disgrace  (9.7)
3 Coma Light 13  (9.6)
4 The Shores of Reflec..  (9.6)
5 Comaland 100%  (9.6)
6 We Come in Peace  (9.6)
7 Lunatico  (9.6)
8 Incoherent Nightmare  (9.5)
9 Wonderland XII  (9.5)
10 Wonderland XIII  (9.5)
Top onefile Demos
1 Dawnfall V1.1  (9.5)
2 Synthesis  (9.5)
3 FMX Music Demo  (9.5)
4 Pandemoniac Part 2 o..  (9.5)
5 Daah, Those Acid Pil..  (9.5)
6 Treu Love [reu]  (9.5)
7 Merry Xmas 2017  (9.4)
8 Dawnfall  (9.4)
9 Gubbdata 2017 Invite  (9.3)
10 SidRok  (9.3)
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 Diskmag Editors
1 Jazzcat  (9.6)
2 Newscopy  (9.4)
3 Peter  (9.3)
4 A Life in Hell  (9.2)
5 Elwix  (9.1)

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