libretro / desmume

DeSmuME is a Nintendo DS emulator
http://desmume.org
GNU General Public License v2.0
35 stars 33 forks source link

Native Resolution in Hybrid Mode results in distorted small screens #30

Open Papermanzero opened 6 years ago

Papermanzero commented 6 years ago

The current approach is to render 2D games in native resolution and to use shader to optimise the graphics. However in native resolution (256x192) the small screens in the hybrid layout are completely distorted and unsharp. Even without the shaders (scaleFX) the small screens keep distorted. yoshi s island ds-180325-100420

I tried to change the hybrid layout scale from 1 to 3. If I do that the layout is still the same but the shaders (scaleFX) do not work anymore.

bearoso commented 6 years ago

Retroarch only accepts a single 2D framebuffer for output, so either the big screen is 3x the pixels or the small screens are 1/3x the pixels. I suppose they could add a callback that lets a core output a partial framebuffer to specific regions using the shader pipeline, disabling the global shader pipeline. But that's a significant investment for one or two cores in specific configurations, and would require special-casing all the video options like aspect ratio and rotation.

Since what you want is so specific, it would be easier to just adapt a shader to your needs.

Papermanzero commented 6 years ago

I did not know that you are limited with a single framebuffer. But this is general a limitation which could become an issue. DS, 3DS, NGC-GBA, DC-VMU, WiiU, GBA Multiplayer etc. are some examples which would require another framebuffer. I thought the introduced system adhoc feature introduced several framebuffers. Maybe it makes sense to start the discussion with the libretro team.

hizzlekizzle commented 5 years ago

I'm late to the party here, but there is a shader (ds-hybrid-view, in 'handheld'; only slang and cg formats at the moment) that does something like what you're wanting. There's a preset to apply SABR scaling to the big image and put the small image off to the side.

Papermanzero commented 5 years ago

Thanks hizzlekizzle. I opened also a feature request for libretro in general. https://github.com/libretro/libretro-common/issues/55

The VMU feature in reicast also showed that a second framebuffer would be convenient to apply e.g. shaders or scalings for the second frame instance.

andres-asm commented 5 years ago

I asked multi viewports a while back too, don't remember were though.

jeremynsl commented 5 years ago

This is solved with the 'Scale so Small Screen is 1:1 px', right? Only downside is if you use integer scale, it seems to make the main viewport smaller.