- examples/Lotus3 -> examples/MiataDrive, sketch MiataDrive.ino,
emulator target APP=MiataDrive, platformio src_dir updated
- drop the borrowed photo title background (title_bg.h): the title
screen now renders the game's own start line under the arch with the
selected car parked on the road; color picker labels sit over the
horizon, showcase car doubles as the live preview
- add dedicated README (controls, features, sprite pipeline, gallery)
- commit in-progress work the game now depends on: sound engine events
(engine hum, crash noise) plus the 4-line SDL audio shim in the
emulator host
Segment-based pseudo-3D road (curves + hills, Jake Gordon technique):
perspective trapezoid rendering near->far with hill clipping, scrolling
rumble strips and lane dashes, depth fog, low camera for planted feel.
Sprites extracted from the provided spritesheet: red Miata player car,
blue/dark/yellow traffic with collision, palms/pines/bushes/billboards,
start-finish arch, tire stacks. Off-road excursions trigger a rollover
crash animation cycling the extra car views with dust, slide and camera
whiplash; rear-ending traffic jolts the camera.
Manual driving by default (arrows/WASD, P toggles demo AI); 3 laps with
checkpoint time, score, speed HUD. SDL emulator target added to the
emulator Makefile and platformio.ini src_dir switched to Lotus3.
The sound task used to zero the I2S TX DMA ring as soon as the event
queue drained. i2s_write() only queues samples, so anything shorter than
the ~64 ms ring was erased before it reached the speaker. Enable
tx_desc_auto_clear instead, which clears each descriptor after the DMA
has actually transmitted it.
Also add the NoiseSensor radar example and point the default PlatformIO
environment at it.
- Trackball edges are counted by IRAM_ATTR ISRs (4 quadrant pins + BOOT
click), so nothing is lost while loop() stalls in long TFT draws.
The old ~1 ms polling hot path is gone.
- Debounce is handled by the momentum model itself: edge counts are
impulses on a heavy ball, friction bleeds velocity off each frame.
Contact bounce decays into a sub-pixel nudge and never reverses
motion, so no time-gate is needed. Slow rolls glide in 1-px steps
via sub-pixel accumulators; hard flicks stay capped.
- Per-platform sensitivity: device gets 4x impulse per edge (its real
pulse rate is far lower than the emulator's synthetic streams) plus
lower friction; selected via the shim's EMULATOR define.
- Emulator shim: attachInterrupt/detachInterrupt emulation; handlers
are dispatched from the host loop when pin levels change.
- MissileCommand: extract arcade difficulty scaling into a tunables
block (wave quota, bomb speed, spawn pacing, smart-bomb chance,
craft speeds/drop rates, scoring, score multiplier, bonus-city
interval, mercy rules). Formulas unchanged, only symboled.
- Ignore all input for ~1.2 s after power-up/reset (INPUT_GRACE_MS):
the keyboard controller can emit stale bytes and pins can float,
which used to start a game right after a restart.
- High score + volume survive power cycles: Preferences (NVS, 'mc'
namespace) loaded in setup(), saved on game over and on every
volume key (U/V/M). arduino-esp32 commits NVS in end(), so
savePrefs() does putUInt x2 + end() + begin() reopen.
- SoundEngine::setVolume() restores a saved level (0 = stay muted,
lastVol_ keeps unmute working).
- Emulator: file-backed Preferences shim (mc-prefs.cfg, gitignored)
so persistence is testable on the desktop.
The crosshair crawled one 14px segment per tick because the ball pins
were sampled only once per game frame (33 ms) and just compared to the
previous level: a fast roll completed whole pulse cycles between reads,
so most edges were dropped and at most one step per frame was applied.
Now pollTrackball() runs in the loop() hot path (~1 ms apart) and counts
every edge into per-direction accumulators; applyTrackball() consumes
them once per frame, moving the cross steps * CROSS_STEP and capping at
CROSS_MAX_STEP (48 px/frame) — slow roll = fine steps, hard flick =
the cursor flies across the screen, arcade-style. Accumulation is
disabled outside PLAYING/BANNER and the first read is primed so the
power-up pin levels don't count as steps.
Emulator: mouse wheel now simulates ball pulses (6 edges per notch,
drained one toggle per iteration) for desktop testing.
Game (examples/MissileCommand):
- Trails rewritten as an analytic flight path (pos is a pure function of
distance travelled): paint and erase replay the exact same pixels, so
blinking trails leave zero residue. Smart bombs wiggle (S-curves) with
deterministic paths; erase band widened to a symmetric 7px so the ±1px
Bresenham slope jitter between paint/erase endpoints can never leak
paint ink (verified zero strays across dense frame captures).
- 2600 look: bright steady missile head dot with a flashing trail
(shared blink phase), trails vanish on death/impact; AA rockets stay
moving dots.
- Arcade rules: bomber planes (100x mult) and satellites (250x mult)
cross the sky dropping bombs; max 3 city kills per wave; bonus cities
at every 10k kept in reserve and deployed between waves; battery
silos rebuilt and replenished at each wave start (they no longer stay
dead across levels); center battery fires fast rockets, sides slow.
- Wave-start attack alarm (four falling tones, once); volume U/V/M with
OSD; sound task zeroes the I2S DMA ring when the queue drains so a
finished sound's tail no longer loops forever.
Emulator:
- --wave N flag to skip straight to a wave for quick testing
- --dump-interval N rolling frame captures (seq%05d.bmp)
- shim: uxQueueMessagesWaiting added