Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ultrawide support #259

Merged
merged 14 commits into from
Oct 22, 2020
Merged

Ultrawide support #259

merged 14 commits into from
Oct 22, 2020

Conversation

AngheloAlf
Copy link
Contributor

Hi!

This change adds support for 64:27 aspect ratio, oftenly labeled as 21:9 as a marketing term.

Add the 64:27 adjusted option to the Aspect Ratio in-menu option, and adds a 64:27 Resolution in-menu option to let the user select the resolution for this aspect ratio.

Some comparison screenshots:

Aspect ratio Title screen screenshot Lon lon ranch screenshot
4:3 titlescreen1-4-3 lonlonranch-4-3
16:9 titlescreen1-16-9 lonlonranch-16-9
64:27 titlescreen1-64-27 lonlonranch-64-27

More comparison screenshots can be seen here.

Tested on RetroArch 1.9.0, Pop!_OS 20.04, using a Zelda OoT randomized rom.

According to [Wikipedia](https://wikipedia.org/wiki/21:9_aspect_ratio)
21:9 is just a marketing term.

The real aspect ratio I wanted is 64:27, so terminology was changed
accordingly.

A few messages were added to explain this to the final user.
@m4xw
Copy link
Collaborator

m4xw commented Sep 16, 2020

I dont like this PR (and its not your fault).
This will need to be implemented differently but I am not entirely sure how I want it either, so give me a few days to think about it!
I am def. open for adding this - so keep the PR open for reference

@m4xw
Copy link
Collaborator

m4xw commented Sep 16, 2020

Also btw a change like 043c679 would need to happen upstream

@AngheloAlf
Copy link
Contributor Author

I also think that this should be implemented differently, but I tried make the change respecting the way it was already implemented.

Also btw a change like 043c679 would need to happen upstream

Oh, you're right, I'll see what can I do there.

@m4xw
Copy link
Collaborator

m4xw commented Sep 16, 2020

I also think that this should be implemented differently, but I tried make the change respecting the way it was already implemented.

Ye, I noticed that ;)
My pain limit for resolution selectors is 2 tho 🙈

@AngheloAlf
Copy link
Contributor Author

My pain limit for resolution selectors is 2 tho 🙈

And what about just leaving a "4:3 Resolution" selector and a Widescreen Resolution selector?

Screenshot from 2020-09-16 21-24-02

The Widescreen Resolution selector would have all the resolutions for 16:9 and 64:27. It could even include other weirds aspect ratios.

Screenshot from 2020-09-16 21-24-40

The Aspect Ratio selector would only have 3 options. The option Widescreen adjusted would calculate the aspect ratio based on the selected Widescreen resolution. The other options would force the corresponding aspect ratio.

Screenshot from 2020-09-16 21-25-05

Add resolutions other than 16:9 to this option, specifying the aspect
ratio on it's label.

Also change "16:9 adjusted" for "Widescreen adjusted" in the
"Aspect ratio" setting. Selecting this will infer the aspect ratio based
on the selected widescreen resolution.
@m4xw
Copy link
Collaborator

m4xw commented Sep 21, 2020

I like that more, Will gather some opinions

@m4xw
Copy link
Collaborator

m4xw commented Sep 29, 2020

image
We should keep backwards compat here for now, can remove it later after most of the users saved their config after the deployment

@AngheloAlf
Copy link
Contributor Author

Something like this? I undid the settings change, so it has the same options, but it still provides compatibility with wider screens.

@m4xw
Copy link
Collaborator

m4xw commented Oct 5, 2020

Not sure about ,'s, but I am no native speaker
image
Will check the rest when I find some time

@AngheloAlf
Copy link
Contributor Author

I think they are correct, but I can remove them if you prefer it.

@m4xw
Copy link
Collaborator

m4xw commented Oct 16, 2020

I think they are correct, but I can remove them if you prefer it.

Yea please do i think they ruin the pacing of the sentence.

@AngheloAlf
Copy link
Contributor Author

Done. Do you suggest any more changes?

Copy link
Collaborator

@m4xw m4xw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be good to go otherwise, I will push it to a branch tomorrow and let a few ppl test. if all works out I will merge.
Not sure if i missed some behaviour.

libretro/libretro_core_options.h Outdated Show resolved Hide resolved
libretro/libretro.c Outdated Show resolved Hide resolved
@AngheloAlf
Copy link
Contributor Author

Done both changed. Anything else?

Copy link
Collaborator

@m4xw m4xw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See topic

libretro/libretro.c Outdated Show resolved Hide resolved
@m4xw
Copy link
Collaborator

m4xw commented Oct 21, 2020

Did a gliden rebase that I am gonna push later and also added this PR on top of it on a branch https://git.libretro.com/libretro/mupen64plus-libretro-nx/-/pipelines/2831
Can you check if those builds work out for you? I will have it tested rn as well

@AngheloAlf
Copy link
Contributor Author

Can you check if those builds work out for you? I will have it tested rn as well

I tested the artifact in that page, and also I compiled and tested that code myself in my machine, just to be sure. Both works without problems for me.

@m4xw
Copy link
Collaborator

m4xw commented Oct 21, 2020

@AngheloAlf a bug i found, if you select 16:9 aspect (non adjusted) you dont calculate the aspect ratio leading to a 4:3 like image output
grafik
This is directly dependent.
For now we can change the display name of the options without changing the config value (will be confusing but i eventually write about it in a blog post)

https://git.libretro.com/libretro/mupen64plus-libretro-nx/-/blob/develop/libretro/libretro_core_options.h#L134-139
the null's -> "Widescreen", "Widescreen (Adjusted)", leave 4:3, dont touch the left value.

All the settings I have hooked up under the hood so u just need to set it right (as you found out ;-))
So we can just calc it for 2 || 3, I know stretched isnt so insteresting for ultra wide, but I might just add a few other odd ones in the future, so i like to keep that open

@AngheloAlf
Copy link
Contributor Author

@AngheloAlf a bug i found, if you select 16:9 aspect (non adjusted) you dont calculate the aspect ratio leading to a 4:3 like image output
grafik

That's weird, it should be calculated here:
image
Anyway, I'll look up what's the problem.

This is directly dependent.
For now we can change the display name of the options without changing the config value (will be confusing but i eventually write about it in a blog post)

https://git.libretro.com/libretro/mupen64plus-libretro-nx/-/blob/develop/libretro/libretro_core_options.h#L134-139
the null's -> "Widescreen", "Widescreen (Adjusted)", leave 4:3, dont touch the left value.

Yeah, you're right. I don't know how I didn't think about that. I'll change it.

Note, you also want to test the native res factor behaviour, aspect still applies

I have been playing with this enabled (6x I think) with no problem, but I'll test it anyway and look up for some side effect.

Another note, use cached interpreter if u want to play randomizer ;)

Oh. Why? I thought the cached interpreter were slower. I remember reading somewhere about changing the TLB exceptions option when playing rando, so I'll look up that option too. Thanks

@m4xw
Copy link
Collaborator

m4xw commented Oct 22, 2020

That's weird, it should be calculated here:

Thats 16:9 tho and its a ultrawide resolution ;)

Dont forget this is the "wide" option yet, so we need to calc it.

Oh. Why? I thought the cached interpreter were slower. I remember reading somewhere about changing the TLB exceptions option when playing rando, so I'll look up that option too. Thanks

On PC? Shouldnt be significant and yea, because of the dynarec Issues, the TLB option is just a hack so you can basically save & restart (read: close content and start, otherwise it wont fix itself)

@m4xw
Copy link
Collaborator

m4xw commented Oct 22, 2020

Btw for reference, this is the libretro aspect ratio.
The "AspectRatio" key (1, 2, 3) is set here in GLideN64 https://github.com/libretro/mupen64plus-libretro-nx/blob/develop/custom/GLideN64/mupenplus/Config_mupenplus.cpp#L137
Its enforced here:

void DisplayWindow::_setBufferSize()

So my suggestion now is remove the "forced 16:9" (== 2) and replace with "Stretch" (== 0), as seen here

enum Aspect {
aStretch = 0,
a43 = 1,
a169 = 2,
aAdjust = 3,
aTotal = 4
};

Keep 4:3 what it is and then keep how it is for "adjusted"

@AngheloAlf
Copy link
Contributor Author

@AngheloAlf a bug i found, if you select 16:9 aspect (non adjusted) you dont calculate the aspect ratio leading to a 4:3 like image output
That's a weird bug. With that aspect selected, choosing a 16:9 resolution stretches it to 16:9 as expected, but selecting a wider one renders the game at 4:3.

For visual reference, this is how I see the game in "16:9" aspect ratio with "1920x1080" selected:
whole_screen_1920_1080
And this is how I see it with that same aspect ratio, but with "2560x1080" selected:
whole_screen_2560_1080

Btw for reference, this is the libretro aspect ratio.
The "AspectRatio" key (1, 2, 3) is set here in GLideN64 https://github.com/libretro/mupen64plus-libretro-nx/blob/develop/custom/GLideN64/mupenplus/Config_mupenplus.cpp#L137
Its enforced here:

void DisplayWindow::_setBufferSize()

So my suggestion now is remove the "forced 16:9" (== 2) and replace with "Stretch" (== 0), as seen here

enum Aspect {
aStretch = 0,
a43 = 1,
a169 = 2,
aAdjust = 3,
aTotal = 4
};

Keep 4:3 what it is and then keep how it is for "adjusted"

That could explain the problem. I'll test that in a moment.

@m4xw
Copy link
Collaborator

m4xw commented Oct 22, 2020

Also might as well call "16:9" now "Wide (Stretched)"

@m4xw
Copy link
Collaborator

m4xw commented Oct 22, 2020

Also I guess it might be confusing with how it was named before for you, but 16:9 always meant set resolution, stretched and adjusted always means widescreen hack.
It was just a side effect of having seperate core options for it :P
If people really need such behaviour, i need to add a "fit" mode

@AngheloAlf
Copy link
Contributor Author

You were right, now the stretched option works "as intended"
Screenshot from 2020-10-22 16-29-52
It's weird playing with the image so stretched, but maybe somebody likes it (?).

Also might as well call "16:9" now "Wide (Stretched)"

Yeah, I was thinking something like that too.
Also, what about renaming "4:3" to "Original (4:3)"?
image

@AngheloAlf
Copy link
Contributor Author

Also I guess it might be confusing with how it was named before for you, but 16:9 always meant set resolution, stretched and adjusted always means widescreen hack.
It was just a side effect of having seperate core options for it :P
If people really need such behaviour, i need to add a "fit" mode

A bit 😅. I think the naming was fine if we only consider there were mainly two aspect ratios.

@m4xw
Copy link
Collaborator

m4xw commented Oct 22, 2020

Scaling the aspect ratio further would be frontend business IMO. (Instead of "Core provided" in RA)
Thats why stretch exists, also for perf gains on 16:9

@m4xw
Copy link
Collaborator

m4xw commented Oct 22, 2020

But why someone would use it with ultrawide... good question xD

@m4xw
Copy link
Collaborator

m4xw commented Oct 22, 2020

@AngheloAlf
Copy link
Contributor Author

https://git.libretro.com/libretro/mupen64plus-libretro-nx/-/pipelines/2879/builds

Works with no issues for me (both artifact and compiling myself).

@m4xw
Copy link
Collaborator

m4xw commented Oct 22, 2020

There can be a few nits for documentation that i can think of, like annotating the types i quoted but this looks good to me and testing passes.
Ready to go?

@AngheloAlf
Copy link
Contributor Author

AngheloAlf commented Oct 22, 2020

There can be a few nits for documentation that i can think of, like annotating the types i quoted but this looks good to me and testing passes.

By annotating the types, you mean change some magic numbers for something less "magic"?

For example, use this enum:

enum Aspect {
aStretch = 0,
a43 = 1,
a169 = 2,
aAdjust = 3,
aTotal = 4
};

Like this:
image
(i know it wont work because it is c++ code, but that is the idea)

Ready to go?

Besides that detail, I think I'm ready.

@m4xw
Copy link
Collaborator

m4xw commented Oct 22, 2020

Yes, just // Aspect::aStretch, i do that somewhere else already iirc..
Still hesitant to make libretro.c cpp :P

@AngheloAlf
Copy link
Contributor Author

AngheloAlf commented Oct 22, 2020

Yes, just // Aspect::aStretch, i do that somewhere else already iirc..

Like this?
image
(edit: i just realized i missed a = in the first if. ups)

Still hesitant to make libretro.c cpp :P

I think its fine like it is right now.

@m4xw
Copy link
Collaborator

m4xw commented Oct 22, 2020

Remove the Config::

@AngheloAlf
Copy link
Contributor Author

Ups. Fixed 😅

Copy link
Collaborator

@m4xw m4xw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this backfires, blame the beer :P

@m4xw m4xw merged commit 0052b9e into libretro:develop Oct 22, 2020
@m4xw
Copy link
Collaborator

m4xw commented Oct 22, 2020

Thanks for this

@AngheloAlf
Copy link
Contributor Author

Thanks for this

Thanks to you!
It was a great team work.

Have a great day :3

@m4xw
Copy link
Collaborator

m4xw commented Oct 23, 2020

@AngheloAlf I totally forgot, the stretch thing is to support widescreen via game patches ;)

@AngheloAlf
Copy link
Contributor Author

AngheloAlf commented Oct 23, 2020

@AngheloAlf I totally forgot, the stretch thing is to support widescreen via game patches ;)

Ohh, that make sense.
Now that you mention it, I think DK64 has widescreen support built-in, so the player had to stretch the image in the tv options.
I wonder if other games have that option too 🤔

@Jj0YzL5nvJ
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants