NINE (Seemingly Impossible C64 Demo)
ฝัง
- เผยแพร่เมื่อ 8 ก.พ. 2025
- Released at Fjälldata 2025. This demo is probably more interesting the more you know about the inner workings of the C64. But hopefully it's fun to watch for everyone!
Best viewed in 50 Hz.
A follow-up video is in the making.
Support my work:
/ linusakesson
steadyhq.com/l...
You can find the C64 executable file here: linusakesson.n...
Besides the technical achievements to have more than 8 sprites in a line on the top… The magician’s choreography to the music was really cute and funny
Or the achievement of faking having more sprites by drawing multiple numbers into a regular number of sprites :)
@@kke But I see 9 different ones at the same time?
Plus the music itself is great, and also perfectly synchronized to the action on the screeen.
@ Yes because the numbers are rendered on multi-color sprites as sprite content. That's why it goes narrow when they're in-line in the top, there's a row of sprites side by side and the numbers are rendered on the sprites. There's a regular raster interrupt based sprite multiplexer when they are rotating around in the lower area, that's nothing special, just can't have more than eight per raster line.
So there actually isn't more than 8 sprites on the same raster line at any time. It's a magic trick.
I got this randomly recommended to me and reading the comments I feel like I stumbled into a convention about a topic I know nothing about
I think the c64 only ever supported 8 sprites at once, and this somehow does 9 functional sprites
I really recommend watching tons of Commodore 64 demo scene videos. Those are technically very impressive to watch even if you don't know anything about making them (like me). My favourite is Future Crew - Second Reality that was a very technically impressive PC demo in 1993 - that Smash Desing later remixed as C64 demo that was even more impressive because it was running on C64. 😅
It's a long story but the gist of it is, the C64 can only display 8 sprites at a time but programmers are treating that phrase like a lawyer and stretching the phrase "at a time" as much as possible. Basically moving the sprites as soon as they are drawn to the TV screen but before the frame is finished rendering
Good, welcome to Fjälldata next year :D
It's worse than you think.
The video is designed to show 9 sprites in a pattern such that a smart C64 programmer can guess how its done. And then he changes the pattern precisely to disprove your theory. So you develop a new theory, so he changes it again to disprove that one. It's really mean. And glorious.
I got absolutely obsessed over this demo: "9 sprites? Not impressed. Wait, on the same horizontal line? HOW? WHAT THE SHIT ON THE BORDER TOO? HOW? WHY?" I am absolutely marveled that people are still discovering clever new tricks for the VIC-II. The C-64 just keeps on giving, nonstop. As for the demo itself, it clearly shows that you can keep it [seemingly] simple and minimal and still make a compelling production. Also music is 10/10. Congrats, excellent job. Looking forward to the followup video!
It's not one trick, but multiple ones. It starts out as a standard multiplexer. When the ring flattens, it transitions seamlessly to using a soft sprite via the character set, in the middle section above the wizard (the outer curved portions are fully sprites). When it goes up into the top border, it transitions to a different sprite path that squeezes them together on the "back" of the ring, which is done using two x-expanded sprites to cover the area of three unexpanded sprites, with some overlap to appear unexpanded. These steps then go in reverse to put the sprites back in the hat.
Very well done, the key to the illusion is the transitions between sections. Making those seamless seals the deal.
Appreciate this breakdown. Magic is sometimes better with an explanation.
It doesn't look to me like there are any expanded spirites. All of them are hires.
@@vapourmile that's the overlap that I'm talking about
@
What "overlap"? I don't get. You're claiming there are two expanded sprites, right? If you look at the 45 degree diagonal edges of the character outlines you can see all of those sprites look unexpanded. They look like that when they are in the border where there aren't any graphics features you can use to make the edges look sharper.
@@vapourmile That's the magic. I looked at it in a debugger, it's 100% using expanded sprites along with hires sprites to paper in the gaps. There's also a lot of tricks done to maintain the "screen vs border" distinction even when that is not technically the case (such as when the border opens yet you still see a "normal" screen area, which cannot happen normally)
The "Floss" dance at 2:30 - this is so much more advanced than I expected
Perhaps 8 animation frames!
@@mirabilisnope. Just 3. They're flipped.
@z.a.k.e.n.3901 Yes. I meant the number of frames before it repeats. Sorry.
I give this demo a solid 9 out of 9.
9 out of 8.
Cirno approves...
9th sprite aside, the coolest thing about this demo, in contrast to a lot of other C64 demos out there, is the consistent and coherent flow in terms of storytelling that doesn't overstretch in duration, in other words - this one has great form from start to finish!
What about sprite priorities? There's something else going on there. Maybe it looks harder than it is.
@@KC9UDX It's an engine that converts the desired position and other attributes, stored in a table, multiplexing on each scanline (reusing the leftmost sprite as the rightmost sprite when necessary, though sometimes it might not even be necessary if one of the sprites is entirely hidden on a given scanline)
@ if you look at it, they're changing in a way that shouldn't be possible. Or at least that's the way it looks.
I enjoy this demo it’s cute and unique. But I don’t watch this type of thing for efficiency’s sake so I also like longer and more complicated ones too.
@@FadkinsDiet I don't see how it would be possible to re-use a sprite on a single scan-line, as the sprite DMA is done once per scaline by VICii, unless I'm missing something?
Unbelievable demo and the music is so inspiring. The time signature change from 5/4 to 3/8 at 1:10 when the 9 comes out of the hat is brilliant!!!
Maybe it was 9/8
@@gabrielsroka Of course it is! A nice detail indeed!
This music! Metric modulation from 5/8 to 3/8 when all numberes have appeared, how cool is that! Someone should show this to Adam Neely! (EDIT: Modulation to 9/8, to be precise, which of course makes perfect sense!)
This is brilliant, the magician character is so well made and the timing/choreography to the music is enjoyable. And what a great tune! Top work.
Yeah, tune is very catchy. I know nothing about the C64 but I've been listening to this one on repeat.
Even when I know nothing about the C64, I love the demoscene in general. I love how they are able to do seemingly impossible things with computer systems, overcoming all kinds of technical limitations and seemingly do the impossible. My favorite scene demo's are Elevated (4k) and 8088 Domination.
That music is incredible! Bravo!!! 💪
The explanation of the working is pretty simple: Magic is not affected by technical limitations.
Magnificient short demo, you made the most of the limited time and the 9…
…when the music blooms and opens up at the 2 min mark I get chills down my spine and Lunatic feelings ❤
@0:47 .. huh.. cute ..
@1:00 .. okay, cool, looks neat, but this is pretty straightforward.
@1:47 .. 🤔
@2:02 .. 😲
Good work good sir :-) Looking forward to the follow-up.
Very nicely presented too.. love the magician dude..
Hahah yeah, I was like "Well this is fine as long as there's not more than 8 sprites sharing the scan line... hey wait what are they doing... where are they going..."
This was me right here
Love the petscii art, the magician has so much character. Loved how he peeked out to make sure the numbers had moved. Good choreography with the music too.
Keep coming back to this, it's just super nifty and sympathetic, the music and animation just works really well with the main effect.
A middling knowledge of the C64 with no real low-level banging background was enough to catch some of the fun stuff. Didn't remember it being a particularly big deal to have "text" and sprites on the side borders at the same time. But did expect that "okay since this is supposed to be something new, they're probably gonna put all the numbers on the same horizontal axis". Didn't really remember how impossible that was supposed to be again (though I did consider the likely actual method of that part), but at least I got a "ha!" moment when exactly that happened.
And then the coup de grâce, of course. I did, I did try to see if the background sprite resolution had mysteriously lowered, being covered up by the smushed together numbers moving fast, but no. The buggers just move around there all high-res like like it's a normal Tuesday.
I had heard of the since spoiled likely method but man, I did not expect that, this is well and truly synced up. Bravo.
I know very little about coding, and even less about the C64. That said, having seen how Jon Burton did his various tricks in Traveller's Tales games on the channel GameHut, and how Shimakura Ichiro and Tim Follin put complex soundtracks on the Gameboy and the NES respectively, I have some ideas about the interweaving techniques and multilayered effects necessary to pull something like this off, and the technical mastery required to do it well.
Kudos~! Very entertaining.
Agreed, Jon Burton indeed has done some wonders in his games! Coding Secrets is also his channel too if anyone is wondering and looking around the comments.
Imagine releasing this back then. Coolest demo ever with a dance people don't recognize and the mystery of the 9 sprite illusion
I love this kind of demo where your eyes believe it but your brain doesn’t. The presentation is super cute too
The illusion is great, but the presentation overall is just superb!
Besides being technically impressive, this is so .... S M O O T H. Fun to watch, Top soundtrack, congrats Lft!
I don't know anything about programming on the C64, but this just makes me feel good. And the music is awesome too! It's pretty amazing what you can do with magic. ;)
I think anyone who programmed to limited devices can appreciate that. Like being told that the C64 has a hard limit of 8 sprites, even being familiar with just DOS and a bit of NES technicals, I'm aware once the 9th sprite arrives, there's going to be a constant effort to make it render without significant bugs or glitches, the real deal is being told that several tricks were used and they managed to switch between them seamlessly
Yes, the music! Something sounding like 5/4 then the transition into triplets then everything up to the end ... great 🙂
Awesome! Would love a whole album with your increadible sounds. Love it
th-cam.com/video/74d_Ter3HcU/w-d-xo.html
It's a bit simpler sounds because of the limitations of the size.
I have no idea what is going on but I’ve watched it multiple times, so fun! Amazing music
The C64 has 8 sprites. To show them in the outer border is difficult/some trick. To show more than 9 vertically/below each other is possible using Rasterinterrupts. To show more than 9 horizontally side-by-side is not possible/never been done. Enjoy =)
@@Nightshft42 Honestly, even though it's mostly over my head (I'm not an engineer and have zero coding experience) if they keep making videos with bangers like that in the background, I will keep coming back. Thank you for the explainer! Subscribed 😍
So happy that I watched all the way through. Besides real good (multiple) techniques for the spites, the choreography and how the demo actually "cleans up" is so fantastic.
I can't get enough of this song, I keep listening to it again and again! I wish it were just a bit longer. I also finally figured out what the start of this song reminds me of! It reminds me of the song Uprising by Magic Sword (though really they sound a lot different, but something about the notes seems vaguely similar to me).
I remember coding on the C64 back in the days, using raster interrupts to have as many sprites you wanted and removing borders. Timing was the difficult part, to stay in sync with the raster beam when doing other stuff. Fun times. Nice and cute demo :-)!
Yep, but remember, you could never put more than 8 sprites so they were crossed by the same raster line. It probably could be done with very precise timing, but drawing the sprites also influences timing, so it could have gotten very complicated in the end.
I think the most amazing thing is the seamless changes between sections. Like if you know what a C64 sprite multiplexer is, but then it just.... becomes something else.
Nice, nice.
Yet nobody tried to guess how it's done?
So I will. Ok, we know: There is a maximum of 8 sprites per line. You can multiplex that vertically. In the side border, only sprites can be displayed. In the upper/lower border, sprites and the ghost byte can be displayed. Sprites itself can be Hires (with one color) or Multicolor (with 3 colors, but reduced resolution). In all modes, sprites can be expanded.
We have in this demo something like a sprite multiplexer. And we have open borders with sprites. Yet pretty common.
It gets interesting with all 9 sprites in the same vertical area. So one of these must be charset/Hires graphics.
It gets very interesting with all 9 sprites in the upper border. Interestingly, the 9 sprites get much closer together. So my best guess is, the sprites are switched to a multicolor block, and to make it look like Hires, the ghost byte is used.
Edit: I made a lengthish reply to myself with some more thoughts. I'm not convinced anylonger, the ghost byte has an important role in this demo. That was a quick shot earlier today. Still, commonly the ghost byte is used to pretend hires graphics in upper/lower border, but not in this scenario.
@TheFerdi265 spotted, for the part in the upper border, the background sprites are at an equal vertical position and move equally (and don't overlap). So I expand my guess: The background are four multicolor, probably expanded sprites used as a graphics block for five numbers, the ghost byte is used to make it look hires, and in the foreground four hires sprites are moving the remaining four numbers. This would make calculations a lot easier.
The ghost mask injects black, which seems challenging at sprite overlaps. I might be more tempted to select one sprite of suitably simple contours, like the 1, and beam race it using border color, perhaps assisted by ghost byte masks. Maybe it must be done to a rear sprite, and the core trick is bursting ghost byte values. Just rough ideas though, I have not tried. Last time I did sprite multiplexing I used hundreds of them on the Nintendo DS, but that used a grid, so had no shortage of slots.
It can't be multicolor - every number has fine details that only work in hires
@@StefanReich That I think is the trick. The x position for the multicolour (possibly x expanded) sprite is not the same on each raster line, making it look hires. On each line two numbers must be a single multicolour sprite... but it doesn't have to the same sprite on each line, and the x position doesn't have to be constant.
So "all" (ahem) you need to do is for each line identify two numbers whose pixels can be replaced by a multicolour (expanded or not). Possibly that explains why the font chosen for the 7 sprite looks a bit unusual.
FWIW - I don't think the $ff ghost character is involved as it's too hard to control the graphics displayed in realtime. Also, when the numbers are not in the border area, the ninth number probably isn't even a sprite
@davidlloyd1526 Oooh... yes you might be on to something. That requires a lot of manipulation in each raster line but maybe it's possible.
And yes, in the non-border area, you can simply draw the 9th sprite into some custom chars.
Really really nice demo! Music, build up and technic
This is absolutely amazing! The music is INCREDIBLE!
What a great piece of ingenuity. And the music matches excellently. Well done!
Whenever you upload a video, there’s always something unexpected and exciting to look forward to. Much appreciated. This was awesome and I look forward to the technical explanation.
If you're timing CPU cycles on the horizontal blank you are insane, well done, you are not mortal
I did it as I wanted to master the last challenge: C64 COED BAKERY sprite border scroller
Now I've seen the trick with the double-wide triple numbers. Also impressive, but still mortal.
@ The hardest part is if you have bad lines and also a random number of sprites on the line when you try to time it down to that one specific single cycle, that FLT just turned off the screen (no bad lines) and used sprites for everything in that part.
From an old C64 grunt this was spot on. The intro sequence was chilling.
Awesome. You never disappoint!
Great demo , I give you 9/8 points! :D - it is rather interesting to see what the hardware is capable of once we understand it properly :)
And it only took forty years. Who knew, folks would still be coding for this machine today...
@@KimMothNot only that, but still teaching the old dog some new tricks that haven't been seen before! That definitely takes some talent
Fantastic music, the signature transition is incredible, and as always, you know how to write good melodies !
I don't know what this video is about, but the music absolutely slaps.
Whoa! That little dude is one powerful magician!
Ohhhhh yes, this sort of magic is a big reason why I'm such a fan of the C64 demoscene right now. I just love a good bit of C64 sneakiness! I'm just a little sad that I missed the part of the Fjälldata 2025 Twitch stream where this demo was premiered live; I'll bet a lot of the people in that room made some surprised noises at the 2-minute mark!
I congratulate you in the way that the basic design is actually a way to fool us to think that it is possible to have 9 sprites on one rasterline. When in reality is any of this what we think it is borders, sprites and PET ASCII graphics. A masterpiece in timing and illusion.
Awesome! And I want to highlight the music! It not just perfectly in sync with the magic, but it's.... It's just awesome too! I just rewinded it a hundred times just to listen to it in the background!
If you didn’t know this a C64 demo, you’d think it was a Sesame Street skit teaching about the number nine.
Great job though.
Nice timing work, especially with the sprites in the side borders!
In the border we appear to have a mix of 6 standard and 2 multicolor sprites and background color changed along the line on the fly. Within the normal area we appear to have sprites with offset character graphics. Pretty neat. I'm sure we're going to hear a better more complete explanation soon.
How? I saw somebody else said there are expanded sprites. Where? All of them look hires.
@@vapourmile You can see in the debugger there are two multicolor sprites in the border whose content varies dynamically (typically 3 numbers per 2 sprites), the rest of the sprites are normal. This also limits the maximum distance you can have between the numbers in the border, because you can only fit so much distance in these multicolor sprites. Expansion makes multicolor sprites match the highres width, but not the resolution.
It looks like the high resolution would be accomplished by changing the background color manually in the middle of the scanline just timed accurately and there's ghost byte playing a role as well. I'm not entirely sure of the details, but at least the general idea can be seen in the debugger.
Not one trick but a whole set of them, seamlessly combined with flawless execution. Beautiful. Shoutout to the music as well, great stuff.
It looks great, but it sounds even better. That music is fantastic.
the little floss made me chuckle, this is very beautiful overall.
Looking forward to an explainatory video! As a commenter pointed out it is a mix of tricks I am eager to see the details of the illusion with the x widened sprite.
I'm just at 47 seconds but i have to say :
With this title you tickled my curiosity, and with this music... you now completely have all my attention
Love it! Again, you deliver more quality. Thank you.
Haha, this is awesome. Really got me thinking :^D
Excellent presentation, love the music too!
Loved it! The music was epic, too!!
Instead of crazy swirling colors and animation it has a story. Finally one demo in the past 30 years made sense to me.
Everything flows together beautifully.
My current best guess, after another night, talking about when all 9 numbers go to the upper border: 5 freely floating numbers in the foreground, each in their own sprite (5 sprites used). 4 numbers in the background, moving at the same speed, static distance and same y-position (12 chars wide), 3 x-expanded (each 6 chars wide) multicolor (3 colors) sprites are used for these. Each sprite covers 2 numbers, partly overlapping. The 3rd color in each sprite is the same as the background color and therefore to cover up areas onto the 2 other sprites (ofcourse, only 1 sprite can cover another, not 2 each other). With a different x-position by 1 pixel each line for each sprite and covering parts by another sprite, an illusion of higher resolution can be created.
Of course, moving of the background numbers is done by moving that multicolor sprite block as a whole, and jumping back left, when the most right number becomes free floating. At this point, the content of the multicolor-background-sprite block will be switched for the new number added at the left.
Gotta go now for my boring office job. Thanks for this trip back to my life in early 90ies!
Can't wait for the follow up video, what a bop!
I don't know much about this kind of sorcery, but the design and music is stellar! ❤
Banging tunes! Well done
> Nine numbers float out of the hat and circle.
Okay, sure, I know about reusing sprites by updating ram during the HBLANK based on scanline, that's all right.
> All nine float up over his head.
Oh, dang, wait, are all those on the same scanline? Nah, the way it's waving like that, gotta be it just looks like they're all in one line, but if you pause it, there'll always be a line that separates the highest and lowest. Right? ...doesn't LOOK like it, but I could be wrong.
> The ring tightens and goes fully horizontal
...Okay, no, I'm out of ideas. I don't know enough about C64 hacking to guess how this is done. The bits I do know, to the best of my knowledge, can't fill the gaps and make this work.
My brain went through the exact same process, sir. I cried a little.
BRAVO!! Nicely done. More, please.
That's beautifully done!
Love it :) Awesome work! Long live C64 :)
Amazing work as always, lft! Cheers from the Necta! -- MyO^Nectarine
EDIT: Oh, and he just *had* to do the floss to flex on everyone! Hah!
Wonderful demo, amazing music too, thank you very much
A great tune too! Loved it :)
Man... The music is just as amazing as the demo ❤
What a lovely little demo! Great petscii magician !
The c64 scene has never ended.
Thankyou all you sceners !
Amazing!
Impressive, funny, and charming! Great little tune as well
Very nice! Looking very much forward to the sequel 'Ten'! :p
My jaw dropped at around the 2 minute mark, awesome job.
Indeed
This was amazing!!
The tune is bangin'!
Snyggt jobbat, som vanligt 😄
I'm no expert in any way, but I know there's only eight hw sprites so some amount of trickery is involved. Anyway, to me it's very nice to watch, and also listen to. The music is perfect for the demo :) Thanks!
As you expected - I was ok they are going in a circle - that's easy! - but of course soon they were dancing around on the same line swapping priority. _applause_ Very nice. I will have to think abou it...
It has to be chars right, what else could it be? Then they are all in the border.. but I have seen 9 "sprites" in the border (8 hardware and 1 made of chars) but that was static and never moved if I remember correctly, very tight timing to achieve...
A true magic trick!
@@tog2842 chars ? I thought you could only show 1 char in the border ( whats in $3FFF )
@@tog2842 The only things you can put in the upper or lower border are sprites or the ghostbyte
@@riwilo yeah, but this was manipulated to be a sprite like image in a demo, its pretty famous just can't think of the name
@ I know that with some trickery it is possible to show 9 sprites on the same raster line, but I was in the assumption this was only possible each alternating raster line.
Fantastic, bravo 👏
Did I just get flossed at by a little black magician spinning nine numbers above his head?
Imagine releasing this back in the day. Which is a Tuesday, for all you time travelers
It was known you could have more than 8 sprites. It was mentioned in the Programmer's Reference Manual.
@@sa3270 LOL no it's not.
@DarkoBednjanec Commodore 64 Programmer's Reference Manual, published by Commodore Business Machines, Inc. and Howard W. Sams & Co., Inc., First Edition, Third Printing--1983.
Page 151: "This powerful interrupt feature lets you use split screen modes. For instance you can have half of the screen bit mapped, half text, more than 8 sprites at a time, etc. The secret is to use interrupts properly."
@@DarkoBednjanec Maybe your country's version of the manual didn't mention it.
I am in love with the music.
Hi :3
1:One sprite is just bitmap grafx, but it then could not be in the upper border, so no.
2: Rapidly change the junk char in open border to look like a sprite, not impossible if you preload a,x,y in each line.
3: The sprites don't move they are redrawn as a bitmap in a 192x21 area when in the border,
but they don't look like they are chunky multi-color, but junk char could be in front to smooth out the edges to hide that.
I have no C64 knowledge, but have done things with limited graphics hardware. My guess for parts of this:
starting at 2:00, the sprites in the back of the circle moving right actually look like a text scroller: They are the same vertical height and only move horizontally, at the same speed. This makes me think that in that part of the demo there are actually only like 5 sprites used for the left-moving numbers, and the rest is a text scroller using some trick to draw in the border, using the remaining 3 sprites to make it look a little bit nicer or as multiplexing "buffer"
You cannot have text or any other graphics then sprites and the infamous ghost byte in the upper/lower border. But you spotted very well equal height and movement of the background numbers. I've extended therefore my own guess how it works.
@DasistkeinHotel ok, so there is some other trickery going on. Let's see when he releases the follow-up.
My guess is that the scroller-y nature of the right-moving numbers is significant
I see lft, I click thumbs up - amazing yet again!
This is awesome, C64 will live on forever…
Amazing! love the music...
awwww!!! so kewl !!! excelent music, smol, cute, the petscii art alone is awesome! LOVE IT!!! 😍❤
I see what you did with the time signature the moment the 9 appeared.
good work! :D
Absolutely brilliant :)
I don't remember this episode of Sesame Street
Love it! ❤
Randomly popped up on my front page and was not disappointed
Nice!
reminds me of old school compunet demos where they used sine tables a lot. i like the design
Interesting. Very nice celtic tune btw.
Nice, for all the obvious reasons, but I'd also like to say I appreciated the backpack kid dance in there. :D