Skip to content

Commit

Permalink
fix: mangled drawing in hires mode
Browse files Browse the repository at this point in the history
The loop iterating through the rows of a 16x16 hires sprite would take
non-disjoint 2-byte chunks per row, which led to mangled sprite drawing.

It now correctly takes disjoint 2-byte windows per row.
  • Loading branch information
nikoof committed Nov 24, 2023
1 parent 77c6ef3 commit 3d5aa7d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/interpreter/schip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,8 @@ where
break;
}
let sprite_row = u16::from_be_bytes([
self.memory[self.index + y_offset],
self.memory[self.index + y_offset + 1],
self.memory[self.index + 2 * y_offset],
self.memory[self.index + 2 * y_offset + 1],
]);
for x_offset in 0..16 {
if x + x_offset >= DISPLAY_WIDTH {
Expand Down

0 comments on commit 3d5aa7d

Please sign in to comment.