bitluni / ESP32Lib

http://bitluni.net/esp32-vga/
441 stars 78 forks source link

1-bit implementation #22

Closed provokateurin closed 3 years ago

provokateurin commented 5 years ago

Some projects only need black and white displays or only have such. It would be nice to have one.

Martin-Laclaustra commented 4 years ago

@bitluni I implemented the 1-bit buffer VGA. The output still needs at least 3 pins (signal, hsync, vsync), so it is implemented with 5 pins output, the same as the 3-bit driver (you can choose to use just 3, but with 5 you have the option to draw using 2 constant colors). It would make no sense to create a high performance 1-bit driver because it would use the same amount of memory as the 3-bit one, for high performance choice, just use that one. However, for applications with constrained memory requirements, the interrupt based 1-bit driver used 8 times less memory. This allows experimenting with higher resolutions. I tested MODE400x600 = Mode(12, 36, 64, 400, 1, 2, 22, 600, 1, 18000000, 0, 0). For higher resolutions, each line is not rendered fast enough. I suspect that interruptPixelLine function could be optimized for speed. It is implemented in #41, which it is based on #38.

Martin-Laclaustra commented 4 years ago

I improved the rendering algorithm and now it is faster. It works for resolutions: MODE640x480 MODE720x400 and MODE512x768 = Mode(12, 68, 80, 512, 3, 6, 29, 768, 1, 32500000, 1, 1)

Martin-Laclaustra commented 3 years ago

This is included in the "development" branch here and eventually it will be merged into "master".