- Tetris: replace pivot-based rotation with explicit 4-state SHAPES
table (classic SRS-style) so rotation is correct and the O piece no
longer drifts on rotate; keep simple wall-kick offsets.
- Both: render immediately after processing input (not only on gravity
steps) so rotation/movement is no longer laggy.
- Both: draw the window frame inset by 2-3px (double line) so the right
and bottom edges are actually visible instead of clipped at the edge.
- Font: add missing glyphs (U, W and complete A-Z) to both Snake and
Tetris 5x7 bitmap fonts so PAUSE/RESUME/NEW GAME render correctly.
- Tetris: the gravity loop never advanced nextTick after a step, so the
piece dropped almost instantly every frame. Advance nextTick by speed
after each step (matching Snake) so gravity honours the configured rate.
- Both: draw a 1px frame around the whole 240x296 window (right/bottom
edges were previously absent) and clear the playfield to black behind
PAUSE/GAME OVER text for contrast.
- Both: fix centering of overlay labels (GAME OVER, 5 RESUME, 5 NEW GAME).
Snake: the snake was initialized with its head at the left end while
moving right, so the first gravity step walked the head into its own
body and the game started at Game Over. Initialize the head at the
right end (cx) so the initial direction is valid.
Tetris: enlarge the playfield cell (10 -> 12px) so pieces are not too
small, and slow gravity (800ms base, gentler per-level ramp, 250ms
floor) so pieces do not fall too fast.
Both: brighten the secondary/dim text colour (0x0a3a0a -> 0x2f9f2f)
so score/label/menu text is actually legible on the black background.
Also wire the Games section into the real main menu: the system menu
is hardcoded in the dwm-plugin dmenu (src/sxmo-dmenu/dmenu.c), not in
sxmo_appmenu.sh, so add a 'games' builtin menu that loads
sxmo_hook_games.sh and a Games entry after Apps in the sys menu, plus
scripts/build-dmenu.sh to cross-compile dmenu.so.
Add two standalone X11 games (not DWM plugins) for the Nokia 8110 keypad:
- src/games/snake.cpp: Nokia Snake II-style game, 240x296, built-in 5x7 font
- src/games/tetris.cpp: Tetris with next-piece preview, levels, line clears
Both float as dialog windows in dwm, use a self-contained bitmap font (no
font-file dependency), and are controlled via the numeric keypad (2/4/6/8
directions, 5 action) with arrow-key fallbacks.
- scripts/build-games.sh: Docker armv7 cross-compile (mirrors build-sxmo-x11.sh)
- overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_games.sh: Games menu hook
- overlay/rootfs/usr/bin/sxmo_appmenu.sh: add 'Games' entry after 'Apps' and a
games submenu case
Binaries committed to prebuilt/games and overlay/rootfs/usr/bin per repo
convention. Deployed and verified on the live device (window maps, dwm focuses
it, keypad input reaches the game).
The previous commit disabled sxmo_idle.sh and the idle_locker in the
unlock/lock hooks, leaving the display backlight pinned at maximum
brightness forever (Xorg runs with -s 0 -dpms and /sys/power/state is
empty, so the panel never blanks). On a phone with no suspend this is by
far the dominant battery drain.
Restore sxmo_idle.sh and start idle_locker from the unlock and lock hooks
so the screen blanks after SXMO_UNLOCK_IDLE_TIME (default 30s) / once
locked after SXMO_LOCK_IDLE_TIME (default 8s). Locking itself stays
explicit-only, matching the documented design; only the display blanks.
Verified live on the device: after the idle timeout the state transitions
to screenoff and /sys/class/backlight/backlight/brightness drops to 0.
SXMO_OS is always bananarchy (an Alpine derivative) on this device, so
the SXMO_OS case, the change_systemd branch, and the nixos branch were
dead code. Drop them and always run the Alpine flow
(doas setup-timezone -z), which is what bananarchy uses.
Text-input dialogs (Wi-Fi SSID/Passphrase, search queries, config
prompts, etc.) invoke dmenu with -p but never -t, so the XIM/fcitx
routing that was gated solely by use_text_input was never enabled and
fcitx never activated on dmenu input; on the numeric keypad only raw
digits could be entered, making the dialogs non-functional.
Decouple the fcitx/IME routing from the -t flag via a new engage_ime
flag (default on) while keeping use_text_input for its output/selection
semantics, and skip routing Enter to fcitx when a menu list is present
so menu selection is never stolen by the T9 commit. XFilterEvent already
returns False when fcitx is toggled off via the mode switcher, so the
dialogs now respect the Fcitx mode switcher automatically.