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