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

Crate psx_rt

Crate psx_rt 

Source
Expand description

PS1 bare-metal runtime.

Provides the _start entry point that the PSX-EXE loader jumps to, a panic handler, direct i-cache control, a BIOS TTY debug trampoline, and optional heap initialisation. Homebrew crates depend on this crate to get a working main() environment without thinking about linker symbols or cache-flushing.

§Entry sequence

  1. The loader (our emulator or the real BIOS) copies the EXE payload to LOAD_ADDR and jumps to _start.
  2. _start zeroes the .bss section using the linker-defined __bss_start / __bss_end symbols.
  3. With the alloc feature, the bump allocator is seeded from __heap_start..__heap_end.
  4. main() is called. When it returns, we halt.

Modules§

bios
The runtime’s one remaining BIOS entry point: TTY putchar.
cache
Instruction-cache invalidation, done directly on the hardware.
critical_section
Critical sections: run code with CPU interrupts masked.
heap
Bump allocator gated behind the alloc feature.
interrupts
Minimal interrupt support used by engine-level clocks.
present
VBlank-kicked presentation: a one-frame-deep queue between the CPU and the GPU. Built with the present-queue feature.
scratchpad
The CPU scratchpad, and running code with its stack there.
tty
TTY output for debug printing.

Structs§

Peripherals
Every shared-state peripheral token, handed out once.

Functions§

_start⚠
Entry point the PSX-EXE loader jumps to.
assert_stack_headroom
Trap (loudly, via TTY) if the live stack pointer has descended into the static data region.
halt
Infinite loop with no useful side effects. Used after main() returns or from panic / reset paths.