First post, by IanB
I recently started contributing to an open source project first developed by hoglet on the stardot forums, to convert the TTL RGB outputs of the Acorn BBC micro and Electron to HDMI / DVI using a Raspberry Pi Zero and a small CPLD on a 'Hat' PCB. My initial contributions were to get deinterlacing working for the BBC's mode 7 teletext output and also to support genlocking so that the Pi's video output was locked to the source. Original thread here: https://stardot.org.uk/forums/viewtopic.php?f=3&t=14430
These Acorn machines have TTL RGB ouputs similar to CGA and I thought it might be worth trying to get it working on such sources. After a lot of code optimisation in ARM assembler and reworking the CPLD, we now have it working with MDA / CGA / EGA type sources and also with monochrome non-TTL sources like the ZX80/ZX81, Apple II, UK101 using a small external circuit to extract the sync and video.
Here is a photo of the adapter:
The system will work up to VGA frequencies with 6 bits/pixel although you need a card that will output VGA over TTL 9 pin D-type or an EGA+ type card to use those high resolutions and it is menu driven with multiple profiles stored on SD card so you can tweak any of the parameters like clock frequency, line length, size etc to support any number of non-standard outputs. Also it will autoswitch between all the profiles in a "switching set" and you can have multiple switching sets.
One interesting option that it supports is integer scaling where the original pixels of the source are scaled to an exact multiple of pixels on the LCD panel without any interpolation filter which makes the output look very sharp like it's at the native resolution of the panel. The disadvantage is that the image won't completely fill the screen but the quality difference is so great it is well worth it. (You can select normal interpolation to fill the screen if preferred).
Normal scaling with interpolation (view full size):
Integer scaling (view full size):
There is an option to screencap the displayed output to the Pi's SD card so here are some more examples captured in this way.
If you view these at 100% on a 1080p monitor you will see the exact quality you get from the output using integer scaling:
(Click on the thumbnails then click again on the images to get them at 100%)
EGA 640x200 60Hz:
CGA 640x200 60Hz: