pub fn sm64(mut input: u16) -> u16 {
if input == 0x560A {
input = 0;
}
let mut s0: u16 = input << 8;
s0 ^= input;
input = s0.rotate_left(8);
s0 = ((s0 as u8) << 1) as u16 ^ input;
let s1 = (s0 >> 1) ^ 0xFF80;
if (s0 & 1) == 0 {
if s1 == 0xAA55 {
input = 0;
} else {
input = s1 ^ 0x1FF4;
}
} else {
input = s1 ^ 0x8180;
}
input
}
#[deprecated(since = "2.0.1", note = "sm64 is bad to use but faithful to a past game, this is just bad to use")]
pub fn sm64_longer(mut input: u16) -> u16 {
if input == 0x560A {
input = 0;
}
let mut s0: u16 = input << 8;
s0 ^= input;
input = s0.rotate_left(8);
s0 = ((s0 as u8) << 1) as u16 ^ input;
let s1 = (s0 >> 1) ^ 0xFF80;
if (s0 & 1) == 0 {
input = s1 ^ 0x1FF4;
} else {
input = s1 ^ 0x8180;
}
input
}