Add Missile Command game for T-Deck + desktop emulator

Game (examples/MissileCommand):
- Classic Missile Command: 6 cities, 3 batteries x 10 missiles,
  escalating waves, smart bombs, score multiplier, session high score
- Trackball aims, press/tap fires, keyboard A/S/D selects battery,
  screen tap aims+fires
- Rendering: incremental TFT_eSPI drawing (persistent enemy trails that
  vanish on death, no AA-rocket trails, explosion circles that repair
  terrain, ghost-free crosshair)
- Sound (sound_engine.cpp): non-blocking I2S task on core 0; wave-start
  alarm of four falling tones (like the original), sweeps/noise effects,
  U/V/M keyboard volume control with OSD, master volume scaling

Emulator (emulator/):
- SDL2 host that compiles the unmodified sketch against shim headers
  (Arduino, TFT_eSPI->framebuffer, GT911 touch, I2C keyboard, I2S->SDL
  audio); arrow keys emulate the trackball, --autoplay/--frames/--dump
  flags for headless smoke tests
This commit is contained in:
Dejvino
2026-11-10 22:06:41 +01:00
parent 9aac147a31
commit d4e6b4e6be
16 changed files with 2466 additions and 2 deletions
+28
View File
@@ -0,0 +1,28 @@
#pragma once
#include <cstdint>
#include "Wire.h"
#include "emu_input.h"
/**
* Touch shim: left mouse button on the canvas acts as a GT911 touch tap.
*/
class TouchDrvGT911 {
public:
void setPins(int, int) {}
bool begin(TwoWire &) { return true; }
bool begin(TwoWire &, uint8_t) { return true; }
void setMaxCoordinates(int, int) {}
void setSwapXY(bool) {}
void setMirrorXY(bool, bool) {}
void sleep() {}
bool isPressed() { return emu::touchDown; }
uint8_t getPoint(int16_t *x, int16_t *y, uint8_t n)
{
if (n == 0 || !emu::touchDown) return 0;
x[0] = (int16_t)emu::touchX;
y[0] = (int16_t)emu::touchY;
return 1;
}
};