fix font character instruction

This commit is contained in:
Denis-Cosmin Nutiu 2024-12-08 16:49:27 +02:00
parent ca97cb7de8
commit 7001bb747d
2 changed files with 5 additions and 5 deletions

View file

@ -76,7 +76,7 @@ impl Display for RatatuiDisplay {
.title("Chip8 Emulator by nuculabs.dev") .title("Chip8 Emulator by nuculabs.dev")
.borders(Borders::ALL), .borders(Borders::ALL),
) )
.marker(Marker::HalfBlock) .marker(Marker::Braille)
.paint(|ctx| { .paint(|ctx| {
for row in 0..DISPLAY_HEIGHT { for row in 0..DISPLAY_HEIGHT {
for column in 0..DISPLAY_WIDTH { for column in 0..DISPLAY_WIDTH {

View file

@ -365,7 +365,7 @@ where
} }
} }
ProcessorInstruction::FontCharacter(vx) => { ProcessorInstruction::FontCharacter(vx) => {
self.index_register = 0xF0 + (self.registers[vx as usize] & 0x0F) as u16; self.index_register = 0xF0 + (self.registers[vx as usize] as u16) * 5u16;
} }
ProcessorInstruction::BinaryCodedDecimalConversion(vx) => { ProcessorInstruction::BinaryCodedDecimalConversion(vx) => {
let number = self.registers[vx as usize]; let number = self.registers[vx as usize];
@ -386,13 +386,13 @@ where
} }
} }
ProcessorInstruction::GetKeyBlocking(_vx) => { ProcessorInstruction::GetKeyBlocking(_vx) => {
todo!("must implement") //todo!("must implement")
} }
ProcessorInstruction::SkipIfKeyIsPressed(_vx) => { ProcessorInstruction::SkipIfKeyIsPressed(_vx) => {
todo!("must implement") //todo!("must implement")
} }
ProcessorInstruction::SkipIfKeyIsNotPressed(_vx) => { ProcessorInstruction::SkipIfKeyIsNotPressed(_vx) => {
todo!("must implement") //todo!("must implement")
} }
_ => { _ => {
warn!("Unknown instruction: {:04x}, skipping.", instruction); warn!("Unknown instruction: {:04x}, skipping.", instruction);