Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The limit on the C64 is, nominally, 8 sprites. Widely known tricks exist to increase that to 8 per raster line, by IIRC repositioning them during horizontal retrace.

This demo actually shows 9 "sprites" on the same raster line using some clever tricks like low-res stretched sprites combined with custom characters. It all makes sense once you know the tricks, but the really impressive thing is how smooth it is. Which I guess is why it features a magician.



The video demonstrates a second common trick: making use of the black frame "outside" the screen buffer. Once the first demos showed it was possible it quickly spread and nearly everyone used it.

It's been a while, but I recall that you had to do some fancy interrupt timing stuff for that. To find where that was in the code, the same procedure applied that we used to find the handler for background in the code of games: search for 0x78 (SEI), which temporarily blocked interrupts so background stuff could be installed ("pseudo-multitasking").

We used to purchase a tape or 5 1/4" floppy disk with a game per month and instead of playing the game, we competed who could remove the music from the game the fastest (so that it could play in the background alone, e.g. while writing code). In the end that was a matter of just seconds for previously unseen machine code using a hex monitor/disassembler. The advantage of such a "teenage sports" is you will never forget that "169 = A9 = load accumulator" and the rest of the MOS 6510 opcode table, even after not using it for 40 years.

I wonder what today's kids will remember? (They seem to have to Google each Python keyword, and they can't do anything if WiFi is down for an hour, which worries me.)


> they can't do anything if WiFi is down for an hour, which worries me.

I worked with a younger guy on a pre-existing, large project written in C. He saw me use the man command and asked why I would do that - was I expecting to be offline? But I don't think of man pages that way, I still think of them as primary documentation. They're also specific to the software versions on the system I'm logged into, unlike whatever comes up when I Google `man 2 unshare`.


You can't change the sprites every rasterline. Sprites are 21 pixels in height in unexpanded mode. So you can only change the sprite after displaying all 21 lines, unless you use sprite-crunching, where the limit is still several lines. Linus has an article on sprite-crunching (mind-blowingly complex).


> Linus has an article on sprite-crunching (mind-blowingly complex).

https://www.linusakesson.net/scene/lunatico/misc.php

Great article.


Indeed :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: