mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-08-31 09:45:24 +02:00
cpu.status only reported raw CPU ticks, which a client can't turn into a time: the PSP's clock frequency is changeable and games do change it, so the ticks-per-second ratio isn't fixed over a run. CrossCraft Classic runs at 333MHz, so assuming the default 222MHz reads 9.1s where the truth is 6.3s - enough to put scripted input injection in the wrong place entirely. Adds "us" (emulated microseconds) and "clockHz" alongside "ticks". CoreTiming::GetGlobalTimeUs() can't be used directly for this: it rebases its own internal counters as a side effect, and cpu.status is deliberately served straight from the WebSocket thread rather than queued to the CPU thread (it's meant to be cheap and frequently pollable). So PeekGlobalTimeUs() computes the same value without the rebasing. AGENTS.md picks up the things that cost time while driving headless over the websocket API: --sync silently desynchronises on raw JSON lines because only wsdbg's key=value shorthand gets a ticket; headless reports HAS_DEBUGGER as false so anything gated on it silently does nothing there; the memstick is hardcoded next to the executable; a leftover headless process turns a build into an LNK1168 that looks like a compile error; wrapping the launcher in `timeout` kills the emulator along with it, losing the crash you stopped at; response field names aren't uniform (value vs uintValue); broadcast.config.set rejects two of the four keys the docs list. Also writes down the ELF-as-oracle technique that cracked the relocation bug - when homebrew ships app.elf next to app.prx, the pre-link ELF still has the symbols and the relocation symbol indices the PRX format discards, so the loader's output can be checked exhaustively offline instead of by re-running. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GZq8ZtJmFY7bkX5FVkr3P9