nikita36078 / J2ME-Loader

A J2ME emulator for Android.
Apache License 2.0
1.72k stars 195 forks source link

Auto-detect JAR game resolution #969

Closed soundsnow closed 1 year ago

soundsnow commented 1 year ago

As far as I know, JAR itself is a compressed file, which contains image files. Generally, the largest image is the game background.

After @nikita36078 enable auto-detect resolution, the emulator will find the largest image file and set its resolution to the resolution of this game.

Manually setting the resolution for each game is a waste of time as they all have different resolutions. You have to open the game and see the screens and guess their resolution, then close the game and open it again, realize that you guessed wrong resolution, close the game again to change the resolution. what a waste of time

I'm going to use a game in JAR and JAR+JAD format as an example. This method is invalid for monochrome games in JAD format, please set it to 96x65 by default for JAD games

7zwerge.jar installation is complete Enable auto-detection Largest image file objset0.png (23.07KB) of 7zwerge has a resolution of 250x250 Default resolution of 7zwerge has changed to 250x250 Open 7zwerge

If the detection fails and there is no image file, use the selected resolution

The image file formats I know are JPG, PNG, BMP, and GIF. I don't know what file format the J2ME SDK allows, is it usually PNG?

soundsnow commented 1 year ago

Make it Enabled by default

woesss commented 1 year ago

The background with one whole picture is a rarity, besides, in more or less good games, the resources are encrypted and there are no pictures in their pure form. Therefore, such auto-detection will work correctly in one case out of 100

soundsnow commented 1 year ago

I know this approach is not perfect. But I did solve quite a few resolution-related issues with it. For example: the game title cover is a png. If it can be adopted, I would like to add one more point: the image file will only be scanned once, after that only the detected resolution will be displayed, and the image file will not be scanned repeatedly

soundsnow commented 1 year ago

I know this approach is not perfect. But I did solve quite a few resolution-related issues with it. For example: the game title cover is a png. If it can be adopted, I would like to add one more point: the image file will only be scanned once, after that only the detected resolution will be displayed, and the image file will not be scanned repeatedly

soundsnow commented 1 year ago

I know this approach is not perfect. But I did solve quite a few resolution-related issues with it. For example: the game title cover is a png. If it can be adopted, I would like to add one more point: the image file will only be scanned once, after that only the detected resolution will be displayed, and the image file will not be scanned repeatedly