Skip to content
Snippets Groups Projects
Verified Commit 806b90fe authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

refactor: small performance optimization

parent 46593fd4
No related branches found
No related tags found
No related merge requests found
Pipeline #782 passed
......@@ -331,11 +331,11 @@ impl Chip8Neo {
for y in 0..height {
let line_byte = self.ram[(self.i as usize + y)];
for x in 0..8 {
let yf = (y0 + y) % DISPLAY_HEIGHT;
let xf = (x0 + x) % DISPLAY_WIDTH;
if line_byte & (0x80 >> x) == 0 {
continue;
}
let yf = (y0 + y) % DISPLAY_HEIGHT;
let xf = (x0 + x) % DISPLAY_WIDTH;
let addr = yf * DISPLAY_WIDTH + xf;
if self.vram[addr] == 1 {
self.regs[0xf] = 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment