Reading guest RAM from outside the emulator is easy -- Canary backs it with a
/dev/shm file, so a host process can just pread it -- but it is UNSYNCHRONISED.
The reader has no idea where the guest is in its update, so successive reads are
separated by an unknown, jittering number of guest updates.
That is not a theoretical concern. Measuring the player craft's angular velocity
this way produced 3x swings between adjacent 0.25 s windows, which made it
impossible to tell "the rate ramps up after the stick goes over" from "the
sampler is aliasing" -- the one question standing between a confirmed law shape
and its absolute scale. Widening the window does not rescue it either: a hold
long enough to average bleeds the speed, and speed is the variable under test.
So sample from inside, in VdSwap: the guest's own thread, once per guest frame,
at a fixed point in it. Consecutive lines are then exactly one frame apart by
construction and the frame counter is exact.
Which bytes to sample is not known at launch -- object addresses are found by
scanning at runtime -- so the regions come from a small control file that is
re-read whenever its mtime changes, the same trick the file input pad uses:
0x40D10590 128 a guest VA and a byte count, one region per line
and each frame appends
F <frame> H <host_ns> G <guest_ticks> R0 <hex> R1 <hex> ...
Reads are bounds-checked through LookupHeap/QueryProtect and copied out before
printing, so an unmapped or stale address logs "-" instead of taking the
emulator down. Header-only and off unless --frame_probe_log is set, so it adds
no build target and no cost to anyone not using it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Xenia Canary - Xbox 360 Emulator
Xenia Canary is an experimental fork of the Xenia emulator. For more information, see the Xenia Canary wiki.
Come chat with us about emulator-related topics on Discord.
For developer chat join #dev but stay on topic. Lurking is not only fine, but encouraged!
Please check the FAQ page before asking questions.
We've got jobs/lives/etc, so don't expect instant answers.
Discussing illegal activities will get you banned.
Status
| Buildbot | Status | Releases |
|---|---|---|
| Canary (🪟, 🐧) | Latest ◦ All ◦ Old |
Experimental Netplay
| Buildbot | Status | Releases |
|---|---|---|
| Windows | Latest |
Quickstart
See the Quickstart page.
FAQ
See the frequently asked questions page.
Game Compatibility
See the Game compatibility list for currently tracked games, and feel free to contribute your own updates, screenshots, and information there following the existing conventions.
Building
See building.md for setup and information about the
xb script. When writing code, check the style guide
and be sure to run clang-format!
Contributors Wanted!
Have some spare time, know advanced C++, and want to write an emulator? Contribute! There's a ton of work that needs to be done, a lot of which is wide open greenfield fun.
For general rules and guidelines please see CONTRIBUTING.md.
Fixes and optimizations are always welcome (please!), but in addition to that there are some major work areas still untouched:
- Help work through missing functionality/bugs in games
- Reduce the size of Xenia's huge log files
- Skilled with Linux? A strong contributor is needed to help with porting
See more projects good for contributors. It's a good idea to ask on Discord and check the issues page before beginning work on something.
Disclaimer
The goal of this project is to experiment, research, and educate on the topic of emulation of modern devices and operating systems. It is not for enabling illegal activity. All information is obtained via reverse engineering of legally purchased devices and games and information made public on the internet (you'd be surprised what's indexed on Google...).