Skip to main content
← PSoXide SDK guides and examples · SDK f2fec1c301f1 · All Cargo features enabled; check feature gates before use.

Module emit

Module emit 

Source
Expand description

Guest-side telemetry event emitters (Expansion 2 MMIO ports).

Every game carried a hand-copied shim of these writes (voxide and hl-psx byte-identical, oot-psx a subset); this module is that shim, once. The MMIO writes compile only with the crate’s emit feature AND a MIPS target; games forward their own flag (emulator-telemetry = ["psx-telemetry/emit"]) so shipping builds pay only empty inlined calls.

Ports (decoded by emulator-core, addresses in psx_hw::memory::expansion2::telemetry): the event word (kind << 24 | id), the value latch (written before the event that consumes it) and the debug-log byte stream.

console is deliberately NOT feature-gated (mips-gated only): it is the Play debug terminal used from normal builds. Use sparingly.

Functions§

console
Write a line to the emulator’s guest debug-log port UNCONDITIONALLY (mips-gated, not feature-gated), so it reaches PSoXide’s Play debug terminal from a normal build. Use sparingly (debug tooling only).
counter
Record value under a counter id (see crate::counter).
cycles
Emulator cycle counter, wrapping at 32 bits. Returns zero on host builds and when the emit feature is disabled, without touching telemetry MMIO.
debug_log
Write a line to the emulator debug log, telemetry builds only.
frame_begin
Mark the start of guest frame frame (drives --guest-frames stops).
stage_begin
Enter a profiling stage (see crate::stage for ids).
stage_end
Leave a profiling stage.
task_begin
Enter a background-task span (see crate::task).
task_end
Leave a background-task span.