Quote:
Originally Posted by dimasic
It does not work at all. Dark grey background with no visible information.
In K4 reading of framebuffer with read() function returns bytes, in which high 4 bits are equal to low 4 bits. So all the bytes look as 00, 11, 22, ... FF. But I can't find the way to translate XX into 0X - and not sure that it should be so in the resulting 8bit pgm. I'm not familiar with Lua and had not programming practice for years, alas. I tried to build array as for 4bpp devices, but with different values; tried to read values byte by byte and divide them with math.floor by 16, but it won't work still.
I would appreciate your help, but I'll try to do it by myself. It's interesting task for me.  Anyway, it's possible to make inverted screenshot and invert it with external tools - any raster graphics editor or something like imagemagick, it's not a big problem.
|
Yes, that 4bits duplicated in the high/low nibble of a byte is a hardware requirement.
Just set the high 4 bits to zero - the image is stored 4bits per byte.