ORIGIN=0x25D000
def install(data,assemble,patch):
 assert data[0x9CD8:0x9CDC]==bytes.fromhex('61007258'),'native fading close entry changed'
 code=assemble('grey_panels',ORIGIN)
 assert len(code)<0x3000
 patch(ORIGIN,b'\xff'*len(code),code)
 for at,old,target in [(0x9BD8,'48e7c02061007354',ORIGIN+16),(0x9CDC,'3f38bf7808f80002bf78',ORIGIN+20),(0x11C52,'d04230805278b028',ORIGIN+24)]:
  original=bytes.fromhex(old);patch(at,original,bytes.fromhex('4ef9')+target.to_bytes(4,'big')+bytes.fromhex('4e71')*((len(original)-6)//2))

 # Cosmetic period-statistics layout: second48px club badge and its figures
 # move up two tile rows to fit above the framed footer, without altering values.
 patch(0xFD9B4,bytes.fromhex("8e021400"),bytes.fromhex("8e021200"))
 patch(0xFDB7C,bytes.fromhex("31fc0016b02a"),bytes.fromhex("31fc0014b02a"))
