Geometry Adjustments for videomodes.conf - ZFEbHVUE/Batocera-CRT-Script GitHub Wiki
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)
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
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.
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.
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.
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
- Start small β try
1.05
,-2
, or3
before jumping to extreme values. - Donβt overdo
h_size
; going above1.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.