marqs85 / ossc

Open Source Scan Converter
http://junkerhq.net/xrgb/index.php/OSSC
GNU General Public License v3.0
468 stars 63 forks source link

[Request] 400p VGA mode auto detection #110

Open wbcbz7 opened 5 months ago

wbcbz7 commented 5 months ago

Hello, I've been using OSSC with a couple of retro PC/DOS machines. As you may know, there are two 400p VGA modes - 720x400 (used in text mode) and 640x400 (used by graphics modes like Mode 0x0D/0x13). There is no general way for VGA display device to differ between these modes, since they share the same sync timings and polarity - as a consequence, when using OSSC, you need to manually switch between 640x400 and 720x400 when running a game from console or returning back to the text mode. However, there is another VGA mode (640x350 mode 0x10), which uses different sync polarity, but in fact uses the 640x400 timings (info here) with larger vertical blanking, and, on some monitors (primarly LCD) it actually appears as letterboxed 640x350 picture over 640x400 raster.

I've made a TSR utility called LCD640, which, for every graphics mode that uses 640x400 raster (e.g. 320x200 or 640x200), sets sync polarity from 640x350 mode; on some LCD displays, whose treat 640x350 as 640x400, this have a positive impact on image sampling quality. Therefore, it would be nice to have an option to autodetect the 400p mode from sync polarity. As a reference, I've modded a 0.90 firmware with these changes, but as 1.x branch bringing more improvements in other aspects, there may be a better approach for this problem.

Thanks in advance! :)

marqs85 commented 5 months ago

I'll consider adding this for next v1.xx series firmware.

For OSSC Pro vertical sync polarity could be set separately to differentiate between x350 and x400 modes since it already has presets for all 4 modes (640x350, 720x350, 640x400, 720x400).