mirror of
https://git.k-space.ee/arti/vt1200.git
synced 2026-11-02 12:23:17 +02:00
12 lines
488 B
Python
12 lines
488 B
Python
from tools.check_vram import vram_to_logical
|
|
|
|
|
|
def test_vram_downsamples_2x2_lsb_first():
|
|
# VRAM bit 1 is white, bit 0 is black (the driver's palette).
|
|
vram = bytearray(256 * 1024)
|
|
vram[0] = 0x0C # bits 2 and 3 white in row 0
|
|
vram[256] = 0x0C # bits 2 and 3 white in row 1
|
|
logical = vram_to_logical(bytes(vram), width=640, height=512, scale=2)
|
|
assert logical[0, 0] # bits 0..1 are black
|
|
assert not logical[0, 1] # bits 2..3 are white
|