Subtracting 128 from a byte is the same as turning the highest from 1 to 0. For example if I take 0xC8 (200) and toggle the highest bit, I get 0x48 (72). This is the same thing as subtracting 0x80 (128). This means you can get the value by simply masking out the highest bit:
If you're familiar with bitwise operators you'll understand what that means (I'm pretty sure Java uses the same operators, most C derivatives do). Subtracting 128 works just as well of course, but this way you don't have to check if it's larger than 127 first.
In any case, this means that the highest bit is probably some sort of flag. On the one hand, it could simply be a signed integer flag; 0 = positive, 1 = negative (this is how signed integers are always stored, the high bit defines sign). However I don't see how that could have any function here. It might have some other meaning more important to the compression, although I'm not sure what it could be.
Code:
int loop = file.read() & 7F;
If you're familiar with bitwise operators you'll understand what that means (I'm pretty sure Java uses the same operators, most C derivatives do). Subtracting 128 works just as well of course, but this way you don't have to check if it's larger than 127 first.
In any case, this means that the highest bit is probably some sort of flag. On the one hand, it could simply be a signed integer flag; 0 = positive, 1 = negative (this is how signed integers are always stored, the high bit defines sign). However I don't see how that could have any function here. It might have some other meaning more important to the compression, although I'm not sure what it could be.