Skip to content

Commit

Permalink
faster draw
Browse files Browse the repository at this point in the history
  • Loading branch information
190n committed May 17, 2024
1 parent 5490ef3 commit 73e1ef9
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/tailfuncs.zig
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,7 @@ pub fn draw(cpu: *Cpu, decoded: Decoded.Int, pc: u12) void {
var intersect: u8 = 0;
for (0..@min(n, 32 - y)) |row| {
const left = @bitReverse(cpu.mem[cpu.i + row]) << @truncate(x % 8);
const right = if (x % 8 == 0)
0
else
@bitReverse(cpu.mem[cpu.i + row]) >> @truncate(8 - (x % 8));
const right: u8 = @truncate(@as(u16, @bitReverse(cpu.mem[cpu.i + row])) >> @truncate(8 - (x % 8)));
const index = (64 * (y + row) + x) / 8;
intersect |= (cpu.display[index] & left);
cpu.display[index] ^= left;
Expand Down

0 comments on commit 73e1ef9

Please sign in to comment.