Expand description
Where this program’s data sits on the disc it was booted from.
A program that owns its disc knows exactly where everything is: pack LBAs are cooked in, CD-DA tracks are numbered from 2. Put several programs on one disc and those absolutes stop being absolute. Rather than re-cook every program for every disc it might ship on, a multi-program loader hands over two numbers at boot and the SDK’s disc entry points apply them.
Both default to zero, so a program booted the ordinary way – BIOS reads
SYSTEM.CNF, runs the one EXE – behaves exactly as it did before this
module existed. Nothing needs a separate build to work on both.
The handover is by register, not by an agreed memory address: there is no
address the SDK can prove a game will leave alone (hl-psx already uses the
scratchpad, and a headerless PSX-EXE gives no way to bound .bss).
psx-rt’s _start takes the loader’s
arguments and calls install before anything else runs.
Constants§
- HANDOFF_
MAGIC - Marks
$a0as a loader handover rather than boot-time register garbage. ASCIIPSXD.
Functions§
- cdda_
track_ base - CD-DA tracks belonging to programs ahead of this one on the disc.
- install⚠
- Record the loader’s handover, if
magicsays there is one. - lba_
offset - Sectors between the disc’s LBA 0 and this program’s.
- shift_
lba - Translate a disc-relative LBA into a physical one.
- shift_
track - Translate a program-relative CD-DA track number into a physical one.