https://github.com/TTimo/doom3.gpl/blob/master/neo/idlib/Hea...
Surprisingly there's not a lot of platform-specific cruft in that code. The Xbox version of Doom3 must have been a separate code branch.