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
Rework the aspect ratio calculation (Fixes 240p mode) #3472
Conversation
Video Interface simply isn't aware about widescreen. Instead, the render class can multiply by 1.3333333 to get the 16:9 aspect ratio.
cf372b1
to
b658331
Compare
|
@mirrorbender could you take a look at this? It should have the exact same aspect ratios as your old code. |
|
This is ready for review/merging now. Replaces #3346 |
|
lgtm in basic testing of various games and aspect ratios. |
|
|
||
| // 5. Calculate the final ratio and scale to 4:3 | ||
| float ratio = horizontal_active_ratio / vertical_active_ratio; | ||
| if(std::isnormal(ratio)) // Check we have a sane ratio and haven't propagated any infs/nans/zeros |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
@phire: This comment grants you the permission to merge this pull request whenever you think it is ready. After addressing the remaining comments, click this link to merge. Other than these two nits, code LGTM. @dolphin-emu-bot allowmerge |
|
@phire I looked over it quickly. The numbers are correct (as much as that is possible here). I can go over the code more closely if you want me to, but I trust that you and the others who have reviewed and tested it have already done a fine job of that, and at a glance it looks fine to me. So I'd say go ahead and merge it. |
|
@mirrorbender Now that I've separated the vertical and horizontal calculations and moved away from pixels, I can see that the vertical timings are wrong by half a line per field. The NTSC timings should be You can confirm this by looking Figure 7 on page 11 of SMPTE 170M-2004. Half a line makes no sense in pixels, but it makes perfect sense for a CRT where the horizontal and vertical timings aren't directly connected and the image is rotated slightly anyway. I'll submit a second PR in the future to address this. |
b658331
to
c1a1ac1
Compare
|
I'm having trouble following the diagrams in terms of where the half lines go in the picture (half line at the end of field 1 and beginning of field 2?), but my reasoning for 486 was that two fields of 242.5 resulted in 484 full lines plus 2 separate half lines, which meant 486 was a better number if those half-lines were scanned to it's own vertical space within the active frame. However, assuming a slight tilt, I can see how 485 lines would be a better approximation of the appropriate height of the screen in a CRT TV. |
|
The half lines are at the start and end of the frame. The standard doesn't say it, but Field 1 is the even/lower field and Field 2 is the upper/odd field. For a digital video format which can't do half-lines, padding it to 486 lines (or discarding both half-lines and dropping down to 484 lines) make sense, but 485 lines is completely nonsensical. |
c1a1ac1
to
25b91f1
Compare
They are now based on signal timings rather than pixels, as it didn't make a lot of sense to do things with pixels. Now handles all 240i/240p/480i/480p modes without any special casing. Despite the diffrent equaions, this should result in the exact same aspect ratio as the previous code.
25b91f1
to
c49a82b
Compare
|
Comments have been updated to fix typos and add some details from the BT-470-6 standard. |
Rework the aspect ratio calculation (Fixes 240p mode)
|
FifoCI detected that this change impacts graphical rendering. Here are the behavior differences detected by the system:
automated-fifoci-reporter |
|
hi, aspect ratios still broken on N64 VC games -> going 16:9 when 4:3, bug report filed |
|
Technically that's correct emulation, as on a real Wii/TV you are required But we really should add .ini files for all virtual console games to Scott Mansell On 10 January 2016 at 23:03, fallaha56 notifications@github.com wrote:
|
|
Yes, any issue made is invalid. On Sun, Jan 10, 2016, 5:11 AM Scott Mansell notifications@github.com
|
|
Hehehe! It is accurate to the Wii, though. That's why it's not valid. On Sun, Jan 10, 2016, 5:14 AM fallaha56 notifications@github.com wrote:
|
|
I am okay with ini overrides, though. On Sun, Jan 10, 2016, 5:17 AM Justin C jmc4789@gmail.com wrote:
|
|
thanks @JMC47...fingers hurting from the added mouseclicks resetting ratios ;) can refile issue as 'finger injury' if that's better lol ;)) |
Calculations are now based on signal timings rather than pixels, as it didn't make a lot of sense to do things with pixels.
Now handles all 240i/240p/480i/480p modes without any special casing. Will even handle modes like 960i or 243@59.74hz
Despite the changes in equations, the resulting aspect ratios are identical.