TASEmulators / freej2me-plus

A free J2ME emulator with libretro, awt and sdl2 frontends.
https://tasemulators.github.io/freej2me-plus/
Other
9 stars 2 forks source link

Bad pixel scaling on Windows on Java above 8 #19

Open TwoSpacesSG opened 1 month ago

TwoSpacesSG commented 1 month ago

If using Java 11 or above, pixels look very uneven and distorted, in some cases there is also some kind of ping pong effect (?) on the image. Maybe it's to do with my DPI settings which are set to 125% system-wide because I can't see anything otherwise.

Oracle Java 8u421 x64: goodscaling

Eclipse Temurin 11.0.24+8 x64: badscaling

vadosnaprimer commented 1 month ago

The second image is indeed about 123% bigger. Try with 100% DPI? Older Java might be unaware of such a setting.

TwoSpacesSG commented 1 month ago

It's not an option for me to set the entire system to 100% just to use FreeJ2ME, but in the per-application compatibility settings for java.exe and javaw.exe, setting redefining scaling to "system" does indeed make it look better, although the menu bar also looks blurry. Not sure that it's a viable workaround though.

vadosnaprimer commented 1 month ago

It's not a workaround, it's a test to see if DPI is the reason.

AShiningRay commented 1 month ago

I don't think that's something AWT will handle well, since what happens is that since your default desktop scale is now non-integer, Temurin probably takes it into account (differently from Oracle's) and automatically scales the screen based on that, which will also make it fractional scale instead of integer scale. There's probably a system property that can be set to ignore the desktop's base scale, but that'd be a hack seeing as Oracle doesn't seem to care, and making assumptions on the java code would also overcomplicate too much.

Solution? Probably using SDL or Libretro, as both have access to MUCH better scaling options than AWT, and are easier to do that kind of stuff too.

raidenii commented 2 days ago

Libretro actually has a weird scaling issue, but seemingly only on Windows.

I typically have 7x scaling for windowed mode, and this makes the game window HUGE on Windows. However, while playing the game, if one navigates to the scaling setting and change it to something else, then change back (e.g., 7x->6x->7x) then the window looks much better, in a sensible size.

This does not happen on my Xubuntu machine (but both uses OpenJDK JRE for Java SE, and RA's video drivers are both set to vulkan), unsure what caused it.