updated innovate plugins

git-svn-id: https://svn2.assembla.com/svn/romraider/trunk@20 38686702-15cf-42e4-a595-3071df8bf5ea
This commit is contained in:
kascade 2008-04-07 11:55:30 +00:00
parent 68c6bb8d0d
commit 3949d86601
1 changed files with 18 additions and 18 deletions

View File

@ -31,26 +31,16 @@ public final class Lm1DataConvertor implements DataConvertor {
}
private double getAfr(byte[] bytes) {
return (getLambda(bytes) + 500) * getAF(bytes) / 10000.0;
return (getLambda(bytes) + 500) * getAf(bytes) / 10000.0;
}
private int getAF(byte[] bytes) {
private int getAf(byte[] bytes) {
return (((bytes[2] | 254) & 1) << 7) | bytes[3];
}
// 00xxxxxx 0xxxxxxx
private int getLambda(byte[] bytes) {
return (bytes[4] << 7) | bytes[5];
}
// 1x00000x
private boolean isOk(byte[] bytes) {
return matchOnes(bytes[2], 128) && matchZeroes(bytes[0], 62);
}
// 1x01100x
private boolean isError(byte[] bytes) {
return matchOnes(bytes[2], 152) && matchZeroes(bytes[2], 38);
// 1x0xxx0x
private boolean isLm1(byte[] bytes) {
return bytes.length >= 6 && matchOnes(bytes[2], 128) && matchZeroes(bytes[2], 34);
}
// 1x11xx1x 1xxxxxxx
@ -58,9 +48,19 @@ public final class Lm1DataConvertor implements DataConvertor {
return matchOnes(bytes[0], 178) && matchOnes(bytes[1], 128);
}
// 1x0xxx0x
private boolean isLm1(byte[] bytes) {
return bytes.length >= 6 && matchOnes(bytes[2], 128) && matchZeroes(bytes[2], 34);
// 1x00000x
private boolean isOk(byte[] bytes) {
return matchOnes(bytes[2], 128) && matchZeroes(bytes[2], 62);
}
// 1x01100x
private boolean isError(byte[] bytes) {
return matchOnes(bytes[2], 152) && matchZeroes(bytes[2], 38);
}
// 00xxxxxx 0xxxxxxx
private int getLambda(byte[] bytes) {
return (bytes[4] << 7) | bytes[5];
}
private boolean matchOnes(int b, int mask) {