512 Bytes Ought To Be Enough For Dinosaurs

It’s said that slow internet is worse than no internet at all, which is mainly a matter of continuously crushing all hope and sanity vs. finding peace in accepting a fate out of your control. Plus, you can easily pass the time of being catapulted back to the prehistoric ages by navigating a jumpy little creature from that same age through a field of cacti — at least if you’re using Chrome or Chromium. But neither a browser nor actually an operating system are really necessary for that, as [franeklubi] shows with a boot sector implementation of the same game.

Sure, the graphics aren’t quite on par, but compared to the original’s 3000+ lines of JavaScript, [franeklubi] managed to implement it in a few hundred lines of assembly, and was of course constrained by the 512 bytes of the boot sector itself (well, 510 plus the signature). This constraint causes a few limitations, like a slight lack of randomness in the obstacle arrangements, and a constant running speed, but it also makes it the perfect playground and starting point to delve into the world of nifty knacks and hacks, trying to squeeze every last byte.

If you want to give it a try for yourself, all you need is NASM and QEMU — and while you’re at it, why not have some Tetris along the way? We could also see this nicely combined with the real-world jumping version from a few weeks back, and turn it into a standalone arcade game. Bounce Crouch Revolution anyone?

9 thoughts on “512 Bytes Ought To Be Enough For Dinosaurs

  1. “a standalone arcade game. Bounce Crouch Revolution anyone?”

    I have a very vague recollection of something like that, plugged as a 3D version of pitfall, where you had to jump and crouch logs and stuff. The graphics were vector and jerky. I think the player sensors were kind of laggy, the graphics looked 10 years out of date at the time, and it took up 4x the floor area of a regular cabinet, which is probably why it wasn’t a success.

  2. Was just ruminating on the idea that if you backported a load of these bootblock and sub 1k games to 8080/Z80 code and gave them block graphics, you could about double the software catalog of ye olde ZX-81

    Also kinda inspiring to think of porting some to ATTiny 85s or something, make a handheld for the next square inch contest.

    1. Incredible: most of my comment got deleted!

      Basically, I was saying that an ATTINY25 should be able to do it. 160 pixels across at 4cycles per pixel at 20MHz gives 32us. That’s doable. Composite video should take <1Kb; then the game at 2Kb total. A 160 pixel scan is 20 bytes. So, 48 bytes for sprite data (index to flash sprite and x,y) gives 16 sprites onscreen. Still leaves about 60 bytes free of RAM.

        1. Sorry, what I meant was that where it says in my last but one comment: “Composite video on an ATTINY should take so, another 16 sprites might take 64b => 84b total.”

          In fact I had several sentences between “so” and “another”, but they disappeared when I submitted it. Maybe I somehow accidentally selected text and hit delete. Seems unlikely. Possibly it didn’t like me using the actual micro-symbol-seconds instead of us.

          I have some experience of writing video drivers for AVR’s, in particular, I developed the open-source DIY Forth computer FIGnition a while back, which supports text, user-defined graphic characters and bitmapped video (using external SPI Ram); for both PAL and NTSC.

          https://sites.google.com/site/libby8dev/fignition

  3. “It’s said that slow internet is worse than no internet at all, ”

    Which is just sad.

    I’m ok with the fact that I can’t expect to watch Netflix via dialup. Just being able to search the internet for a subject and read plain text about it is a very powerful think compared to having no internet at all. There is no technical reason this should not be possible on almost any kind of connection. But it’s not because almost everything on the internet is weighed down with far too much visual fluff.

    Don’t get me wrong. I understand why one would want to make their stuff pretty. I have no problem with that. It’s the fact that web designers no longer bother to make their stuff fail gracefully that is the problem. With images, javascript and maybe even css all turned off one should still get text. A site could still look just the same on a fast connection with a modern browser yet work at a basic level on something slow. Just bring back the lynx test.

Leave a Reply to RW ver 0.0.1Cancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.