Background:
- Because HoMM3 was made in dark ages of 800x600 resolution VCMI requires minimum of 800x600
- VCMI performs check, via SDL, and crashes itself if pixel resolutions is too small (so no,
xrandr --scale 1x1.25
is not a solution, application crashes itself anyway) - Device is RaspberryPi 4B with "original" 800x480 touchscreen, running Ubuntu 20.10
- Everything works on big screens, device is fully capable of running VCMI out of a bix. Problem is only in running it in 480p
- Windowed mode is playable just by throwing
xrandr --mode 800x600 --scale 1.5x1.5
, but it breaks touchscreen-to-mouse.
I got it more or less working by stockpiling so many hacks and workarounds that I had to kill error reporting services to not melt my Pi...
- Creating custom 800x600@60 resolution with
cvt 800 600 60
andxrandr --newmode ...
as per How do I set a custom resolution? VCMI now launches in windowed, true fullscreen, and not-true fullscreen (borderless maximized?). Obviously not very playable because bottom 120px of window is out of screen bounds. - Then I scaled down image down to native resolution, 600px * 0.8 = 480px, and discovered that "true fullscreen" ignores scale and "not-true fullscreen" has interesting bug/feature where it scales down to 480px properly but draws centered so image is not aligned with (physical) screen. So ssh'ed from PC and brutally moved it few pixels up until it looked fine and ended up with this abomination:
xrandr --output DSI-1 --mode forced600 --transform 1.0,0,0,0,1.25,+80,0,0,1
It "works", but I have problems with mouse and touchpanel due to severe abuse of xrandr --transform
.
Once I apply my hacks device works in 800x600 resolution with fancy scalling and transforms which results in:
- mouse being able to go down offscreen, irritating but not "gamebreaking" issue
- touchscreen accuracy is messed up by non-native resolution, scale, and offset, which makes it hard to accurately touch buttons
How can I fix those two pointer issues? Is there a better way to force VCMI to run in 480p?