Commit Graph

72 Commits

Author SHA1 Message Date
Martin Donlon
e1a58541c0 video: Don't set sync polarity when calculating modes (#611)
The polarity setting is shared between analog and digital output, so
changing it when calculatinga video mode can interfere with analog
video output. If someone has a need to use a specific polarity they
can specify it as part of the video_mode.
2022-05-22 16:58:14 +08:00
Sorgelig
168aae3f07 video: fix formatting. 2022-05-21 02:28:06 +08:00
Martin Donlon
edcb3fcefc video: Vertical Scaling Changes (#608)
Integer Resolution Scaling
Generate a video mode whose vertical resolution is an integer multiple
of the cores vertical resolution. The video mode set via the
`video_mode` parameter is considered the maximum resolution. There are
two modes of operation: vscale_mode=4 - Both vertical and horizontal
resolution are modified. The horizontal resolution is scaled in
propotion to the vertical, so the aspect ratio is maintained. This will
be most suited to VGA CRTs that expect a specific aspect ratio signal.
vscale_mode=5 - Only the vertical resolution is modified. This will be
suitable for most modern LCD/OLED displays. The additional horizontal
resolution provides more space for wide aspect ratio cores.

Video Mode Calculation
CVT timing calculations are used to generate the modified video modes
for Interger Resolution Scaling, this mode generation is also exposed as
an additional way to specify video modes in the MiSTer.ini. Modes can be
specified with just the width, height and refresh rate:
`video_mode=1920,1200,60`. Whether to use the original CVT or the
reduced blanking CVT-RB timings can be specified with an optional flag,
e.g. `video_mode=1024,768,60,cvt`. Additionally the sync polarities can
also be expressed using flags now, e.g.
`video_mode=1280,110,40,220,720,5,5,20,74250,+hsync,-vsync`

Code Changes
More functionality was broken out of `video_mode_adjust`.
`video_mode_select` determines what the correct base video mode is based
on the timing and vsync_adjust configuration. The mode selected there is
then passed to `video_resolution_adjust` which modifies it based on the
integer resolution scaling selected. Other than that the functionality
of `video_mode_adjust` remains the same.

The `video_calculate_cvt` function was added to calculated video mode
timings.

`parse_custom_video_mode` was changed to support the additional flags.
It now uses `str_tokenize` to split up the input string so it is more
easy to manage the different variations of parameter counts allowed for
the modes.

`vmode_custom_param_t` was added to alias the items in the
vmode_custom_t instead of using raw array indexing everywhere.

`str_util.h/.cpp` added to provide some safer and easy to use string
functions. `strcpyz`, `strncpyz`, `sprintfz` all ensure that the
resulting string is null terminated and doesn't overrun memory.
2022-05-21 01:48:19 +08:00
Martin Donlon
b43e5cfc34 video: Only set scan information when in game mode (#609) 2022-05-21 00:24:49 +08:00
Sorgelig
d57ed83fbe video: detect default video resolution and dvi mode from EDID. 2022-05-20 21:34:44 +08:00
Martin Donlon
590dcae13c video: Use horizontal filter when using an interlaced video mode (#606) 2022-05-19 22:34:11 +08:00
Sorgelig
ac956d2018 video: fix direct_video mode. 2022-05-19 04:09:31 +08:00
Martin Donlon
b1271ad983 video: associate a VIC mode with the predefined video modes (#603) 2022-05-15 15:40:56 +08:00
Sorgelig
a62be08e28 smbus: reduce debug info. 2022-05-12 07:12:55 +08:00
Sorgelig
13ecfc748c video: make HDMI game mode optional. 2022-05-12 06:15:57 +08:00
Sorgelig
ec5577a620 video: configure HDMI from HPS. 2022-05-12 06:07:31 +08:00
Sorgelig
26e1cccbaa Implement new way to address status bits. 128bit status. 2022-05-05 21:06:13 +08:00
Thomas Sowell
f5fd16c26e Override configuration based on video mode (#567)
* Override configuration based on video mode

Configuration options can now be overridden based on the core's video
mode.

The config parser now supports sections with names in the format
"video=WIDTHxHEIGHT[@VREFRESH]".  When a core changes video mode, MiSTer
reloads the config file and checks for a section matching the new mode.
If one is found, the options in the section override options in the
MiSTer/core sections.

MiSTer will look for a section matching the width, height, and vertical
refresh rate first.  If none is found, it will fall back to a section
matching the width and height but not specifying a refresh rate.  If
there is still no match, no overrides will be used.

Also, VREFRESH must match exactly the output from video_info or the
logs.  To match 720x400 31.48KHz 70.1Hz, the section title would need to
be [video=720x400@70.1].

* Move video section variables out of cfg_t
2022-03-17 14:46:57 +08:00
Thomas Sowell
badc9953e7 Support setting sync polarity (#553)
Include sync polarities in the UIO_SET_VIDEO command.  Polarities are
specified in the high bits of the hsync and vsync values.  0 is
negative, 1 is positive.

Horizontal and vertical polarities can optionally be included as two
numbers at the end of custom modes.  Again, 0 is negative, 1 is
positive.
2022-02-26 14:26:51 +08:00
Martin Donlon
9ace959408 Support for 10bit polyphase coefficients (#550) 2022-02-21 15:25:37 +08:00
Martin Donlon
e509b8ec83 video: support for 256 phases (#548) 2022-02-20 15:45:02 +08:00
Martin Donlon
d32cea4798 Video info in OSD menu (#543) 2022-02-17 02:43:50 +08:00
Sorgelig
7701cb1cda rename user_io_8bit_set_status to user_io_status. 2022-02-14 02:12:09 +08:00
Sorgelig
78514bb15f video: some tweaks and formatting. 2022-02-10 19:54:34 +08:00
Martin Donlon
4e671f91aa Adaptive scanlines (#520)
Change filter reading code so that it stores all data as if it had 64 phases.
Support "adaptive" keyword in filter files which contain a second set of adaptive filters.
Send filters to core in one of the three supported formats.

Co-authored-by: Alexey Melnikov <pour.garbage@gmail.com>
2022-02-10 19:39:25 +08:00
Sorgelig
ba3d2fe80a OSD: filters/gamma/mask quick switch by +/- 2022-02-10 18:50:42 +08:00
Sorgelig
5cc951d262 Implement video processing presets. 2022-01-31 15:14:32 +08:00
Sorgelig
c1839a461d video: sanity check for video filters. 2022-01-07 21:34:44 +08:00
Sorgelig
eefe9833ff video: avoid setting video filter twice. 2022-01-05 22:17:19 +08:00
Sorgelig
8ce0b0a06f video: support for multires shadow mask files. 2022-01-05 21:22:05 +08:00
Sorgelig
21e35bbf2f video: support 64 phases for scaler, separate filters for horizontal/vertical/scanlines. 2022-01-05 21:22:04 +08:00
Sorgelig
428a24afce Shadowmask v2. 2021-12-14 22:48:35 +08:00
Sorgelig
4cee9159d0 Support for loadable Shadow Masks. 2021-11-26 21:23:21 +08:00
Sorgelig
7abbf7f8f4 Support compilation in WSL Ubuntu 20.04 LTS. Fix some warnings. 2021-10-07 03:08:56 +08:00
sorgelig
4d83a408c7 video: reduce debug messages. 2021-08-24 19:49:15 +08:00
sorgelig
9cd404ea65 Common shared memory module. Using O_CLOEXEC for opened files. 2021-04-16 23:12:46 +08:00
sorgelig
c0c7c05dfa Support original core name and common arcade section in ini. 2021-03-26 14:53:42 +08:00
sorgelig
928b9d3222 video: adjust stride setting for more compact buffer. 2021-02-14 21:11:42 +08:00
sorgelig
471372f5ce Option for default scaler and audio filters in INI file. 2020-11-17 18:09:43 +08:00
sorgelig
d93481c26c INI options for custom aspect ratio. 2020-11-01 20:34:36 +08:00
sorgelig
19cf3890d5 INI option to disable logo in Menu core. 2020-06-18 10:54:38 +08:00
sorgelig
bc24461cc3 Support for wallpapers_alt_X. 2020-06-01 14:21:24 +08:00
sorgelig
5d80055955 video: add 1920x1440(12) and 2048x1536(13) modes to standard resolutions. 2020-05-27 02:49:11 +08:00
sorgelig
59be8d36ed video: don't block while adjusting the PLL. 2020-05-18 08:27:18 +08:00
sorgelig
07d965102d Some refactoring and normalization. 2020-04-12 17:19:49 +08:00
sorgelig
27c72cab81 video: apply border setting to menu core. 2020-04-10 03:15:30 +08:00
sorgelig
4ce5bed723 video: improve border handling. 2020-03-25 18:56:03 +08:00
sorgelig
dda937af89 INI option to limit display refresh rate. 2020-03-12 00:40:19 +08:00
sorgelig
f25ec43188 Revert FB 31KHz mode values. 2020-01-21 13:30:12 +08:00
sorgelig
b3ee74dd44 Adjust FB TV modes. 2020-01-21 03:06:56 +08:00
sorgelig
229fcf3ba5 Tweaks for FB on TV. 2020-01-09 19:54:17 +08:00
sorgelig
8f0c9bd8cc Support linux FB over VGA/Direct Video. 2020-01-04 14:57:47 +08:00
sorgelig
2e3a21c6ca backgrounds -> wallpapers. 2020-01-03 20:35:26 +08:00
sorgelig
6cd693bdf1 Support for random background loading from backrounds dir. 2020-01-03 10:04:56 +08:00
sorgelig
2e12b079d5 arcade: better error visibility. 2019-12-21 08:08:56 +08:00