You've already forked firmware
mirror of
https://github.com/FlipperMCE/firmware.git
synced 2026-02-16 16:55:36 -08:00
2.5 KiB
2.5 KiB
FlipperMCE Development Guide
This guide helps AI agents understand the essential patterns and workflows for contributing to FlipperMCE, a MemoryCard Emulator based on sd2psx.
Project Overview
FlipperMCE is a memory card emulator firmware targeting RP2040-based hardware. Key components:
- Core emulation logic in
src/gc/gc_cardman.cand related files - UI/display handling via OLED screen (
src/oled.c,src/gui.c) - Settings management and configuration parsing (
src/settings.c) - Hardware interfaces for GPIO, PSRAM, and SD card access
- Game database handling (
database/directory)
Development Environment
Build System
- Uses CMake with Pico SDK
- Key files:
CMakeLists.txt- Main build configurationpico_sdk_import.cmake- Pico SDK integrationmemmap_custom.ld- Custom memory layout
Hardware Requirements
- RP2040-based development board
- OLED display
- PSRAM chip
- SD card interface
Key Development Workflows
Building
- Ensure Pico SDK is properly set up
- Configure cmake with appropriate target variant
- Build produces
.uf2files inbuild/directory
Flashing
- Hold either button while connecting device to enter bootloader mode
- Copy
.uf2file to mounted RPI-RP2 volume (seeflasher/tools)
Configuration
- Settings stored in
.flippermce/settings.inion SD card - Per-card configs in
CardX.inifiles
Critical Patterns
Memory Card Emulation
- Card data stored in PSRAM and backed by SD card
- Game ID detection protocol documented in
doc/mcp/ - Multiple card sizes supported (4-64 MBit)
Hardware Interface
- Core 0: Main UI and management
- Core 1: Time-critical EXI protocol handling
- Uses DMA for efficient memory transfers
Game Database
- Pre-parsed during build (
database/parse_*.py) - Supports multiple console formats
- Game-to-folder mapping via
Game2Folder.ini
Common Tasks
Adding New Game Support
- Update relevant database parser in
database/ - Test with both stock and Game ID-based card creation
- Verify proper card size selection
UI Changes
- Modify
src/gui.cand related files - Test across different screen orientations (FlippedScreen setting)
- Ensure memory-efficient rendering
Debugging
- UART debug output available (see
debug.c) - USB serial commands for testing:
blr- Reset to bootloaderrrr- Soft resetch+/ch-- Change channel
Integration Points
- EXI protocol handling in
src/gc/ - LVGL UI framework integration
- SD card filesystem access via ESP8266SdFat
- External dependencies in
ext/