take last nibble of font address in VX

This commit is contained in:
Denis-Cosmin Nutiu 2024-12-08 16:50:54 +02:00
parent 7001bb747d
commit 5c8eaca55c

View file

@ -365,7 +365,7 @@ where
}
}
ProcessorInstruction::FontCharacter(vx) => {
self.index_register = 0xF0 + (self.registers[vx as usize] as u16) * 5u16;
self.index_register = 0xF0 + (self.registers[vx as usize] as u16 & 0xF) * 5u16;
}
ProcessorInstruction::BinaryCodedDecimalConversion(vx) => {
let number = self.registers[vx as usize];