Giter Site home page Giter Site logo

Comments (4)

MiltosKoutsokeras avatar MiltosKoutsokeras commented on May 31, 2024

The problem lies within the RetroArch configuration generated by RetroCRT. All HDMI timings in $retrocrt_install/retrocrt_timings/rgb/15khz are for 1920x240@60Hz emulator output. So every emulator outputs at this resolution, while the RetroArch configurations have a narrower viewport width. See:

# grep -n 'custom_viewport_width' /opt/retropie/configs/*/retroarch.cfg
opt/retropie/configs/all/retroarch.cfg:910:custom_viewport_width = 1920
opt/retropie/configs/arcade/retroarch.cfg:7:custom_viewport_width = 1920
opt/retropie/configs/arcade/retroarch.cfg:13:custom_viewport_width = 1920
opt/retropie/configs/atari2600/retroarch.cfg:7:custom_viewport_width = 1680
opt/retropie/configs/atari2600/retroarch.cfg:13:custom_viewport_width = 1680
opt/retropie/configs/atari5200/retroarch.cfg:7:custom_viewport_width = 1920
opt/retropie/configs/atari5200/retroarch.cfg:13:custom_viewport_width = 1920
opt/retropie/configs/atari7800/retroarch.cfg:7:custom_viewport_width = 1920
opt/retropie/configs/atari7800/retroarch.cfg:13:custom_viewport_width = 1920
opt/retropie/configs/atarilynx/retroarch.cfg:7:custom_viewport_width = 960
opt/retropie/configs/fba/retroarch.cfg:7:custom_viewport_width = 1920
opt/retropie/configs/fba/retroarch.cfg:13:custom_viewport_width = 1920
opt/retropie/configs/fds/retroarch.cfg:7:custom_viewport_width = 1792
opt/retropie/configs/fds/retroarch.cfg:13:custom_viewport_width = 1792
opt/retropie/configs/gamegear/retroarch.cfg:7:custom_viewport_width = 960
opt/retropie/configs/gba/retroarch.cfg:7:custom_viewport_width = 1440
opt/retropie/configs/gbc/retroarch.cfg:7:custom_viewport_width = 960
opt/retropie/configs/gb/retroarch.cfg:7:custom_viewport_width = 960
opt/retropie/configs/mame-libretro/retroarch.cfg:7:custom_viewport_width = 1920
opt/retropie/configs/mame-libretro/retroarch.cfg:13:custom_viewport_width = 1920
opt/retropie/configs/mastersystem/retroarch.cfg:7:custom_viewport_width = 1536
opt/retropie/configs/mastersystem/retroarch.cfg:13:custom_viewport_width = 1536
opt/retropie/configs/megadrive/retroarch.cfg:7:custom_viewport_width = 1792
opt/retropie/configs/megadrive/retroarch.cfg:13:custom_viewport_width = 1792
opt/retropie/configs/msx/retroarch.cfg:3:custom_viewport_width = 1920
opt/retropie/configs/msx/retroarch.cfg:9:custom_viewport_width = 1920
opt/retropie/configs/n64/retroarch.cfg:7:custom_viewport_width = 1920
opt/retropie/configs/n64/retroarch.cfg:13:custom_viewport_width = 1920
opt/retropie/configs/neogeo/retroarch.cfg:7:custom_viewport_width = 1792
opt/retropie/configs/neogeo/retroarch.cfg:13:custom_viewport_width = 1792
opt/retropie/configs/nes/retroarch.cfg:7:custom_viewport_width = 1792
opt/retropie/configs/nes/retroarch.cfg:13:custom_viewport_width = 1792
opt/retropie/configs/ngpc/retroarch.cfg:7:custom_viewport_width = 960
opt/retropie/configs/ngp/retroarch.cfg:7:custom_viewport_width = 960
opt/retropie/configs/pcengine/retroarch.cfg:7:custom_viewport_width = 1920
opt/retropie/configs/pcengine/retroarch.cfg:13:custom_viewport_width = 1920
opt/retropie/configs/psx/retroarch.cfg:7:custom_viewport_width = 1920
opt/retropie/configs/psx/retroarch.cfg:13:custom_viewport_width = 1920
opt/retropie/configs/sega32x/retroarch.cfg:7:custom_viewport_width = 1792
opt/retropie/configs/sega32x/retroarch.cfg:13:custom_viewport_width = 1920
opt/retropie/configs/segacd/retroarch.cfg:7:custom_viewport_width = 1792
opt/retropie/configs/segacd/retroarch.cfg:13:custom_viewport_width = 1792
opt/retropie/configs/snes/retroarch.cfg:7:custom_viewport_width = 1792
opt/retropie/configs/snes/retroarch.cfg:13:custom_viewport_width = 1792
opt/retropie/configs/virtualboy/retroarch.cfg:3:custom_viewport_width = 1920
opt/retropie/configs/wonderswancolor/retroarch.cfg:3:custom_viewport_width = 1344
opt/retropie/configs/wonderswan/retroarch.cfg:3:custom_viewport_width = 1344

Emulators for machines that use 1920 width are not having the black borders and fill the screen, with a lot of overscan of course in most cases. For example the PC Engine fills the screen, while SNES, Mega Drive, Sega CD and NES have squeezed picture.

I can see 2 main problems here:

  • The emulators use super-resolution in the horizontal axis and a fixed 60Hz which DOES not match the original hardware vertical refresh rate. This will lead to jerkiness for trained viewers for machine that have more than 0.5Hz difference, like arcade R-Type, Mortal Kombat, NeoGeo, etc.
  • The program that calculates the custom_viewport_width for each emulator is not doing a proper calculation for all machines.

The first one may be a limitation of RetroTink Ultimate hat, but the second seems like a software BUG. The ideal solution is to produce a signal that is an integer scale of the original horizontal dot count (e.g. 320 or 640 or 960 and so on for NTSC Mega Drive), an exact match of vertical number of scanlines (e.g. 224 for NTSC Mega Drive) and exact vertical refresh rate (e.g. 59,92Hz).

from retrocrt.

MiltosKoutsokeras avatar MiltosKoutsokeras commented on May 31, 2024

Quick fix for current setup: manually edit the files and set every machine custom_viewport_width = 1920.

from retrocrt.

xovox avatar xovox commented on May 31, 2024

the reason why it's this way is to have an actual 4:3 image displayed.

I keep a 60hz 1920x240@60 display so i don't have to recalibrate my CRT every time a new resolution & refresh is required by a platform. these games look perfect on my arcade cabinet & my RetroTink Ultimate on Panasonic CRT because i've calibrated both to have a 240p game fill the screen. everything else will have bars.

actual hardware makes allowances for uncalibrated hardware & will expand the image past the screen's boundaries

retroarch's different widths are based on native vertical resolution percentages vs 240p.

so, if a game's vertical resolution is 80% of 240p, then i calculate and set the horizontal resolution to be 80% of 1920, which will keep an authentic 4:3 aspect ratio.

there's a "fix" for uncalibrated displays coming at some point, i'm going to have an alternative 224p mode that'll probably make you happier.

i won't work on the 60hz stuff, i don't have time in my life for it. if someone else comes up with a good solution, i'll implement it in my project.

from retrocrt.

MiltosKoutsokeras avatar MiltosKoutsokeras commented on May 31, 2024

Hi and thanks for the reply. I know I'm quite late to the party but I want to discuss an important matter for your project. Aspect ratio is NOT dictated by the output signal in CRT screens. Never had, never will. The CRT will always try to display in physical screen aspect ratio, in most cases 4:3. Why is that? CRT screens do not care how many dots/pixels your signals contains in each axis. They only care about the signal timings in order to scan from top to bottom a number of lines. So a 1920x240@120Hz and a 640x480@60Hz or a 320x200@75Hz will be stretched to 4:3 by the screen itself.

There is no reason to calculate 4:3 or any other aspect ratio before output. The things that matter is the horizontal and vertical refresh plus the number of lines drawn. So the fix is to never re-calculate horizontal number of pixels when a system has 224 instead of 240 lines. Keep the Horizontal pixels in the range allowed by hardware and just change the number of lines drawn. This way all systems will have a filled horizontal axis. The matter of shimmering due to non-integer scaling is another matter but you should also try to make each axis have a 1x, 2x, 3x, ... number of pixels and never a fractional number.

The Vertical refresh frequency cannot be fixed in software according to my knowledge, it is a limitation of the RetroTink Ultimate. It operates on a strict modeline dictated in /boot/config.txt and all systems are either sped up, frameskipping or slowed down to match the modeline vertical refresh. This is completely wrong and I haven't found a solution yet.

from retrocrt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.