fn op_Dxyn(&mut self, x: usize, y: usize, n: usize) {
        let x_left = self.V[x] as usize;
        let y_top = self.V[y] as usize;
        let sprite = &self.memory[self.I..self.I + n];

        let any_pixel_erased = self.canvas.draw_sprite(x_left, y_top, sprite);
        self.V[0xF] = if any_pixel_erased { 1 } else { 0 };

        self.pc.goto_next();
    }
// Read n bytes from memory starting at address written in register I.
// Draw those bytes starting at coordinate (Vx, Vy), treating each byte
// as a row of pixels. If part of the sprite is outside of display
// boundaries, it wraps around to the opposite side of the display.
Read n bytes from memory starting at address written in register I.
Draw those bytes starting at coordinate (Vx, Vy), treating each byte
as a row of pixels. If part of the sprite is outside of display
boundaries, it wraps around to the opposite side of the display.
Read n bytes from memory starting at address written in register I . Draw those bytes starting at coordinate ( Vx Vy ) treating each byte as a row of pixels . If part of the sprite is outside of display boundaries it wraps around to the opposite side of the display .
fn op_Dxyn(&mut self, x: usize, y: usize, n: usize) {
        let x_left = self.V[x] as usize;
        let y_top = self.V[y] as usize;
        let sprite = &self.memory[self.I..self.I + n];
        let any_pixel_erased = self.canvas.draw_sprite(x_left, y_top, sprite);
        self.V[0xF] = if any_pixel_erased { 1 } else { 0 };
        self.pc.goto_next();
    }
fn op_Dxyn ( & mut self , x : usize , y : usize , n : usize ) { let x_left = self . V [ x ] as usize ; let y_top = self . V [ y ] as usize ; let sprite = & self . memory [ self . I .. self . I + n ] ; let any_pixel_erased = self . canvas . draw_sprite ( x_left , y_top , sprite ) ; self . V [ 0xF ] = if any_pixel_erased { 1 } else { 0 } ; self . pc . goto_next ( ) ; }
Read n bytes from memory starting at address written in register I.
Read n bytes from memory starting at address written in register I .
&mut self
x
usize
y
usize
n
usize
&mut self
x
usize
y
usize
n
usize