This is scaling code; OSD wants 0 to 99 vs 0 to 255 the uint8_t function gives. Use the unerlying 0-1 function in the OSD code in preference to unscaling it from 255 then scaling to 99