This document provides instructions for building the project for different target platforms: host (Linux/Windows), rp2040, and rp2350.
- CMake: A cross-platform build system generator. Version 3.22 or higher is required.
- Git: For cloning the repository.
- C/C++ Compiler:
gcc/g++(orclang). Install withsudo apt-get install build-essential. - X11 Libraries: Required for the display. Install with
sudo apt-get install libx11-dev.
- Visual Studio: With the "Desktop development with C++" workload installed.
- CMake: Make sure
cmakeis in your system's PATH.
- Pico SDK: You need to have the Raspberry Pi Pico SDK installed. Follow the official documentation at https://github.com/raspberrypi/pico-sdk to set it up.
- ARM GCC Toolchain: The ARM embedded toolchain is required for cross-compilation.
- PICO_SDK_PATH Environment Variable: Make sure the
PICO_SDK_PATHenvironment variable is set to the location of your Pico SDK installation.
First, clone the repository:
git clone <repository-url>
cd <repository-directory>The host build runs the emulator on your PC.
-
Create a build directory:
mkdir build cd build -
Configure CMake:
- Pass
-DPICO_PLATFORM=hostto select the host build. - On Windows, you might need to specify the generator (e.g.,
"Visual Studio 17 2022").
Linux:
cmake .. -DPICO_PLATFORM=host
Windows (Command Prompt):
cmake .. -DPICO_PLATFORM=host -G "Visual Studio 17 2022" -A Win32 - Pass
-
Build the project:
Linux:
make
Windows:
cmake --build .The executable will be located in
bin/host/Debugorbin/host/Release.
These builds target the Raspberry Pi Pico boards. The following instructions create a build with VGA video and I2S audio output, as recommended for a simple default.
-
Create a build directory:
mkdir build-rp2040 cd build-rp2040 -
Configure CMake:
- Set
PICO_PLATFORMtorp2040. - Enable VGA and I2S sound.
cmake .. -DPICO_PLATFORM=rp2040 -DENABLE_VGA=ON -DENABLE_I2S_SOUND=ON
- Set
-
Build the project:
make
The output file (
.uf2) will be inbin/rp2040/Debug/.
-
Create a build directory:
mkdir build-rp2350 cd build-rp2350 -
Configure CMake:
- Set
PICO_PLATFORMtorp2350. - Enable VGA and I2S sound.
cmake .. -DPICO_PLATFORM=rp2350 -DENABLE_VGA=ON -DENABLE_I2S_SOUND=ON
- Set
-
Build the project:
make
The output file (
.uf2) will be inbin/rp2350/Debug/.
You can customize the build by enabling different options in the CMake command.
ENABLE_NTSC-TV=ON: Use NTSC TV output.ENABLE_VGA=ON: Use VGA output.ENABLE_HDMI=ON: Use HDMI output.ENABLE_TFT=ON: Use TFT display output.
ENABLE_I2S_SOUND=ON: Use I2S for audio.ENABLE_PWM_SOUND=ON: Use PWM for audio.ENABLE_HARDWARE_SOUND=ON: Use a hardware sound chip.
Example of a different configuration (HDMI for rp2040):
cmake .. -DPICO_PLATFORM=rp2040 -DENABLE_HDMI=ON -DENABLE_I2S_SOUND=ONThe project uses a custom boot stage 2 (slower_boot2) for Pico builds. This configuration slows down the flash clock divider, which can improve system stability, especially on startup.
The build system sets a PICO_BOARD variable to pico2 internally. This is a low-level setting for the Pico SDK and is not intended to be changed by the user. The primary way to select the target hardware is via the PICO_PLATFORM variable (rp2040 or rp2350).