pub fn real_pif_boot(
system: &mut System,
rom: &[u8],
pif_rom: &[u8],
) -> Result<(), BootError>Expand description
Real-PIF boot a retail ROM — the faithful path (off by default, local).
Where hle_boot seeds the post-IPL3 state and jumps straight into the
cartridge’s IPL3, this runs the console’s real IPL1 and IPL2 from the
supplied PIF boot ROM: it installs that ROM at 0x1FC0_0000, models the
PIF-SM5’s power-on hand-off (writes the CIC seed word the CIC would have
relayed into PIF RAM 0x24, and registers the CIC’s IPL2 checksum so the PIF
can adjudicate IPL2’s verify command), and leaves the CPU at its reset vector
0xBFC0_0000. The CPU then fetches IPL1 → copies IPL2 to IMEM → runs IPL2 →
verifies the checksum → jumps into the cart’s own IPL3, exactly as hardware
does (n64brew_wiki/markdown/PIF-NUS.md §Console startup).
The PIF boot ROM is copyrighted and is never committed; a caller supplies
a local dump. On a genuine cartridge the checksum matches and boot proceeds;
a mismatch makes the PIF freeze the CPU via NMI (crate::Bus::boot_nmi_halt).
§Errors
BootError::TooSmall if rom is shorter than a 0x1000 boot header or
pif_rom is shorter than the PIF-ROM window.