Switchres: Basic minimum requirements

So I did manage to get native 288p (or do we simply refer NES native as 240p?). All this is happening via Gert VGA adapter > VGA-to-component > CRT TV.

Since I got native 288p, I was assuming there would be scanlines (that’s the term Google prefers). Does it look like I have scanlines? I don’t think so. What’s happening?

config: dpi_group=2 dpi_mode=87 hdmi_timings=360 0 16 64 48 288 0 5 5 15 0 0 0 50 0 7642200 1

Google Photos

And as per my tests, the calamity of switchres requires minimum 3 things:

  1. FKMS
  2. Bullseye
  3. Running Desktop

Any inputs are very appreciated. Thanks.

So here’s a solution for everyone looking to get switchres working.

  1. Connect Raspberry Pi to the external monitor without using any kind of scaling adapter. The thing that worked for me was the Gert VGA HAT. Depending on your CRT’s input capabilities you’ll convert this into SCART / Component / S-Video.
  2. You’ll use custom display mode and for that you’ll need to make one and enforce it
  3. sudo vim /boot/firmware/config.txt
  4. Use this code with KMS driver: Careful! Lines over 80 characters are ignored)
dtoverlay=vc4-kms-dpi-generic,rgb666,clock-frequency=4898400
dtparam=hactive=256,hsync-invert,hfp=7,hsync=23,hbp=28
dtparam=vactive=240,vsync-invert,vfp=27,vsync=2,vbp=4
  1. Alternatively with fkms you can use
dpi_group=2 # Legacy alternative
dpi_mode=87 # Legacy alternative
dpi_timings=256 1 7 23 28 240 1 27 2 4 0 0 0 50 0 4898400 1 # Legacy alternative: https://www.raspberrypi.com/documentation/computers/legacy_config_txt.html
  1. For the splash logo: sudo vim /boot/firmware/cmdline.txt
console... ... rootwait quiet splash video=DPI-1:256x240@50e
  1. Now you’ll notice with or without switchres, your CRT will look pixel perfect. So for NES and SNES, with this setup you’ll not need it. The time when you’ll really need it is when you play multiple consoles which require switching the timings on the run. Switchres can be turned on with mode set to 15Khz or 30KHz etc. or INI. I setup my monitor as “pal” in /etc/switchres.ini
  2. For the video settings, I use aspect ratio to “full” or core provided.

Background info:

git clone https://github.com/libretro/RetroArch
cd RetroArch/deps/switchres
make

To calculate display timings / modeline:

./switchres 246 240 50 -m pal -c -vvvv # pal CRT: Modeline "246x240_50 15.600000KHz 50.000000Hz" 4.711200 246 253 275 302 240 267 269 312   -hsync -vsync
# leaving NTSC as a homework.
./switchres 246 240 50 -m generic_15 -c  -vvvv # generic_15 CRT: Switchres: Modeline "246x240_50 15.650000KHz 50.000000Hz" 4.992350 246 256 279 319 240 268 271 313   -hsync -vsync

Adapt modeline to FKMS dpi_timings or KMS dtparam. Use Chat-GPT with care to adapt.

PS: Happy to share any details upon request.

@alexb3d Dear Alex, Those devices will not work. The hdmi to composite has a built-in scaler and outputs interlaced. Useless for 240p gaming.

Fixeds incorrect resolution in modelines

Modeline "256x240_50 15.600000KHz 50.000000Hz" 4.898400 256 263 286 314 240 267 269 312   -hsync -vsync # Pal
Modeline "256x240_50 15.650000KHz 50.000000Hz" 5.180150 256 266 290 331 240 268 271 313   -hsync -vsync # generic_15