Constant moa_peripherals_yamaha::ym2612::FNUMBER_TO_KEYCODE
source · const FNUMBER_TO_KEYCODE: &[u8];
Expand description
Map the upper 5 bits of the fnumber to the lower 2 bits of the keycode
The upper of the two bits is bit 11 of the fnumber, and the lower bit is follows the formula F11 & (F10 | F9 | F8) | !F11 & (F10 & F9 & F8), where the bit numbers of the fnumber value start from 1 instead of 0. It’s easier to map this with an lookup table than to calculate this.
K1 = F11 K0 = F11 & (F10 | F9 | F8) | !F11 & (F10 & F9 & F8)