# Rosy Rupeeland recompilation This repository is the native source-recompilation project for *Freshly-Picked Tingle's Rosy Rupeeland*. It compiles recovered game code from a local `Rosy-Rupeeland-Decomp` checkout and supplies replacements only for operating-system, NitroSDK, Nintendo DS hardware, ABI, and retail-data boundaries. It is not a clone, scene rewrite, emulator, or runtime ARM interpreter. Game behavior belongs in the canonical recovered sources in the decompilation project. ## Repository layout - `../Rosy-Rupeeland-Decomp/` — default local matching-decompilation checkout; - `src/native/` — host process and platform/SDK boundary implementations; - `include/tingle/` — native boundary interfaces; - `tests/` — copyright-free boundary tests; and - `docs/architecture.md` — recompilation rules, barriers, and milestones. ## Checkout Place both repositories beside each other: ```text Github/ Rosy-Rupeeland-Recomp/ Rosy-Rupeeland-Decomp/ ``` For another location, pass `-DTINGLE_DECOMP_DIR=path/to/Rosy-Rupeeland-Decomp` when configuring CMake. ## Build The first host backend supports 32-bit Windows and requires Python 3 for generated linkage. Recovered game objects retain the retail pointer-bearing layouts, so configure a Win32 build with a Visual Studio generator: ```text cmake -S . -B build -A Win32 -DBUILD_TESTING=ON cmake --build build --config Release ctest --test-dir build -C Release --output-on-failure ``` Supply a user-owned ROM or extracted NitroFS tree: ```text build/Release/tingle_native.exe --rom path/to/game.nds build/Release/tingle_native.exe --data path/to/extracted/root ``` Every normal launch automatically records frame inputs to `input-replay.bin` in the repository root. No recording option is required. Replay that session with the same data source by adding `--replay`: ```text build/Release/tingle_native.exe --rom path/to/game.nds --replay input-replay.bin ``` Playback runs 60 neutral 1x frames after the final recorded frame before exiting successfully, allowing it to catch a failure immediately beyond a previously repaired crash. Every launch inventories unrecovered calls without stopping at the first one. Each unique address reached during that launch is written to the ignored `tingle-missing-functions.log` in the repository root. Missing integer and pointer results become zero, so this behavior is diagnostic only: later game state may be invalid and a dependent access can still crash. The former `--continue-missing` option remains accepted for command-line compatibility but is no longer needed. ```text build/Release/tingle_native.exe --replay input-replay.bin ``` Recordings include DS keys and touch plus the host F10 overlay toggle, plus/minus pacing rate, and F1–F9 save-state operations. Playback recreates recorded slots and loads them at the original frame boundaries. Older version-1 and version-2 recordings remain playable with no save-state actions. For interactive automation, launch a paused local named-pipe endpoint and use the bundled client from another terminal: ```text build/Release/tingle_native.exe --agent-control tingle-native python tools/tingle_agent_control.py observe python tools/tingle_agent_control.py step --frames 30 --keys RIGHT python tools/tingle_agent_control.py tap 148 179 python tools/tingle_agent_control.py capture build/agent-frame.bmp python tools/tingle_agent_control.py shutdown ``` Agent mode accepts only raw DS inputs and exact frame counts. It remains paused between commands, records every stepped frame to the separate ignored `agent-input-replay.bin`, and never replaces the latest normal-session `input-replay.bin`. It does not expose gameplay actions or direct state mutation. Touch coordinates use the 256x192 lower screen. With no arguments, the executable tries `build/source-rom` under the configured local decompilation checkout. ## Controls - Move with `WASD` or the arrow keys. - Use `Z`/`X` for the DS A/B buttons and `Q`/`E` for L/R. - Use Enter for Start and Backspace for Select. - Use `+`/`-` (main keyboard or numpad) to step game speed between 0.25x and 16x; the window title shows the active rate. - Press `F1` through `F9` to load process-local save-state slots 1 through 9. - Press Shift+`F1` through Shift+`F9` to replace those slots. The window title reports success or an empty-slot/allocation failure. Slots last until exit. - Press F10 to toggle the host diagnostic overlay. - Left-click the lower screen to touch, hold, drag, and release through the recovered scene interaction callbacks. The executable enters the recovered retail bootstrap, phase-225 splash, phase-90 title, and phase-5 handoff. The former temporary host title preview has been removed; title decisions and presentation now come from the recovered phase, actor, script, and overlay implementations. See [the architecture document](docs/architecture.md) for the boundary details. The repository contains no ROM, extracted assets, Nintendo SDK files, BIOS images, or proprietary compiler binaries.