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 > Sprite sorting for DYSP or alike?
2017-10-02 12:27
Dano

Registered: Jul 2004
Posts: 226
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
chatGPZ

Registered: Dec 2001
Posts: 11108
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
Dano

Registered: Jul 2004
Posts: 226
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
chatGPZ

Registered: Dec 2001
Posts: 11108
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
lft

Registered: Jul 2007
Posts: 369
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
lft

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

Registered: Jul 2004
Posts: 226
@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
chatGPZ

Registered: Dec 2001
Posts: 11108
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
Perplex

Registered: Feb 2009
Posts: 254
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
chatGPZ

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

Registered: Jan 2005
Posts: 631
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
Advanced
Users Online
Mason/Unicess
bepp/ΤRIΛD
Knobby/Role
Guests online: 385
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 The Ghost  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.8)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 Rainbow Connection  (9.5)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Onscreen 5k  (9.5)
8 Wafer Demo  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Swappers
1 Derbyshire Ram  (10)
2 Jerry  (9.8)
3 Violator  (9.8)
4 Acidchild  (9.7)
5 Starlight  (9.6)

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