>>105737842
managed to do it, but not really sure if the extra code size is worth it
any suggestions for improvements?
also, i only quickly tested it, but it seems to work