Flipper Zero native app — 123DiceDnD. Runs on Momentum firmware.
cd dice_roller
ufbt # build
ufbt launch # build + deploy + run via USBSDK: Momentum firmware (ufbt update --index-url=https://up.momentum-fw.dev/firmware/directory.json)
dice_roller/dice_roller.c— all app logic (state machine, drawing, input, animation)dice_roller/dice_sprites.h— auto-generated XBM sprite arrays (do not edit manually)dice_roller/tools/gen_sprites.py— Python script to regenerate spritesdice_roller/application.fam— app manifest (appid:dice_roller, name:123DiceDnD)
- Single-file C app, ViewPort + FuriMessageQueue event loop
- State machine: Splash → Main → Rolling → Result
- 3D sprites: 6 dice types × 8 rotation frames, 24×24px XBM
- Sprite lookup via
dice_sprite_get()inline function (not pointer table — avoids FAP relocation bugs) - Timer: FuriTimer at 50ms (20Hz) drives animation and splash timeout
- Target firmware: Momentum (not official Flipper)
- Local clang errors for
Canvas,furi.hetc are false positives — SDK headers only in Flipper toolchain ufbt launchdeploys to/ext/apps/Games/dice_roller.fap— watch for stale FAP files with old names on SD card- Serial debugging:
log debugvia CLI on/dev/cu.usbmodemflip_Rank3r31 - Stack size: 8KB, app requires
guiandnotificationservices
- Semver (MAJOR.MINOR.PATCH) in
dice_roller/application.famfieldfap_version - Every commit bumps version and gets an annotated git tag
vX.Y.Z - Bug fixes → PATCH, new features → MINOR, breaking changes → MAJOR
User prefers communication in Russian. All code and documentation must be in English.