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

_start

Function _start 

Source
#[unsafe(no_mangle)]
#[unsafe(link_section = ".text._start")]
pub unsafe extern "C" fn _start(a0: u32, a1: u32, a2: u32) -> !
Expand description

Entry point the PSX-EXE loader jumps to.

The arguments are the MIPS ABI’s first three registers as the loader left them. A BIOS boot leaves garbage there, which is why psx_io::disc_base::install gates on a magic value rather than trusting them; a multi-program loader passes (HANDOFF_MAGIC, disc LBA offset, CD-DA track base) so the SDK can find this program’s data on a disc it does not own.

§Safety

Called exactly once at boot by the loader. The caller must have set up a valid stack pointer before branching here – the PSX-EXE header’s initial_sp_base + initial_sp_offset fields guarantee this.