- Enable GPIO 38 active-low card detect (cd-gpios) with bias-pull-up on
sdhci@7864000 across all MSM8905/MSM8909 device trees and DTBs
- Add sxmo_sdcard.sh and 88-bananarchy-sdcard.rules udev rules for
automatic mounting at /media/sdcard on insertion and cleanup on
removal
- Integrate SD card mount, unmount/eject, and navigation into the GUI
File Manager (files.so) and built-in dmenu SD Card menu (@menu:sdcard)
- Fix msm8916-wcd ALSA UCM2 configs (Earpiece.conf, Speaker.conf,
Headphones.conf, PrimaryMic.conf, HeadsetMic.conf) so Speaker,
Earpiece, and Headphones outputs and Mic1/Headset inputs are always
available and mutually exclusive without invalid mixer controls
- Add event-driven wired headphone/headset jack detection and automatic
audio routing in sxmo_soundmonitor.sh via evtest on the msm8916
Headset Jack input device
- Make Earpiece, Speaker, and Headphones first-class routable output
devices across sxmo_audio.sh, sxmo_modemaudio.sh, xdrawer, dmenu, and
callscreen
- Make volume controls strictly linear across all channels by keeping
PipeWire software gain at unity (100%) when unmuted and linearly
mapping 0-100% to hardware digital volume registers (RX3 for Speaker,
RX1 for Earpiece, RX1+RX2 for Headphones, TX1+ADC for Microphone)
- Audio: 48 kHz mixer with a 512/3072-frame ALSA ring and table-based
polyphonic MIDI synth (no stutter or tempo drag under load), Standard
MIDI Format 0/1, ToneControl sequences, multi-stream WAV, and MIDP
VolumeControl levels mapped to perceived loudness.
- Volume: track the system speaker volume and mute state live
(speaker_vol, RX3 Digital Volume, SPK DAC Switch) with the same cubic
gain PipeWire clients get; pause menu Audio item and volume keys now
change the system speaker volume like the xdrawer slider.
- JVM: key fields by name and descriptor so obfuscated classes with
same-named fields of different types work; cache resolved constant
pool refs, static field slots and monomorphic call targets; use a
stable deque heap; raise startApp/<clinit> budgets and run Java
threads on a wall-clock budget per frame.
- M3G and LCDUI additions needed by Tomb Raider 3D Underworld and
Castlevania: Aria of Sorrow.
Replace the select() timeout sleep with a Linux timerfd high-resolution
timer. It fires on an absolute CLOCK_MONOTONIC deadline, so wakeups are
no longer quantized to the kernel tick (a short final wait was rounded
up to a whole tick, causing +-10-22ms jitter and lurches). The loop now
select()s on both the X connection fd and the timer fd, so input still
wakes it immediately and no busy-spin is needed -- the controls stay
responsive. A select()-timeout fallback is kept for non-timerfd setups.
Snake: draw a bright frame around the actual playfield so its boundary is
unmistakable, and move the SCORE/BEST label down into the margin between
the window frame and the playfield frame.
The snake speed instability was caused by cumulative timing drift in the
select()-based loop (nextTick reset to now+speed each step). Both games now
use a fixed-timestep accumulator: elapsed time is accumulated each frame and
the game logic steps when enough has built up, so movement is perfectly
periodic regardless of frame timing or rendering cost. Frame pacing caps
elapsed at 200ms to prevent a spiral of death.
Both files were fully rewritten to eliminate structural corruption (duplicate
function definitions / missing braces) introduced by many incremental edits:
- Snake: turn queue (max 2), batched body rendering, 90 px/sec base, 30 fps.
- Tetris: batched beveled-block rendering (XFillRectangles), Gameboy palette,
XK_KP_Divide pause, 30 fps accumulator loop.
Both compile cleanly (no -Wall/-Wextra warnings) as valid armv7 ELF.
Root cause of unstable speed: nextTick was reset to 'now + speed' each step,
accumulating timing drift. Now uses 'nextTick += speed' with a floor (if
nextTick < now, reset to now) to prevent drift and catch-up spirals.
- Both games: 30 fps render cap (FRAME_MS = 33 ms), nextTick updated
cumulatively to eliminate drift.
- Snake: base speed 90 px/sec (~100 ms per step at cell=9), turn queue
unchanged, edge wrap unchanged.
- Tetris: gravity step uses cumulative nextTick, controls unchanged.
Switched both games back to 60 fps (FRAME_MS = 16 ms) for smoother rendering
and reduced Snake base speed from 150 to 90 px/sec (~60 ms -> ~100 ms per
step at cell=9) so the snake is controllable and doesn't feel too fast.
Progressive difficulty (+1 px/sec per 5 food) and turn queue are unchanged.
Identified and fixed rendering/input optimization issues:
- Snake: added turn queue (max 2 pending turns) so rapid key presses are
never lost; filters reversals and duplicates against the last queued
direction. Batched snake body rendering into a single XFillRectangles call
instead of one XFillRectangle per segment.
- Tetris: batched settled-block rendering into 3 XFillRectangles calls
(body, highlight, shadow) instead of 5 XFillRectangle calls per cell.
This reduces ~1000 X11 calls per frame to 3, fixing frame drops and
input lag.
- Both: non-blocking input polling before every frame (already in place)
ensures no keypress is missed.
Replaced the blocking select()-based main loop with a proper game loop:
- Process ALL pending X11 input (XPending) before every frame — no more
missed keypresses from select() blocking for up to a full frame
- Render every frame at 30 fps (FRAME_MS = 33 ms) consistently
- Frame pacing uses select() with a timeout that wakes immediately on
input, so keypresses are processed within milliseconds
- Game logic (snake steps, tetris gravity) still runs at its own rate via
nextTick, decoupled from render rate
This eliminates input lag and missed keypresses in both Snake and Tetris.