Handoff notes and task list
This commit is contained in:
parent
ffeca7e2b1
commit
62ccecb42b
2 changed files with 108 additions and 0 deletions
32
TODO.md
Normal file
32
TODO.md
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
# TODO
|
||||||
|
|
||||||
|
Open work for the Spy Mouse macOS loader. Background is in [docs/HANDOFF.md](docs/HANDOFF.md).
|
||||||
|
|
||||||
|
## Verify
|
||||||
|
|
||||||
|
- [ ] Play the later worlds (2 and up), boss levels and the outro video in headless runs; fix whatever breaks
|
||||||
|
- [ ] Owner play test in a real window: keyboard steering feel (lead distance, turn speed), right click, cursor hiding,
|
||||||
|
fullscreen shortcuts, Retina frame pacing with vsync
|
||||||
|
- [ ] Compare screens against a real Android device or gameplay recordings (menus, HUD, dialogs) and list differences
|
||||||
|
- [ ] Language selection: check non-Latin languages (ja, ko, zh, ru) render with the game's fonts
|
||||||
|
|
||||||
|
## Improve
|
||||||
|
|
||||||
|
- [ ] Steering: tune `lead` and finger speed after the owner's feedback; consider diagonal smoothing along walls
|
||||||
|
- [ ] Gamepad support (left stick = steering, buttons = Back / pause / retry), same path as WASD
|
||||||
|
- [ ] HD assets: AI-upscaled textures swapped in at `glTexImage2D` (same UVs, 2x pixels), opt-in folder
|
||||||
|
- [ ] Speed toggle (2x / 0.5x) by scaling the time functions the game reads
|
||||||
|
- [ ] Universal binary (Intel Macs) and a lower minimum macOS (build dependencies with a deployment target)
|
||||||
|
- [ ] Windows / Linux build (video and web view need replacements for AVFoundation / WKWebView)
|
||||||
|
|
||||||
|
## Repository
|
||||||
|
|
||||||
|
- [ ] Choose a license for the loader code (none yet, so all rights reserved)
|
||||||
|
- [ ] Decide on the EA logo and screenshots in `docs/images` for the public repository
|
||||||
|
- [ ] Shorter repository description so it reads fully on link cards
|
||||||
|
|
||||||
|
## Separate project
|
||||||
|
|
||||||
|
- [ ] Reverse engineering / source rebuild in its own repository: full function inventory of `libSpyMouse.so`,
|
||||||
|
port function by function with addresses, prove identity with differential tests against this loader
|
||||||
|
(frame diffs, input replay, state traces)
|
||||||
76
docs/HANDOFF.md
Normal file
76
docs/HANDOFF.md
Normal file
|
|
@ -0,0 +1,76 @@
|
||||||
|
# Handoff
|
||||||
|
|
||||||
|
State of the Spy Mouse macOS loader as of 2026-10-16, for whoever picks it up next. Open work is in
|
||||||
|
[TODO.md](../TODO.md).
|
||||||
|
|
||||||
|
## What this is
|
||||||
|
|
||||||
|
A loader that runs the original Android `libSpyMouse.so` (v1.0.5, `com.ea.spymouse_carrier`, 32-bit ARM, stripped)
|
||||||
|
on macOS. Unicorn emulates the CPU; everything the game imports (bionic libc, pthread, OpenGL ES 1.1, JNI/Java,
|
||||||
|
audio, video, web view) is provided on the host. The game itself is not modified, decompiled or reimplemented.
|
||||||
|
A source rebuild / reverse engineering is a separate, future project in its own repository.
|
||||||
|
|
||||||
|
Public repository: https://git.crt.fyi/CRT/spy-mouse (announced on X with the gameplay screenshot).
|
||||||
|
|
||||||
|
## Layout
|
||||||
|
|
||||||
|
| Path | Content |
|
||||||
|
| --- | --- |
|
||||||
|
| `src/core.cpp`, `core.h` | Guest memory (1 GiB at `0x10000000`, TLSF heap), Unicorn engines (ARM1176, one per thread and call depth), SVC thunks for imports, `call_guest` |
|
||||||
|
| `src/elf.cpp` | ELF32 loader, relocations, symbol lookup for logs |
|
||||||
|
| `src/libc.cpp` | Bionic libc/libm/liblog/pthread, stdio, files, printf/scanf, time, path mapping (`/sdcard/...` to `game/data`, internal storage to the save folder) |
|
||||||
|
| `src/gl.cpp` | GLES 1.1 to desktop GL 2.1, multisample resolve for reads, texture naming and sprite tracking (player, pause/retry buttons) |
|
||||||
|
| `src/jni.cpp`, `jni.h` | Fake JNI: object table, method/field ids, Java class implementations (activity, storage, system/display delegates, AssetManager, InputStream, AudioTrack, video, browser) |
|
||||||
|
| `src/video.mm` | `PlayerAndroid` on AVFoundation (stretches into the view rect, stop = seek 0 + pause) |
|
||||||
|
| `src/browser.mm` | `BrowserAndroid` on WKWebView, `ShouldLoadURL` and load callbacks to the game, Android URLs |
|
||||||
|
| `src/main.cpp` | SDL3 window and GL context, UI thread vs GL thread (like Android), lifecycle, input (mouse, keys, WASD steering, P/R/right click), resize, window memory, control mode for tests |
|
||||||
|
| `tools/make_app.sh` | Builds `dist/Spy Mouse.app` (dylibs bundled, game files copied in, icon, ad-hoc signed, minimum macOS from the binaries) |
|
||||||
|
| `tools/ctl.sh`, `run.sh` | Test helpers: send control commands, run headless with a watchdog |
|
||||||
|
| `game/` (ignored) | `apk/` (unzipped APK) and `data/` (downloaded data). Never commit |
|
||||||
|
| `re/` (ignored) | jadx output of `classes.dex`, used to match the Java layer |
|
||||||
|
|
||||||
|
## Decisions that matter
|
||||||
|
|
||||||
|
- **CPU model ARM1176**: the audio mixer uses VFP short-vector mode, which Cortex-A cores reject.
|
||||||
|
- **UI thread and GL thread are separate**, as on Android. `NativeOnPause` waits for the render thread; calling both
|
||||||
|
from one thread deadlocks. Lifecycle, touch and key events go to the UI thread; `NativeOnDrawFrame` runs on the main
|
||||||
|
(GL) thread.
|
||||||
|
- **Surface = window pixel size.** The game lays itself out for any aspect ratio. Resizes send `NativeOnSurfaceChanged`
|
||||||
|
after the size settles (150 ms).
|
||||||
|
- **The game's framebuffer 0 is our multisampled FBO.** Reads (`glCopyTexImage2D` for the menu blur, `glReadPixels`)
|
||||||
|
resolve first.
|
||||||
|
- **Textures are named** from the PNG opened just before `glTexImage2D`, and by pixel hash when the engine re-uploads
|
||||||
|
cached pixels. Sprite positions come from projecting the vertices of draws with tracked textures.
|
||||||
|
- **WASD steering** touches the player sprite and keeps a finger `0.09 * H` ahead in the held direction, so the game
|
||||||
|
sees a drawn path. P/R press the game's own buttons where they were last drawn (static screens are not redrawn
|
||||||
|
every frame, so the freshest of the candidates within 300 frames wins).
|
||||||
|
- **Network** (Origin, leaderboards): sockets fail with `ENETUNREACH`; the game handles it as offline.
|
||||||
|
|
||||||
|
## Testing rules
|
||||||
|
|
||||||
|
- Tests run with `--headless`: no window shown, no audio device, a separate save profile (`.../SpyMouse/test-profile`),
|
||||||
|
and a hard stop after `--max-seconds`. Never test against the player's own save; copy it to another folder and pass
|
||||||
|
`--save-dir` if a test needs real progress.
|
||||||
|
- Never open a visible window or play sound on the owner's machine. After each test check that no `spymouse` process
|
||||||
|
is left (`pgrep -x spymouse`).
|
||||||
|
- Drive tests through `--control DIR` (`tools/ctl.sh`). `click`, `mdrag` and `press` go through the real SDL input
|
||||||
|
path; `tap`/`drag` call the game's touch native directly.
|
||||||
|
- Check with text first: `frame stats` lines (non-black %, average colour), the log, `--track-log`. Look at a
|
||||||
|
screenshot only when a visual judgement is needed, scaled down.
|
||||||
|
|
||||||
|
## Build
|
||||||
|
|
||||||
|
```bash
|
||||||
|
brew install unicorn sdl3 cmake
|
||||||
|
cmake -S . -B build && cmake --build build -j10 # dev build
|
||||||
|
tools/make_app.sh # app bundle in dist/
|
||||||
|
```
|
||||||
|
|
||||||
|
Logs and saves: `~/Library/Application Support/SpyMouse/` (`spymouse.log`, `internal/files/*.sav`, `window.txt`,
|
||||||
|
`last_crash.txt` after a fatal error, shown on the next launch).
|
||||||
|
|
||||||
|
## Before every push
|
||||||
|
|
||||||
|
- Commits as `CRT <hi@crt.fyi>`, no AI attribution in messages.
|
||||||
|
- Run the private privacy scanner over tracked files and history and require 0 hits.
|
||||||
|
- Confirm nothing from `game/` or `re/` (APK, `.so`, data, decompiled Java) is in the history.
|
||||||
Loading…
Add table
Add a link
Reference in a new issue