Classic block-stacking puzzle game for the WiFi Pineapple Pager.
Author: brAinphreAk | brAinphreAk.net
- Two play modes: Left-handed and Right-handed portrait orientations
- Mode selector: Animated launcher with falling pieces
- Classic gameplay: All 7 tetrominoes with SRS-style rotation
- Ghost piece: Shows where your piece will land
- Scoring system: Points for lines, soft drops, and hard drops
- Leveling: Speed increases as you clear more lines
- High score persistence: Saved to
/root/loot/tetris_highscore - Background music: Korobeiniki (Tetris theme) via RTTTL
- Sound effects: Line clears, level ups, SMB death sound on game over
- LED effects: Visual feedback on D-pad and buttons
| Payload Starting | Loading | Mode Select |
|---|---|---|
![]() |
![]() |
![]() |
| Game Menu | Gameplay | Pause Menu | Game Over |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
Copy the payloads/user/games/tetris/ directory contents to your Pager:
# Create directory
ssh root@172.16.52.1 "mkdir -p /root/payloads/user/games/tetris"
# Copy all files
scp payloads/user/games/tetris/* root@172.16.52.1:/root/payloads/user/games/tetris/
# Make executable
ssh root@172.16.52.1 "chmod +x /root/payloads/user/games/tetris/*"/root/payloads/user/games/tetris/
├── payload.sh # Entry point for Pager menu
├── tetris_launcher # Mode selector
├── tetris_portrait_l # Left-handed game
└── tetris_portrait_r # Right-handed game
- Navigate to Games > Tetris on your Pager
- Choose LEFT or RIGHT handed mode
- Press GREEN to start
Hold the Pager sideways (landscape orientation).
| Button | Left-Handed | Right-Handed |
|---|---|---|
| UP | Move RIGHT | Move LEFT |
| DOWN | Move LEFT | Move RIGHT |
| LEFT | Rotate | Soft drop |
| RIGHT | Soft drop | Rotate |
| GREEN (A) | Hard drop | Hard drop |
| RED (B) | Pause | Pause |
| Action | Points |
|---|---|
| Single line | 100 × level |
| Double | 300 × level |
| Triple | 500 × level |
| Tetris (4 lines) | 800 × level |
OpenWrt SDK for ramips-mt76x8:
wget https://downloads.openwrt.org/releases/24.10.0/targets/ramips/mt76x8/openwrt-sdk-24.10.0-ramips-mt76x8_gcc-13.3.0_musl.Linux-x86_64.tar.zst
tar -xf openwrt-sdk-*.tar.zst
export PATH=/path/to/openwrt-sdk/staging_dir/toolchain-mipsel_24kc_gcc-13.3.0_musl/bin:$PATH# Build (outputs to payloads/user/games/tetris/)
make CROSS_COMPILE=mipsel-openwrt-linux-musl- tetris
# Deploy to Pager
make CROSS_COMPILE=mipsel-openwrt-linux-musl- deploypineapple-pager-tetris/
├── src/
│ ├── lib/
│ │ ├── pager_gfx.h # Graphics library
│ │ └── pager_gfx.c
│ └── tetris/
│ ├── tetris_launcher.c # Mode selector
│ ├── tetris_portrait_l.c
│ └── tetris_portrait_r.c
├── payloads/user/games/tetris/ # Ready to deploy (mirrors Pager path)
│ ├── payload.sh
│ ├── tetris_launcher # (built)
│ ├── tetris_portrait_l # (built)
│ └── tetris_portrait_r # (built)
├── Makefile
└── README.md
| Spec | Value |
|---|---|
| CPU | MIPS 24KEc @ 580MHz |
| Display | 222×480 RGB565 @ /dev/fb0 |
| Input | /dev/input/event0 (evdev) |
| Max FPS | ~20 (SPI limited) |
Important: Physical button A is GREEN (right), button B is RED (left).
| Button | Color | Position | Code | evdev |
|---|---|---|---|---|
| A | GREEN | Right | BTN_A |
KEY_ENTER (28) |
| B | RED | Left | BTN_B |
KEY_ESC (1) |
Games must stop Pager services to access the framebuffer:
# Stop services before game
/etc/init.d/pineapplepager stop
/etc/init.d/pineapd stop
# Run game
./mygame
# Restart services after
/etc/init.d/pineapplepager start &
/etc/init.d/pineapd start &Included in src/lib/, provides:
- Framebuffer double-buffering
- Drawing primitives & text
- Input handling with edge detection
- Display rotation (0°, 90°, 180°, 270°)
- RTTTL audio playback
- Original Tetris by Alexey Pajitnov
- Korobeiniki - Traditional Russian folk song
Open source. Use and modify freely.







