Geometry Adjustments for videomodes.conf - ZFEbHVUE/Batocera-CRT-Script GitHub Wiki

🧭 Geometry Adjustments for videomodes.conf

This page explains how to use geometry parameters in videomodes.conf to fine-tune screen size and position on a CRT.

These geometry adjustments directly affect the modeline generated by SwitchRes, acting like digital equivalents of analog scaling and shifting.


πŸ“š Table of Contents (click to expand)

πŸ”§ What Are Geometry Adjustments?

SwitchRes allows you to apply fine-grained geometry changes to a video mode using the -g or --geometry parameter:

-g <h_size>:<h_shift>:<v_shift>

These parameters changes:

  • Analog horizontal size (width)
  • Horizontal position
  • Vertical position

They are particularly useful when:

  • You want to make persistent, resolution-specific corrections

πŸ“ Geometry Format

h_size:h_shift:v_shift
Parameter Description Example
h_size Horizontal scaling multiplier (1.0 = normal width) 1.1 (10% wider)
h_shift Horizontal position offset (left/right) -2 (shift left)
v_shift Vertical position offset (up/down) 3 (shift down)

These values adjust the actual modeline timings, so the effect is precise and resolution-specific.


🚦 Valid Ranges

As defined in the SwitchRes source code:

Parameter Min Max Notes
h_size 0.5 2.0 1.0 = default width
h_shift -100 100 Pixel-based offset
v_shift -100 100 Pixel-based offset

πŸ›‘ If values fall outside these ranges, SwitchRes will silently ignore them.


πŸ” Viewing Geometry Changes with Grid Tool

To preview how geometry values affect the screen, use the Grid Tool with a test modeline:

DISPLAY=:0 switchres 384 224 60 -f 384x224@60 -g 1.1:-1:2 -s -l grid

Breakdown:

  • -g 1.1:-1:2 β€” Increases width by 10%, shifts image slightly left and down
  • -s β€” Applies the mode
  • -l grid β€” Loads the test pattern

πŸ’‘ This is very useful for live tweaking.


πŸ“ Example Entry in videomodes.conf

If you’ve found good values using the test command above, you can persist them in videomodes.conf.

384x224.60.00054:384x224 1.1:-1:2 15KHz 60Hz
Field Value
Resolution string 384x224.60.00054
Geometry adjustment 1.1:-1:2
Label/description 15KHz 60Hz

πŸ“ You should add this to both:

  • /userdata/system/videomodes.conf
  • /userdata/system/videomodes.conf.bak

🧠 Tips and Best Practices

  • Start small β€” try 1.05, -2, or 3 before jumping to extreme values.
  • Don’t overdo h_size; going above 1.25 may cause overscan or image collapse.
  • CRT displays vary β€” the same geometry values may behave differently across brands/models.
  • Keep a backup of your original videomodes.conf & videomodes.conf.bak before making heavy edits.
  • You can create resolution-specific adjustments, ideal for aligning pixel-perfect game modes.

⚠️ **GitHub.com Fallback** ⚠️