Tetris Everywhere: Character LCD Edition

Cheap character LCD displays are more versatile than we give them credit for. Most of the cheapies have a 5×8 character display, which looks blocky but legible when you have an appropriate font. Where it gets fun is that most of the LCD displays also let you upload custom characters.

Taking this to the extreme, [numeric] abused the user-defined characters to write a tiny game of Tetris that would run in the 10×16 frame that you get when you combine four characters together. It’s tiny, it’s monochrome, and doesn’t play the Troika theme (which may be a good thing), but it’s playable. Check out the video below.

[numeric] has bravely put his code for doing this online (ZIP file) as well. It’s rough, to say the least — he did this in a weekend just for fun. But before you go jumping on him for C code in header files, note that this is pretty cool for a quick hack, and also that as good as the Arduino platform is at getting beginners into coding, it doesn’t teach them how to do things right. We wish our first steps into our own coding looked this cool.

This is Hackaday, and we’ve covered a couple Tetris games before. If an LCD display is too high-tech for you, consider Tetris on a DIY LED matrix. If that’s too small, how about Tetris on a skyscraper? Even HP engineers can’t resist the allure of the tiny bricks. And of course, there’s our badge for Hackaday Belgrade. It’s a simple game, and a great test of your skills on a limited system. What’s your favorite Tetris platform?

19 thoughts on “Tetris Everywhere: Character LCD Edition

  1. Hah, brilliant! :-)

    With the 8 bytes of CGRAM characters, you could make it a bit larger by flipping the screen vertically and using 2×4 chars. I guess the aspect ratio would be a bit off with that, though.

    Anyway very cool project.

    1. “Must be” is a pretty strong language or a project that obviously worked the way it was written. If the compiler was happy with it, then putting C-code in a header file would just count as an undocumented feature… and thus a perfectly reasonable hack.

          1. You didn’t get it: The compiler doesn’t even see the .h, because the content is included in some .c (or corresponding Arduino-thing) using the preprocessor. If you explicitly feed a .h (containing code) to the gcc he won’t complain but he will not compile it, if you rename it in .c it works. Tested with ggc 4.7.2.
            The interesting thing is if you use -o to force an .exe as output (gcc test.h -o test.exe) it will produce some quite big executable that doesn’t work (“programm to big for RAM” (or something similar, translated) but seems to be a valid executable… Can somebody explain what is happening?
            test code:
            #include
            int main(void)
            {
            printf(“hello\n”);
            return 0;
            }

          2. That makes a change. Compilers usually complain that what I consider correct, is apparently wrong. I wish compilers just fixed your code, or at least highlight what’s actually wrong. If there was more than one way the code might could go, the compiler should just give you a drop down of possible options. Predictive text, that learns your coding style, would also be nice. Maybe even, automatically generating the definitions when you create a function and move it outside of your main block of code.

  2. Did that 2 years ago, but with only 2 custom characters for the playfield and one more for piece preview. This thing also plays Breakout and PONG (the PONG version was featured by HaD about 2 or 3 years ago, shortly before I put Tetris in there too)
    Does anyone know where to get the 1 line * 5 character LCDs used in some flat DELL Servers? I have one, but broke it during assembly of the world’s smallest PONG arcade machine…

  3. For the record, Troika was only used in the Atari arcade version, Tengen NES version, and some variants on the SNES like Super Tetris 3. The theme that everyone *thinks* of as the Tetris theme, due to it being used as the Type A music in the Game Boy version, is actually Korobeiniki.

Leave a 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.