fix clear display instruction
This commit is contained in:
parent
680ee8adeb
commit
aa27658864
2 changed files with 6 additions and 3 deletions
|
@ -201,9 +201,10 @@ where
|
||||||
match instruction.processor_instruction() {
|
match instruction.processor_instruction() {
|
||||||
ProcessorInstruction::ClearScreen => {
|
ProcessorInstruction::ClearScreen => {
|
||||||
trace!("Clear display");
|
trace!("Clear display");
|
||||||
|
self.display_data = [false; DISPLAY_WIDTH * DISPLAY_HEIGHT];
|
||||||
self.display.clear()
|
self.display.clear()
|
||||||
}
|
}
|
||||||
ProcessorInstruction::Jump(address) => {
|
ProcessorInstruction::Jump {address} => {
|
||||||
trace!("Jump to address {:04x}", address);
|
trace!("Jump to address {:04x}", address);
|
||||||
self.program_counter = address
|
self.program_counter = address
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ pub enum ProcessorInstruction {
|
||||||
/// Clears the screen
|
/// Clears the screen
|
||||||
ClearScreen,
|
ClearScreen,
|
||||||
/// Jumps to a given address
|
/// Jumps to a given address
|
||||||
Jump(u16),
|
Jump {address: u16},
|
||||||
/// Sets the register in the first argument to the given value
|
/// Sets the register in the first argument to the given value
|
||||||
SetRegister(u8, u8),
|
SetRegister(u8, u8),
|
||||||
/// Adds the value to the register
|
/// Adds the value to the register
|
||||||
|
@ -125,7 +125,9 @@ impl Instruction {
|
||||||
// Jump
|
// Jump
|
||||||
(0x1, _, _, _) => {
|
(0x1, _, _, _) => {
|
||||||
// 1NNN
|
// 1NNN
|
||||||
ProcessorInstruction::Jump(Self::grab_inner_data(data))
|
ProcessorInstruction::Jump {
|
||||||
|
address: Self::grab_inner_data(data)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Set Register
|
// Set Register
|
||||||
(0x6, _, _, _) => {
|
(0x6, _, _, _) => {
|
||||||
|
|
Loading…
Reference in a new issue