"""Guarded CPU forward-unit coaching with unchanged native roster/energy/profile data."""
ORIGIN=0x2DD400
def install(data,assemble,patch):
    code=assemble('coach_lines',ORIGIN)
    assert 0<len(code)<0x800,'line coach exceeds reserved ROM block'
    patch(ORIGIN,b'\xff'*len(code),code)
    patch(0x1584C,bytes.fromhex('43ea016a302a0016'),b'\x4e\xf9'+ORIGIN.to_bytes(4,'big')+bytes.fromhex('4e71'))
    patch(0x12EB8,bytes.fromhex('43ea016ae740'),b'\x4e\xf9'+(ORIGIN+4).to_bytes(4,'big'))
