Add ini option `unique_mapping` which makes controller mappings unique to the physical port the controller is connected to.
Calculates a uint32_t unique_hash for each device during enumeration.
Co-authored-by: Martin Donlon <github-martin@donlons.com>
* Merge branch 'hdr' of https://github.com/wickerwaka/Main_MiSTer into feature-hdr
Merged in wickerwaka's old HDR branch and integrated the BT2020 and DCI P3 color space conversion matrices. Changed "hdr" option to be a selection of matrix instead of saturation option.
* Add HDR example to MiSTer ini
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.