Table of Contents
The BitBoy project is a custom-built handheld gaming console powered by the STM32F103C8T6 microcontroller. Designed to emulate the charm of retro gaming. It features a collection of classic games developed entirely in ARM assembly. The project showcases advanced programming techniques, efficient hardware utilization, and creative problem-solving to overcome the constraints of embedded systems.
- STM32F103C8T6
- ST-Link V2 Programmer
- LCD TFT 3.5 inch
The BitBoy console includes a library of retro-style games, all developed in ARM assembly:
Main Features and Challenges:
- Dynamic Ball Bounce Physics.
- Singleplayer and multiplayer mode.
- Efficient drawing to avoid LCD-TFT from flickering.
- Collision checks.
Main Features and Challenges:
- Snake body Memory representation.
Main Features and Challenges:
- Gravity Simulation using Euler's method for velocity and position updates.
- TFT drawing multiple moving objects.
Main Features and Challenges:
- Recursive Backtracker in ARM assembly.
- Very limited stack size on the STM32F103 which lead us to use a custom-made more efficient stack tailored for our use case.
Main Features and Challenges:
- Joystick Configuration (ADC)
- Accurate crosshair velocity modeling using Euler's method position updates.
Main Features and Challengess:
- Win detection for horizontal, vertical, or diagonal lines.
Main Features and Challenges:
- Board memory representation.
- Implementing game logic for player movement across the board.
Main Features:
- Level progression as sequences grow longer.
In order to test and simulate each game without requiring the physical TFT, we developed several Python-based renderers. These renderers utilize Keil's debugger to extract the game's memory and effectively "simulate" a TFT display. This approach allowed us to validate the game's logic before deploying it to the actual hardware. It also simplified debugging, as software issues could be identified and resolved prior to involving hardware.
The simulation projects can be found in the SimulationProjects directory within the repository. Each game has its own dedicated Python renderer, designed to replicate the behaviour of the TFT.
To run the simulation projects, follow these steps:
- Ensure you have Python 3.9+ installed on your system.
- Install the required dependencies by running:
pip install pygame pip install win32gui pip install pywin32 pip install PIL
- Each keil project should have a .ini file which is used as an initialization file for keil's debug mode.
- Inside Keil:
- Make sure you installed the required package for STM32F103C8 from the Pack Installer (Keil::STM32F1xx_DFP)
- Create a new project and make sure to only select
CMSIS => Corein the software components when prompted by keil. - Inside the new project's settings, on the
Debugtab change debug mode toUse Simulator, add the provided .ini file as the initialization file, and go to theLinkertab then uncheck theUse Memory Layout from Target Dialogbox then clear thescatter filesection.
- Now, you can run the provided code in debug mode and use the function inside the .ini file to dump the memory.
- Run the corresponding Python renderer for the game.
- You should now see a pygame render of the game's memory.