Skip to content

Touch over the USB link, touch as Dark Forces' mouse; the link from the shared emulink submodule - #139

Merged
finger563 merged 3 commits into
mainfrom
feat/remote-touch
Nov 16, 2026
Merged

finger563 merged 3 commits into
mainfrom
feat/remote-touch

Conversation

@finger563

@finger563 finger563 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Also includes #140, merged into this branch: the USB link (devlink, the test control, emulink, the web console) moves to the shared esp-cpp/emulink submodule at components/emulink. It also includes a cppcheck fix: the cart pointer in TOUCH's frame mapping is now pointer-to-const.

The same change as tab5-emu's PR (the shared emulink, web console and protocol), for the box.

Touch over the USB link

  • Protocol 5: TOUCH (0x0F): u8 fingers, u16 x, u16 y, u16 hold_ms. A finger is held for hold_ms and then lifted, or with 0 it stays down until the next TOUCH, so a drag is a run of them. fingers = 0 lifts it. The coordinates are screen pixels (320×240). With flag 0x80 they are screenshot pixels instead; the firmware maps them through the frame's place on the screen.
  • Launcher: the launcher's LVGL menus take the remote finger through a pointer input device of their own.
  • Games: games read it with BoxEmu::touch_pointer(), alongside the touch screen.
  • emulink: emulink tap X Y, emulink touch X Y / emulink touch (hold / lift), emulink drag X0 Y0 X1 Y1 --ms 300; --frame takes screenshot pixels.
  • Web console: the Screen panel's capture is a touch screen. Click or drag on it.

Touch as the mouse in Dark Forces

  • New API: BoxEmu::touch_pointer(), screen_to_frame(), frame_to_screen() and touch_gamepad_state(). The last one is always empty on the box; the names match tab5-emu's, so the shared port builds for both.
  • Dark Forces: TheForceEngine moves to feat/touch-mouse (6ef6cb8).
    • In the menus the finger is the cursor and a press clicks.
    • In a mission, a drag is mouse look and a quick tap fires.
    • The branch also carries the RISC-V build fix and darkforces_forget_block() from tab5-emu. Neither changes the box: the first is Xtensa-guarded, and the box doesn't call the second.

Testing

Tried on the box with emulink:

  • Launcher: emulink tap on a game in the list selects it.
  • Dark Forces menus: touch moves the cursor where the finger is, with both screenshot (--frame) and screen coordinates. The frame sits 20 px down the 320x240 screen.
  • Not tried yet:
    • a mission on the box, which needs a new agent and so a write to the game's save file (the Tab5 run of the same port did turn, pitch and fire);
    • the web console's screen touch.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY

…orces' mouse

The link's test control gets TOUCH (protocol 5): a finger at (x, y), held
for a time or until the next TOUCH, in the screen's pixels or (flag 0x80)
the screenshot's, which the firmware maps through the frame's place on
the screen. The launcher's LVGL menus take it through a pointer input
device of its own; games read it with BoxEmu::touch_pointer().

emulink: tap, touch (hold / lift) and drag, --frame for screenshot
pixels. The web console's screen is a touch screen: click or drag on it.

Dark Forces (TheForceEngine feat/touch-mouse, which also carries the
RISC-V build fix and darkforces_forget_block() from tab5-emu): touch is
the mouse. In the menus the finger is the cursor (a press clicks); in a
mission a drag is mouse look and a quick tap fires.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

✅Static analysis result - no issues found! ✅

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

ESP-IDF Size Report for 'Esp Box Emu'

Metric Base PR Delta
FLASH 4,219,432 bytes (67.07%) 4,220,864 bytes (67.09%) 🔺 +1,432 bytes (+0.02%)
DRAM 170,405 bytes (49.86%) 170,421 bytes (49.87%) 🔺 +16 bytes (+0.01%)
IRAM 0 bytes 0 bytes 0 bytes
RAM (DRAM+IRAM) 170,405 bytes 170,421 bytes 🔺 +16 bytes (+0.01%)

FLASH uses app .bin size or json2 flash sum. RAM sums DRAM+IRAM via idf_size. Percentages shown when totals are available.
DRAM/IRAM usage does not include memory used by the heap allocator at runtime.
This report was generated by esp-idf-size-delta.

@finger563
finger563 marked this pull request as ready for review November 16, 2026 00:36
finger563 and others added 2 commits November 15, 2026 20:32
…ariablePointer)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
components/devlink, main/remote_control.hpp, tools/emulink and web/ were
the same in esp-box-emu and tab5-emu; they are esp-cpp/emulink now, a
submodule at components/emulink (the `emulink` component: DevLink and
the header-only RemoteControl). tools/emulink and web are links into it,
so `cd tools/emulink && python -m emulink` and the local web server work
as before; the pages workflow publishes components/emulink/web. The
board component comes from EMULINK_BOARD_COMPONENT (box-emu by default).


Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@finger563 finger563 changed the title Touch over the USB link (emulink tap / touch / drag); touch as Dark Forces' mouse Touch over the USB link, touch as Dark Forces' mouse; the link from the shared emulink submodule Nov 16, 2026
@finger563
finger563 merged commit 0a026cd into main Nov 16, 2026
3 checks passed
@finger563
finger563 deleted the feat/remote-touch branch November 16, 2026 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant