mirror of
https://github.com/mattrberry/crab.git
synced 2025-01-30 20:34:45 +01:00
clean up affine screen entry logic
This commit is contained in:
parent
a2ccafefa2
commit
09481ae54d
1 changed files with 4 additions and 8 deletions
|
@ -201,14 +201,10 @@ class PPU
|
||||||
end
|
end
|
||||||
next unless 0 <= x < size_pixels && 0 <= y < size_pixels
|
next unless 0 <= x < size_pixels && 0 <= y < size_pixels
|
||||||
|
|
||||||
screen_entry = @vram[screen_base + (y >> 3) * size + (x >> 3)].to_u16
|
# affine screen entries are merely one-byte tile indices
|
||||||
|
tile_id = @vram[screen_base + (y >> 3) * size + (x >> 3)]
|
||||||
tile_id = bits(screen_entry, 0..9)
|
pal_idx = @vram[character_base + 0x40 * tile_id + 8 * (y & 7) + (x & 7)]
|
||||||
y = (y & 7) ^ (7 * (screen_entry >> 11 & 1))
|
pal_buf[col] = pal_idx
|
||||||
x = (x & 7) ^ (7 * (screen_entry >> 10 & 1))
|
|
||||||
|
|
||||||
pal_idx = @vram[character_base + tile_id * 0x40 + y * 8 + x]
|
|
||||||
pal_buf[col] = pal_idx.to_u8
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue