| |
Raistlin
Registered: Mar 2007 Posts: 680 |
Blog: All Border Double DYPP
So.. a few people had asked me about how I created certain effects.. I love blogging about code (I do this for my game-dev work, for example, and have done on-and-off for 10 years)... so...
https://c64demo.com/?p=19
The website needs a LOT of work, I know .. but for now it gives me a sandbed to upload these texts to.
Please let me know if you spot any mistakes, if you think I've overlooked explaining anything important, if you think I'm stupid and missed some obvious optimisation, etc...
Cheers! |
|
... 51 posts hidden. Click here to view all posts.... |
| |
Quiss
Registered: Nov 2016 Posts: 43 |
That was a good read! I hadn't realized this effect was so memory-constrained.
Your ASM tooling is interesting. (I wonder what a more generic, register-aware version of such a "code interleaver" would look like.)
OT: How do you like Wordpress? I still haven't found a good blogging solution. It seems the more heavy C64 bloggers (Pagetable, LFT) have just rolled their own thing. |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
interesting I didnt know about this sprite interleave thingie, only "half" sprites, which wastes much more memory. |
| |
Wile Coyote Account closed
Registered: Mar 2004 Posts: 646 |
Interesting read. Admittedly a large % went over my head.
'This is 624px tall – so, packing 9 lines per 256 byte block, that’s 17,920 bytes of memory.. and then the same again for the 2nd frame of our DYPP, coming to 35,840 bytes. BAD. Basically, we can’t fit it.'
'But herein lies the next trick .. we now look for how many of our 27-byte rows are identical. Our C++ code handles this for us too of course.'
That part made much sense. |
| |
Raistlin
Registered: Mar 2007 Posts: 680 |
@Oswald: what is the “half sprite” technique? I never heard of this one.: |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
Quote: @Oswald: what is the “half sprite” technique? I never heard of this one.:
lets say you have 2 sprites, lets split each in half,
sprite1:
a
b
sprite2:
c
d
A and C representing top part of the sprites, B and C the bottom.
lets make a 3rd sprite shape that looks like:
c
b
this works as an inbetween sprite shape when changing sprite pointers. so I can change to "cb" 3rd sprite shape in the bottom half of "ab" sprite, and anywhere at the top half of "cd" sprite I can change to its final "cd" shape without any visible bugs. Usagi Yojimbo is said to be using this for plexing. |
| |
Raistlin
Registered: Mar 2007 Posts: 680 |
Ahh, yeah, I guess that’s the same as the 20px interleave method I wrote about for Codebase64 - but needing less tight timing than 20px .. 20px interleave could also be 19px, 18px, whatever … it just comes down to how much overlap you like - the more overlap, the less precise and fast you need to be to update the sprite indices. |
| |
Krill
Registered: Apr 2002 Posts: 2980 |
First known instance to use sprite interleaving is Maniac Mansion, i believe, with a logical sprite height of 20 lines.
Not quite sure, but i think they need to switch sprite pointers in exact raster lines (no double patterns), but do that every 20 (not 21) lines.
The logical sprites can only be positioned on every other line, though. Sprite-Y mod 2 = 0, Badline-Y mod 2 = 1 (or vice versa), neatly avoiding the badlines when switching. |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
I'm confused about this interleave thing tho. Here is how I think about it: Simply change sprite pointers every 20 lines, and arrange sprite gfx so, that it looks fine on the screen, right ?
whats the difference when we do this every 16 lines ? and what is a logical sprite's position here ?! :D |
| |
Krill
Registered: Apr 2002 Posts: 2980 |
Quoting OswaldSimply change sprite pointers every 20 lines, and arrange sprite gfx so, that it looks fine on the screen, right ? Yes, and make sure that badlines never appear in the lines where you change sprite pointers.
Quoting Oswaldwhats the difference when we do this every 16 lines ? More interrupts with no additional advantage.
Quoting Oswaldand what is a logical sprite's position here ?! :D The raster line in which changed sprite pointers become effective. |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
thanks ! :-) |
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 - Next |