Skip to content

fix(emulator): make the native macOS runtime usable - #129

Open
UrbanLeopard wants to merge 2 commits into
CardputerZero:masterfrom
UrbanLeopard:fix/emulator-macos-runtime
Open

fix(emulator): make the native macOS runtime usable#129
UrbanLeopard wants to merge 2 commits into
CardputerZero:masterfrom
UrbanLeopard:fix/emulator-macos-runtime

Conversation

@UrbanLeopard

Copy link
Copy Markdown

Summary

  • enable the native cp0 SDL runtime in macOS emulator builds
  • replace Linux-only keyboard definitions and process/runtime assumptions with portable implementations
  • make the device skin's side buttons and keyboard clickable on macOS
  • route keyboard and pointer activity to APPLaunch so the screensaver can be dismissed
  • enable SDL text input for printable keys
  • default to a readable 2× LCD presentation with a resizable window and configurable initial scale
  • add macOS runtime, clickable-control, reset, navigation, and screensaver-wake regressions
  • run the macOS tests and packaged-artifact smoke test in GitHub Actions
  • document native macOS build, controls, scaling, and tests

Root cause

The macOS target did not compile the native cp0 SDL runtime and instead depended
on a basic LVGL keyboard path. Enabling the runtime exposed Linux-only input
headers, POSIX API differences, a duplicate LVGL keyboard symbol, and lifecycle
assumptions that do not hold on Darwin.

Two additional input issues remained after the runtime built:

  • SDL had already converted mouse events into renderer-logical coordinates, but
    the emulator scaled those coordinates a second time, causing clicks to miss
    the skin hitboxes.
  • the host executable remained bound to its weak screensaver-filter fallback
    after APPLaunch was loaded dynamically, so input activity never reached the
    active APPLaunch screensaver.

User impact

The native macOS emulator now starts with the same cp0 runtime used by the
desktop build, supports the APPLaunch CLI PTY, accepts physical and on-screen
keyboard input, wakes correctly from the screensaver, and presents the 320×170
LCD at a readable 640×340 default size.

The first click or key press that wakes the screensaver is consumed so it does
not also activate an underlying control.

Validation

  • clean Release configure and build with AppleClang
  • ctest --test-dir <clean-build> --output-on-failure — 2/2 passed
    • native runtime, clickable NEXT control, navigation, reset, and graceful quit
    • APPLaunch screensaver wake through the dynamically bound input filter
  • sh ext_components/cp0_lvgl/tests/run_tests.sh — passed
  • packaged the executable, apps, assets, images, and APPLaunch resources into a
    clean directory and ran the same headless smoke command used by CI — passed
  • manually verified physical keyboard input, clickable side/keypad controls,
    screensaver wake behavior, and the readable resizable display on macOS
  • git diff --check — passed

Test-suite note

projects/APPLaunch/tests/run_tests.sh begins successfully on macOS but reaches
an existing GNU/BSD base64 command-line incompatibility in
test_cardputer_adb.sh. This PR does not change the ADB packaging test harness;
the emulator-specific integration coverage and the cp0 component suite pass.

@UrbanLeopard

Copy link
Copy Markdown
Author

Display comparison

Before — compact 640×420 window with the LCD at its native 320×170 size:

cardputer-before

After — default 1280×840 window with a crisp 2× LCD at 640×340:

cardputer-after

@UrbanLeopard
UrbanLeopard marked this pull request as ready for review July 25, 2026 19:31
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