Rust Helps Make A $1 Handheld Console

These days, even an old Game Boy will set you back $100 or more, and a new handheld console will be many multiples of that. However, you can build a really cheap handheld gaming toy if you follow [Chris Dell’s] example.

In [Chris]’s own words, he used Rust to build a $1 handheld gaming console. How is that possible? Well, it all comes down to the CH32V003—a microcontroller cheaper than just about anything else out there. It sells for just 9 cents in bulk, and it’s no slouch either. The RISC-V device is a fully-fledged 32-bit chip running at 48 MHz, though with only 2 KB of RAM and 16 KB of flash. Still, that’s more than enough to make some little games. To this end, [Chris] paired the CH32V003 with an SSD1306 OLED display, and three tactile pushbuttons. He then whipped up some code in Rust with the aid of the ch32-hal project, implementing a neat platform game that ran at a healthy 25 fps.

The CH32V003 probably won’t be starring in a new handheld gaming revolution anytime soon. Still, it’s always interesting to see just what can be achieved with one of the cheapest microcontrollers on the market.

[Thanks to Kian Ryan for the tip!]

25 thoughts on “Rust Helps Make A $1 Handheld Console

  1. Almost 40 years ago Game Boy could achieve far more with a primitive 8-bit CPU clocked at 4 MHz.

    Maybe using an overhyped OO language designed for artistic coders doing “safety-critical” blinking LEDs on their dev boards is not the right choice?

    1. You… you think a Gameboy CPU is weaker than this thing?

      2D games don’t need speed. They need storage. This has 2 KB of RAM. That old Gameboy you’re maligning had 8 times that. It has 16 KB flash. The smallest Gameboy games were double that.

      But the biggest thing that’s missing from microcontrollers compared to old game systems is that they basically had the equivalent of a GPU.

      1. Apple proved that modern ARM CPU (like M1 in my Macbook) which is designed by Engineers instead of bean counters can consume less than 1W of electricity and easily outperforms Intel C2D E8400 with TDP of about 120-180W. (Not to mention older Northwood Celerons which even with water cooling could act as a space heater during long Canadian winters.)

          1. Well RAM isnt fair to judge when comparing a microcontroller to a flagship game console handheld from 35 years ago. Even then, you said the CPU IS STRONGER.

            Topic | Gameboy | CH32V003
            Clock | ~4.2 MHz | 48 MHz
            Arch |Sharp SM83| RISC-V
            Bitness | 8-bit | 32-bit
            Draw | ~0.7 watts| ~0.026 watts

            A 32 bit processor is 4x more bits, which means it can process 4x as much information as the game boy in one clock cycle, the clock cycles that go 11 times faster than the game boy’s. The CH32V003 powered on the 4 AA batteries used by the gameboy would last weeks, CONTINUOUSLY, while the gameboy dies at 15-30 hours of use. The gameboy also had a PPU to ease the load. The ram you mentioned wasn’t even ON the CPU! It was seperate, on the PCB itself. The CPU in reality only has 127 BYTES of memory called zero page RAM, not flash, not anything technologically superior. Sure, if you throw in the 160-byte OAM, 256-byte boot ROM (not modifiable), 128-byte I/O registers, and the 8 8-bit registers that each store one byte, it doesn’t even come CLOSE to the CH32V003.

          2. Processing power is almost unimportant to a game system, to some degree.

            Memory, however, is not. And that Gameboy CPU you’re maligning had access to tons more memory because it was an SoC with an external bus.

            Memory is everything. How much data you can process is pointless if you don’t have data. You could hook up an I2C or SPI RAM to that 32 bit CPU, sure, and then you’d watch the processing throughout plummet due to the low bandwidth to RAM.

            Power is relative.

          3. Memory is everything.

            And then there was the Atari 2600. And just look what people did with that thing, even whole adventure games in 4 k of finest machine code with 128 bytes of RAM.

          4. Yes, and that’s a great point – the 2600 and NES were negligibly different in terms of CPU power, but the NES had the better PPU and vastly more RAM and the difference is totally night and day.

      2. The CH32V003 is really limited by the amount of memory it has. For something like this, it would be better to spend 5 cents more and get a CH32V006F8. It has 8K of RAM and 62K of flash, although that’s still a lot less than a Gameboy.

  2. this already exists basically as a product…i can’t find it for sale but people kept getting them for my kids. it was dressed up like a tiny arcade cabinet, input is 4 directions and 2 buttons, it runs a small number of games. tiny color screen. cheap enough to be a ‘stocking stuffer’

  3. There are cheap chinese versions for around $15 that are much more polished. I don’t know if their hackable but with 400 games on board already not sure there’d be any need.

    1. As for hackability good ones in this price range are gb300 and sf2000. GB300 was US$10 including VAT and shipping in some deals and SF2000 was $15 on aliexpress, both now run custom firmware with many emulators, GBA perfomance is quite good, both are basically same hardware – 900Mhz MIPS with 128MB RAM. Next step is R36S which is below $30 and has 1GB RAM, nice 640×480 screen, RK3326 – enough for PS1 and N64 games.

      So those with 400 hardcoded games are IMO not a good deal – not very hackable and builtin games cannot save state.

        1. What I meant regarding SF2000 and GB300 is multicore, more info about current state at https://www.reddit.com/r/DataFrogCentral/
          multicore runs on top of original firmware so not fully custom but good enough. original firmware is used to launch multicore and then some bits of it in memory is used as OS kernel to access the hardware – like a dll, there is a list of hardcoded pointers to functions linked to original firmware

  4. I love this so much. So you don’t need a 5 dollar esp32 that’s too fancy. I like this as an even cheaper option but does that include the screen? Screen wash like another few cents right?

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.