Have you ever wanted to develop a playable game small enough to fit into a disk’s 512 byte boot sector? How about watching somebody develop a program in assembly for nearly two hours? If you answered yes to either of those questions, or ideally both of them, you’re going to love this project from [Queso Fuego].
Whether you just want to check out the public domain source code or watch along as he literally starts from a blank file and codes every line for your viewing pleasure, chances are good that you’ll pick up a trick or two from this project. For example, he explains how all of the “graphics” in the game are done in 80 x 25 text mode simply by setting the background color of character cells without printing any text to them.
We really like the presentation in the video after the break, which was recorded over the course of multiple days, judging by the changing light levels in the background. As he types out each line of code, he explains what its function is and gives any background information necessary to explain how it will fit into the larger program. If you’ve ever wondered if you had what it takes to program in ASM, watching this video is a great way to decide.
[Queso Fuego] mentions that this project, and his research into this sort of low-level programming, came about due to the social distancing boredom that many of us are feeling. While we’re certainly not advocating for him to kept locked in his home permanently, with projects like this, you’ve got to admit it seems like a win for the rest of us.
[Thanks to Joe for the tip.]
Did he 3D model/track his face for the first 46 minutes?
I had a lot of fun writing from scratch a game that fits into an ATtiny10. The whole firmware, including TWI and OLED drivers is about 780 bytes.
It’s been a great experience that brought my understanding of how the MCUs work to a new level. Many details here: http://www.bitbanging.space/posts/videogame-for-attiny10
I like this! Trying to get the maximum out of a space- and power-restreined (??) µC is real fun. Using a big RaPi or STM32 to blink an LED everybody can do it.
Nitpick: On your article about USBASP-update there is an error: “Arduino as IPS” should be “as ISP” i assume?
Glad you liked it. You are right: the point in using an ATtiny10 is to be forced to look for alternative and creative solutions for common problems. Also, using assembly for the first time meant I spent a lot of time with pen and paper solving puzzles to make it work.
Thanks for the heads-up on the typo.
Demo Scene 2020
This is really awesome. I used a bit-banged OLED library for fast I2C to implement a fun little Mario-type game with two OLED screens and an ATtiny85 and I thought that was a challenge to squeeze everything in… I see now I was spoilt! Your assembly + ATtiny10 is another level though, wow!
FYI:
https://shepherdingelectrons.blogspot.com/2020/01/tinymario.html
https://shepherdingelectrons.blogspot.com/2020/03/attiny-mario-handset.html
Duncan, that is very, very cool. And thank you for a real writeup as well as videos. Relevant videos, that complement the written words, pictures and diagrams. You win Hackaday for the week. You HAVE submitted this to Hackaday, right?
Thanks Nick! I do like to try to document things in a way that is hopefully interesting to others, but also with enough detail that someone could repeat what I’ve done. I also tend to forget the details of various projects myself, so my other motivation is to record it so that *I* can remember how to do something!
I actually hadn’t submitted this to Hackaday, but I have now. Thanks for your encouragement.
I updated my boot sector games list/gist with this game, a listing of 26 good boot sector games now: https://gist.github.com/XlogicX/8204cf17c432cc2b968d138eb639494e
I’d have to go looking to see if I still have a copy of it , but , go back 20 years ago there were at least two different game boot-sector compo’s that I saw. Between both compo’s there could have easily been another 20 or 30 games to add to your list. I think Hugi did one of them (old yahoogroups list) Do a google, might be able to find them.
Good to know someone still know assembly. I’ve forgotten all the x86 machine code from the old day of boot sector virus.
Fdisk /mbr
Great work! Already more useful than some OS’s around the block …