Tidy up whitespaces

This commit is contained in:
Marco Thomas
2021-06-11 17:28:47 +02:00
parent 33b22d4a7b
commit a08dfb2f46
5 changed files with 6 additions and 7 deletions

View File

@@ -10,7 +10,7 @@ impl Display {
let video = sdl_ctx.video().unwrap();
let window = video
.window(
"FooBar",
"chip8-rs",
(crate::SCREEN_WIDTH * crate::SCREEN_SCALE) as u32,
(crate::SCREEN_HEIGHT * crate::SCREEN_SCALE) as u32)
.position_centered()
@@ -30,7 +30,7 @@ impl Display {
Display {
canvas,
}
}
}
pub fn draw(&mut self, pixel: &[[u8; crate::SCREEN_WIDTH]; crate::SCREEN_HEIGHT]) {
for (y, &row) in pixel.iter().enumerate() {

View File

@@ -1,5 +1,5 @@
pub (crate) const FONT: [u8; 80] = [
0xF0, 0x90, 0x90, 0x90, 0xF0, // 0
0xF0, 0x90, 0x90, 0x90, 0xF0, // 0
0x20, 0x60, 0x20, 0x20, 0x70, // 1
0xF0, 0x10, 0xF0, 0x80, 0xF0, // 2
0xF0, 0x10, 0xF0, 0x10, 0xF0, // 3

View File

@@ -19,7 +19,7 @@ impl Input {
return Err(());
}
}
// get all inputs
let input: Vec<Keycode> = self.events
.keyboard_state()

View File

@@ -34,5 +34,4 @@ fn main() {
let cartridge = Cartridge::new(&game_file.unwrap());
processor.start(&cartridge.rom);
}

View File

@@ -137,13 +137,13 @@ impl Processor {
// n or nibble - A 4-bit value, the lowest 4 bits of the instruction
let n = nibbles.3 as usize;
// x - A 4-bit value, the lower 4 bits of the high byte of the instruction
let x = nibbles.1 as usize;
// y - A 4-bit value, the upper 4 bits of the low byte of the instruction
let y = nibbles.2 as usize;
//kk or byte - An 8-bit value, the lowest 8 bits of the instruction
let kk = (opcode & 0x00FF) as u8;