Topic: Trimming vsync_offset


If you're using an NVIDIA card, enter the NVIDIA Control Panel. Under '3D Settings->Manage 3D settings', change 'Power managent mode' from 'Adaptive' to 'Prefer maximum performance'. A similar procedure should be performed with both Intel and AMD/ATI cards.

Next, download the 240p test suite for genesis.

http://sourceforge.net/projects/testsui … p/download

Start from a fresh ini, enable HLSL and edit the settings per your liking. The default settings are listed below (with hlsl enabled).

NOTE: If you have a slow card, it's possible you won't be able to use HLSL. Tear-free HLSL has currently been achieved on a GTX970 (W10), GTX580 (W7), AMD 6770M (W7), Quadro K3000M (W7) and AMD R9 270X (W8.1), the last two had to have the HLSL 'curvature' option disabled. The Intel Skylake GPU (W10) had to have bloom, curvature and screen_round/smooth_corner options disabled to get rid of the tearing. Also note that your vsync_offset will likely need to increase the more effects you use, which is why you should input your settings first, and then tweak the value.

hlsl_enable               1
hlslpath                  hlsl
hlsl_prescale_x           0
hlsl_prescale_y           0
hlsl_preset               -1
hlsl_snap_width           2048
hlsl_snap_height          1536
shadow_mask_alpha         0.0
shadow_mask_texture       aperture.png
shadow_mask_x_count       6
shadow_mask_y_count       6
shadow_mask_usize         0.1875
shadow_mask_vsize         0.1875
shadow_mask_uoffset       0.0
shadow_mask_voffset       0.0
curvature                 0.0
round_corner              0.0
smooth_border             0.0
reflection                0.0
vignetting                0.0
scanline_alpha            1.0
scanline_size             1.0
scanline_height           1.0
scanline_bright_scale     1.0
scanline_bright_offset    0.0
scanline_jitter           0.0
defocus                   0.0,0.0
converge_x                0.3,0.0,-0.3
converge_y                0.0,0.3,-0.3
radial_converge_x         0.0,0.0,0.0
radial_converge_y         0.0,0.0,0.0
red_ratio                 1.0,0.0,0.0
grn_ratio                 0.0,1.0,0.0
blu_ratio                 0.0,0.0,1.0
saturation                1.4
offset                    0.0,0.0,0.0
scale                     0.95,0.95,0.95
power                     0.8,0.8,0.8
floor                     0.05,0.05,0.05
phosphor_life             0.4,0.4,0.4

yiq_enable                0
yiq_cc                    3.59754545
yiq_a                     0.5
yiq_b                     0.5
yiq_o                     1.570796325
yiq_p                     1.0
yiq_n                     1.0
yiq_y                     6.0
yiq_i                     1.2
yiq_q                     0.6
yiq_scan_time             52.6
yiq_phase_count           2

vector_length_scale       0.8
vector_length_ratio       500.0

bloom_scale               0.25
bloom_overdrive           0.0,0.0,0.0
bloom_lvl0_weight         1.0
bloom_lvl1_weight         0.21
bloom_lvl2_weight         0.19
bloom_lvl3_weight         0.17
bloom_lvl4_weight         0.15
bloom_lvl5_weight         0.14
bloom_lvl6_weight         0.13
bloom_lvl7_weight         0.12
bloom_lvl8_weight         0.11
bloom_lvl9_weight         0.10
bloom_lvl10_weight        0.09

Start GM and boot the genesis 240p test suite, set frame delay to 1.

mame64 genesis -cart [path to test suite]\240p-MD-Genesis-1.14.bin -v -monitor lcd -refresh_dont_care -frame_delay 1

Enter the grid scroll test, and note approximately how many lines down the tearing position is (use space/button 3 to switch scroll direction). If the tearing position is very unstable (jumping up and down 10-20 lines), try using '-video d3d9ex' in addition to the other parameters. If you are unable to get a stable tearing position no matter what, try disabling the 'curvature/round_corner/smooth_border' effects if any of those are active.

After noting approximately how many lines down the tearing position is, restart GM with the above parameters as well as '-vsync_offset [number of  lines]'. Enter the grid scroll test again and the tearing position should have moved. If it doesn't move, make sure that SwitchRes is active  (check the log). If SwitchRes is active, and you still can't get the tearing position to move, try switching between d3d and d3d9ex.

After a few rounds of trying out values you should have the value for your vsync_offset parameter.

Note that vsync_offset will negatively affect the maximum possible frame delay. If your computer is able to run a game at let's say frame_delay 7, but you need a vsync offset of about 10% of the total lines of the display used, the maximum frame_delay value the system will be capable of is 6.

If you have a very fast CPU (modern i7 3.8-4.0 GHz), you should be able to run the genesis driver at fd 7 without issues.