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 > Blog: All Border Double DYPP
2022-03-15 13:38
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....
 
2022-03-15 18:47
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.
2022-03-15 20:40
Oswald

Registered: Apr 2002
Posts: 5094
interesting I didnt know about this sprite interleave thingie, only "half" sprites, which wastes much more memory.
2022-03-15 20:42
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.
2022-03-15 21:01
Raistlin

Registered: Mar 2007
Posts: 680
@Oswald: what is the “half sprite” technique? I never heard of this one.:
2022-03-16 10:28
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.
2022-03-16 10:52
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.
2022-03-16 11:44
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.
2022-03-16 11:51
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
2022-03-16 13:24
Krill

Registered: Apr 2002
Posts: 2980
Quoting Oswald
Simply 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 Oswald
whats the difference when we do this every 16 lines ?
More interrupts with no additional advantage.

Quoting Oswald
and what is a logical sprite's position here ?! :D
The raster line in which changed sprite pointers become effective.
2022-03-16 19:28
Oswald

Registered: Apr 2002
Posts: 5094
thanks ! :-)
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 - Next
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
ptoing
Guests online: 62
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 No Listen  (9.6)
3 Party Elk 2  (9.6)
4 Cubic Dream  (9.6)
5 Copper Booze  (9.6)
6 Rainbow Connection  (9.5)
7 Dawnfall V1.1  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Swappers
1 Derbyshire Ram  (10)
2 Jerry  (9.8)
3 Violator  (9.7)
4 Acidchild  (9.7)
5 Cash  (9.6)

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