| |
Bastet
Registered: Jul 2005 Posts: 88 |
Sprite multiplexing, when is it save to edit the values?
I have a little question to the pros here, when is it save to edit the sprite data so that the first one dosnt get corrupted?
Do i have to wait the full 21 lines of the sprite or can i savely edit it somewhere in betwhen there? |
|
... 20 posts hidden. Click here to view all posts.... |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
you can switch pointers for 6 sprites easily on a non badline, so all you have to take care of to avoid those. No tricks needed.
Hollow :P |
| |
Cruzer
Registered: Dec 2001 Posts: 1048 |
Quote:you can switch pointers for 6 sprites easily on a non badline
Not if they move vertically. |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
/me wrote a sprite multiplexer the last two days :) |
| |
ready.
Registered: Feb 2003 Posts: 441 |
Yeah, I remeber having the bad line problem while coding Aurora (2D plot part). For sprite multiplexing I used the $d018 trick, but I had to be careful not to switch $d018 during a bad line. To fix that I moved the screen downwards a few pixels. |
| |
johncl
Registered: Aug 2007 Posts: 37 |
Quote: Actually this doesn't have to take that much more memory, at least not double up. E.g. if you just need a flexibility of say 3 lines to change the sprite pointer, you only need to waste about 3 lines of gfx for each 18 lines, i.e. use 1/6th more memory.
Here's how I would do it... The first sprite is displayed normally on line 1-18. Then you need to change the pointer on line 19, 20 or 21. For these lines the new sprite image should double the line 19+20+21 of the old one. Then the new sprite image is displayed normally for its line 1-15, and after that the pointer needs to be changed on line 16/17/18. For these lines the new sprite image again has to double the gfx, and after this the displaying continues normally for line 19,20,21, and then cycles to 1,2,3...12. And so on, until the final sprite, which needs to end with 3 empty lines, where you have time to switch to an empty sprite image.
Ah excellent idea this one. I am trying to multiplex all 8 sprites tightly under each other to create a 192x126 image and soon realised that there simply isnt enough time to change all those pointers on one scanline before it reaches the start of the new set of relocated sprites.
There should be more than enough time to do the swap (to a buffer) of those bottom 3 lines of all 8 sprites inbetween.
- Copying the real data of the next set of sprites to a buffer
- Move the bottom of the currently rendering set to the next set and then
- When the next set has started drawing, copy the buffer data back to the bottom of these sprites
A very smart algorithm indeed and would solve my hi-res sprite overlay challenge. |
Previous - 1 | 2 | 3 - Next |