Trackball: ISR edge capture + momentum model; extract difficulty tunables
- 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.
This commit is contained in:
@@ -216,6 +216,9 @@ int main(int argc, char **argv)
|
||||
if (frame % 75 == 0) emu::keyboard.push_back('s');
|
||||
}
|
||||
|
||||
// fire any emulated interrupts triggered by the pin changes above
|
||||
emu::dispatchIsrs();
|
||||
|
||||
loop();
|
||||
|
||||
if (emuGfx::dirty) {
|
||||
|
||||
Reference in New Issue
Block a user