Arduino Nano Matter powered gamepad runs Quake at 27 FPS

Silicon Labs Solutions architect Nicola Wrachien has designed an Arduino Nano Matter gamepad for which he was successfully able to port Quake, a popular first-person shooter game. We have seen developers and engineers port doom on everything from toothbrushes to GPS receivers. Wrachien was previously able to port Doom on a Sparkfun Thing Plus Matter MGM240P at Silicon Labs’ 30th-anniversary celebration.

But to make things more interesting and challenging he wanted to see if Quake could be run on the same MGM240SD22VNA MCU, and he succeeded. In the end, he could not only run the game, but he also implemented improved graphics (better than Doom), better physics, 3D rendering, and much more.

Arduino Nano Matter gamepad board

This gamepad is built around an Arduino Nano Matter board which features MGM240SD22VNA MCU from Silicon Labs, along with 256KB of RAM, which is very low compared to Quake’s original system requirements which is a minimum of 8MB of RAM and a Pentium-class CPU. But he took it as a challenge and designed a custom PCB in the shape of a gamepad with buttons, joysticks, and a 320×240 pixel LCD, for simplicity.

For the software port, SDLQuake1.09 codebase allowed for development on a modern Windows-based computer. To optimize space constants were stored in flash memory instead of RAM. However, accessing data from external SPI flash memory was very slow. To overcome this, the microcontroller was overclocked to 136 MHz, and several optimization strategies were implemented, including a texture cache, asynchronous DMA texture loading, optimized enemy rendering, assembly language functions, and partial screen refresh. Additional tools are also developed to make things simpler including constant table generation, QuakeC to C conversion, entity getter-setter generation, and a Quake Pak converter to optimize game data for rendering.

After all this, the final result is a full gameplay experience that includes enemy AI, game logic, monster behavior, triggers, doors, secrets, and teleporters. The 3D engine is also implemented in full with static and dynamic lighting and turbulent water surfaces. Gouraud shading is used on enemies and objects. Stereo audio, including ambient, static, and dynamic sounds, is also in place. Gurar shading is a common shading technique used in 3D graphics.

In addition to gameplay, a console is also implemented to activate cheats. You can save your game with the exact game state, including both player and monster states and positions. The controls can be customized, and settings including the key mappings, gamma, and sound volume are all saved to non-volatile memory. With all these features, the game runs at an average of 27 frames per second, typically between 17 and 45 FPS at the 320×200 pixel resolution of the original game.

Backside of the Arduino Nano Matter gamepad board

All these features use the 256KB of RAM available in the board, which includes 20KB of radio RAM as the radio is not used in this port. The performance is achieved by overclocking the MGM240 to run at 136 MHz. There are 16 remappable push buttons along with two analog thumbsticks which are used for movement. Two 16MB SPI flash ICs are used to store the game data, which is uploaded from an SD card. Stereo speakers provide sound and there is also a 3.5mm audio jack for headphones or external speakers. A charging circuit can also be found on the PCB to connect LiPo batteries. The PCB is designed for through-hole-only components to allow easy assembly.

Quake dynamic and static lighting and 3D textured

Previously we have seen RP2040 running Doom, and we have seen people running Doom on LEGO bricks feel free to check those out if you are interested in those topics.

Over the years, Doom has served as a benchmark for running games on limited hardware, but with the Quake port, the bar has just been raised. More information can be found on Next Hack’s GitHub repo or their website. You can also check out the Silicon Labs post for additional information.

Quick Look - Quake for Arduino Nano Matter - Silicon Labs

Via Hackster.io

Share this:
FacebookTwitterHacker NewsSlashdotRedditLinkedInPinterestFlipboardMeWeLineEmailShare

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK 5 ITX RK3588 mini-ITX motherboard

2 Replies to “Arduino Nano Matter powered gamepad runs Quake at 27 FPS”

Leave a Reply

Your email address will not be published. Required fields are marked *

Boardcon Rockchip and Allwinner SoM and SBC products
Boardcon Rockchip and Allwinner SoM and SBC products