# place.txt -- where the race physics' hot functions run (tools/gbalink.py GBALINK_PLACE):
# FUNCTION REGION, the region "iwram" (resident) or an overlay's name, which gba/main.c copies
# into IWRAM before its phase of the tick runs (gba/race.c, sim/car.c sim_tick_phase); the rest
# stays in the cartridge.  tools/ovlcheck.py checks that no phase reaches another's code.
# entry sim0 sim_tick_input
# entry sim1 sim_step_forces
# entry sim0 sim_step_collide
# entry sim0 sim_tick_after
# calls sim_tick_after sim_cam_incar
# dispatch sim_tick_phase BrCarPhysTick BrCarPhysStep
# dispatch BrCarPhysAdvance BrCrRespWalk
# ok race_start sim_cam_incar

# every phase's
BrMat4RotateVec         iwram
BrMat4RotateVecT        iwram
BrMat3MulVecRows        iwram
BrMat3MulVec            iwram
BrMat3Mul               iwram
BrQuatToMat             iwram
BrRbQuatDerivative      iwram
BrRbVelAtPoint          iwram
BrVec3NormaliseF        iwram
BrCollGridCellAcquire   iwram
sim_cell_pick           iwram
sim_pick_box            iwram
sim_tri_contains        iwram

# 0, 2, 3 (one overlay): the ground ray and the pad; the collision; the wheels on the ground,
# the matrices, the camera
sim_tick_input          sim0
BrGroundRay             sim0
sim_step_collide        sim0
sim_collide_lite        sim0
BrRbStateStep           sim0
BrCrImpulseSolve        sim0
sim_tick_after          sim0
sim_step_ground         sim0
BrTyreDepthAll          sim0
BrWheelGroundProbe      sim0
sim_probe_walk          sim0
sim_probe_last          sim0
sim_cam_incar           sim0

# 1 (its own overlay): the forces
sim_step_forces         sim1
BrTyreSprings           sim1
BrWheelTyre             sim1
BrRbForcesClear         sim1
forces_sum              sim1
BrRbSolveAccel          sim1
BrRbIntegrate           sim1
BrCarAxleGrip           sim1
BrRbVelAtFlatPoint      sim1
BrRbVelAtBodyPoint      sim1
BrTyreSkidCheck         sim1
BrTyreLoads             sim1

