Rodrigodd / gameroy

A Game Boy emulator, disassembler and debugger, written in Rust
Apache License 2.0
266 stars 6 forks source link

[Feature Request] Option to resize screen and buttons on Android #8

Open Greggggggggggg opened 1 year ago

Greggggggggggg commented 1 year ago

I've tested your emulator on Android, and so far it's working perfectly.

The only small problems I have are the size of the screen, which could be enlarged to take full advantage of the screen of my phone, and the size of the buttons, which are inconvenient because of their small size.

An option to resize the screen of the games and the size of the buttons to adapt to bigger Android phones would be nice.

This is my humbly request

Rodrigodd commented 1 year ago

Hi, it may take me a while for implementing that, because first I need to create the entire options screen.

But maybe your problem is more related on how poorly I may be handling DPI scaling, or scaling in general. Can you share a screenshot showing the size of the buttons? And maybe your phone model, if possible. This problem may be easier to fix than the options screen.

Greggggggggggg commented 1 year ago

Hi, my phone model is an Google Pixel 7

Screenshot_gameroy_pokemon_cramorant

Sorry about the closed and reopened, I missclicked

Rodrigodd commented 1 year ago

It is what I suspected, the program is not currently handling your DPI scale. I am only handling 1x and 2x right now. I will try to implement the remaining DPI scales from Android's documentation (0.75x, 1.5x, 3x and 4x) to see if it brings an improvement.

But I also suspect that I will need to scale the buttons in directly proportion to the screen instead.

Regarding the screen, I am currently limiting its scaling to an integer to make the scaling pixel perfect. But I don't think this is desirable in this case.

Rodrigodd commented 11 months ago

I was able to reproduce this on a emulator.

On 7df36c2784d25a70184012e081d01b12b44f6a2d I implement all android bitmap scaling variants. Google Pixel 7 is using the 3x variant.

On 87556172681fb32a05334ac15fe373ab268ee5fc I put the integer scaling behind a configuration value (currently you can only change it on native) and let the default be disable. So on Android, now this should always scale to fit the total screen size.

@Greggggggggggg does it look better for you? But this was only a visual change, the touch-response radius of each button is still the same. You can download this new version from the last Github Actions CI Artifacts. Let me know if it feels better know, or I still need to increase the response radius (I could not test this on a emulator).

Before After
Screenshot_20230913_181605 Screenshot_20230913_180352
Greggggggggggg commented 11 months ago

I tried it, and it's exactly like in your right screenshot, and it feels much better ! Thank you