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

Screen sizes issues #79

Closed
Vweber73 opened this issue May 6, 2022 · 107 comments
Closed

Screen sizes issues #79

Vweber73 opened this issue May 6, 2022 · 107 comments

Comments

@Vweber73
Copy link

Vweber73 commented May 6, 2022

Hi,
All but Borderless screen modes don't have the correct ratio, they are too compressed vertically.
"Narrow" comes close, but the top is cut (status line in Workbench, title in Interceptor for instance).
"Borderless" is nice, but the screen zoom is not fixed, varies with what is on screen, disturbing for demos and even for the welcome "hand disk".
I think zooming should not be at the expense of screen ratio... My 2 cents.

Cheers

@Vweber73
Copy link
Author

Hi,
So, maybe this could be the next issue, screen look and size is important :) narrow mode looks ok but the top is cut, like title line in Interceptor and workbench...
Cheers

@mithrendal
Copy link
Contributor

yes lets do it ... I draw with dpaint a big circle and measure the pixels on the rendered screen output ... narrow is nearly perfect ... the others are way off

@Vweber73
Copy link
Author

Nearly perfect, but beheaded ;)

@mithrendal
Copy link
Contributor

True. I meant the aspect ratio 😬. We will have to adapt them all 🙈

@Vweber73
Copy link
Author

Good luck ! ;) And thanks...

@mithrendal
Copy link
Contributor

mithrendal commented May 22, 2022

the current calculation of display area is completely wrong 😬... not only the cut out of screen buffer ... but also the later scaling of the output canvas ... I found that it still has fixed values 🙈brought over from the vc64web ... embarassing 😱... expect this to be corrected very soon !! 😎

@Vweber73
Copy link
Author

Excellent, thanks ! Yes I always thought something was wrong... :)
Also, I don't want to be picky, but there is a very light flickering during the vertical scrolling of Gravity Force (another of my all times favourites - simple but unique and addictive game), which does not appear in RetroArch/PUAE. Maybe your resolution fixes will also fix this ?
Cheers

@mithrendal
Copy link
Contributor

new version with corrected aspect ratios is pushed out...

what was curios while correcting this is that the aspect ratio was not 4:3 as some sites claim said but for PAL it is 5/4 when having quadratic pixels as this site said http://coppershade.org/articles/More!/Topics/Correct_Amiga_Aspect_Ratio/

I think 4:3 for NTSC ... I worked around this by dividing the width and height of the cut out from the amiga screen buffer dynamically ... so even with borderless it should (in theory) correct the aspect ... hope that is true ... of course not if you intentionally use "cinematic wide screen" option from the settings

@Vweber73
Copy link
Author

The result is excellent, congrats and thanks ! The Workbench is now crisp and clear, Interceptor now with this + overclocking has nothing to envy to NTSC mode, no more need to do it :) really catching up with PUAE, great ! Only a very small bit of flickering in Gravity Force vertical scrolling, not sure if this could be improved, but that's very light anyway...
Cheers

@mithrendal
Copy link
Contributor

there was a bug ... on some of my machines it reported wrong canvas height (doubled !) and that resulted in complete wrong aspect ratios ... I just pushed out a new version ... should run on all plattforms now ...

@Vweber73
Copy link
Author

It was on my Z3, but I updated the version anyway.
Screenshot_20220522-181949_Chrome
Screenshot_20220522-181959_RetroArch (AArch64)

Maybe some slight pixel distorsion... See attached the kickstart 3.1 boot screen for both vAmigaWeb and PUAE, the 5 of "1985" is thiner in PUAE...

@Vweber73
Copy link
Author

Vweber73 commented May 22, 2022

Funny, changing the rendered from GPU to software makes it perfectly crisp ! Normal ?
Screenshot_20220522-182340_Chrome

@mithrendal
Copy link
Contributor

mithrendal commented May 22, 2022

yes I know now why ... in the scaling algorithm I ask for the real pixels of the canvas output ... in software renderer this is the current cut out size of amigas screen buffer ... but in gpu shader rendering javascript reports always the shader buffer which I set to a maximum of 724 x 568 ... for this reason it scales so ugly because the aspect ratio is slightly wrong... i try to fix it

@Vweber73
Copy link
Author

Great, thanks !

@Vweber73
Copy link
Author

It seems there are still some bugs... When moving from portrait to landscape, moving from software to GPU etc... I got different sizes for borderless for Interceptor (see 2 pictured attached). I also got the bad ratios of previous versions coming back ?!
Screenshot_20220522-205305_Chrome
Screenshot_20220522-205617_Chrome

@mithrendal
Copy link
Contributor

mithrendal commented May 22, 2022

yes borderless switches to a propriety cut out which is often not exactly 4:3 ratio (or PAL 5/4) and GPU shader has currently the problem that it can not adapt to it due to the wrongly reported width which is not the width choosen by borderless algrithm but the witdth of the GPU shade texture ...

I bet you see it only when borderless and GPU shader, right? borderless and software rendering works ok?

@Vweber73
Copy link
Author

No, I have problems with software as well, it is driving me nuts...
Example: I load my snapshot on Interceptor menu, without virtual keyboards it looks like this, quite full screen :
Screenshot_20220522-211623_Chrome
Then I selected the virtual keyboard, it shrinks like this:
Screenshot_20220522-211635_Chrome
Then I off the keyboard, but it doesn't go back to the first state...:
Screenshot_20220522-211645_Chrome

Once it is messed up, I have bad ratios coming back for narrow, standard... It seems that switching to landscape and back to portrait also messes it up !

@Vweber73
Copy link
Author

One thing that may play a role, correct me if I am wrong: Interceptor is a NTSC game. So on a PAL machine, some lines (16) are wasted at the bottom (black). On a NTSC machine, pixels are taller, so the 240 lines can fill the screen entirely. That's why I wanted NTSC, for full-screen Interceptor (+speed increase from 50 to 60khz). Is borderless able to match NTSC pixel ratio (320/240 = 4/3) rather than PAL ratio (320/256 = 1.25) ? I would be very good to have the NTSC aspect without emulating NTSC :)
And could this PAL/NTSC stuff be messing up your screen resolutions ?

@mithrendal
Copy link
Contributor

thanks ... I can reproduce the problem ... wait I have to debug ...

@Vweber73
Copy link
Author

Great ! A reproduced bug is a half-fixed one :)

@mithrendal
Copy link
Contributor

mithrendal commented May 22, 2022

Ok got it ... it goes like this...

-- you are in borderless mode --

first you started the vAmigaWeb -> it scales the ratio according to the kickstart disk hand picture

then you loaded a snap shot borderless calculates new screen buffer cut out, but !! -> no rescaling of aspect ratio takes place

(this is the bug I think)

then later always when you kick in the keyboard or resize landscape / portrait -> it rescales the ratio

so ... the first picture of you (the one which never came back) had the wrong ratio from the kickstart hand disk logo screen

ok what we should do I think is ... everytime the borderless changes dimensions of the cut out then it must also rescale to the correct ratio ... no ?

PS: I veryfied this hypothesis by launching dpaint from snapshot with a circle ... the circle was wrongly scaled ... then on keyboard in .. it was correct

@Vweber73
Copy link
Author

Ok, but:
-If you keep the ratio, how to adjust for NTSC games (like Interceptor) to be full-screen with no waste (see my previous post) ?
-If also saw some wrong ratios coming back for other settings than borderless (narrow, standard...). Could you reproduce this ?

@mithrendal
Copy link
Contributor

mithrendal commented May 22, 2022

borderless
right after kickstart had disk... loaded this snapshot
image

the circles height is too great...

now kick the keyboard in ... which does the rescale

image

@mithrendal
Copy link
Contributor

mithrendal commented May 22, 2022

Ok, but:
-If you keep the ratio, how to adjust for NTSC games (like Interceptor) to be full-screen with no waste (see my previous post) ?

hm ... when we always do the rescale with a "variable" aspect ratio according to the borderless width / height then it adapts to NTSC/PAL automatically no?

lets try it out...

@mithrendal
Copy link
Contributor

the current version has the bug that it does not rescale aspect ratio when borderless changes dimensions... you can manually force rescale of correct aspect ratio by switching keyboard off/on

@Vweber73
Copy link
Author

Ok, but:
-If you keep the ratio, how to adjust for NTSC games (like Interceptor) to be full-screen with no waste (see my previous post) ?

hm ... when we always do the rescale with a "variable" aspect ratio according to the borderless width / height then it adapts to NTSC/PAL automatically no?

lets try it out...

If that's the case that would be fine ! :)

@mithrendal
Copy link
Contributor

mithrendal commented May 22, 2022

-If also saw some wrong ratios coming back for other settings than borderless (narrow, standard...). Could you reproduce this ?

yes now I see it too... they also do no rescale when switched to 🙄 ... you are a brilliant alpha😂 tester

@mithrendal
Copy link
Contributor

mithrendal commented May 22, 2022

pushed out a new version ... should be hitting the server in a minute or so

UPDATE: new version which corrects the scaling in borderless and when switching between the different display sizes is on the server

@Vweber73
Copy link
Author

I'm proud to be an alpha-tester ! :)
Well, this one has problems...
First, when switching to narrow in Interceptor I suddenly got a blank screen, that wouldn't go away by changing display mode, only a reset would :
Screenshot_20220522-231019_Chrome
Then, I no longer have the taller cockpit ("NTSC mode") that i use to have sometimes. Both narrow and borderless has the same height, even if they are not positionned at the same place... Here they are:
Screenshot_20220522-231141_Chrome
Screenshot_20220522-231216_Chrome

It is as if the pixel ratio was always the same (PAL) ?

Have you done something with the GPU pixel scaling ? (Haven't compared with software yet).

Cheers

@Vweber73
Copy link
Author

Also, the borderless mode is a bit cut at the bottom...

@mithrendal
Copy link
Contributor

mithrendal commented May 27, 2022

pushed new version where we have now
reduced display height on narrow, standard, wide, overscan by 48 pixel when NTSC pixel ratio is on

do you think this is good now?

EDIT: first I thought hand disk logo is a bit positioned too far at the bottom but then I saw this video where a NTSC amiga 1000 boots https://www.youtube.com/watch?v=-dyxKJx9N5E

but look when I directly compare it with this way ...
image

the picture from the youtube video got more pixel on the top and a little more on the bottom too

another guy talks about PAL vs NTSC and how WinUAE is wrong and how to configure it right here at 18:09
https://www.youtube.com/watch?v=D5hiwB7lzk8

the claimed correct NTSC WinUAE picture from that video see here at the very right
image

@Vweber73
Copy link
Author

Wow, thanks for the research, this is giving me headache now... I really don't know...
Anyway good for NTSC, for PAL I really like what you said: navbar height + keyboard height + Amiga screen height <= heigth of your device e.g. Z3 Fold. Yes indeed why not doing it this way... But I also like the current way on second thoughts, since vAmigaWeb allows to remove temporarily the menu bar, doing it this way when you want real full screen is good and makes use of 100% of the real estate, so it could be kept that way.
I like borderless for games, for demos like Burning Spear which keep changing the resolution it is a bit of a mess with a change of scale...

Thanks and cheers

@mithrendal
Copy link
Contributor

mithrendal commented May 27, 2022

I think it is fine now. 😎The reduced height on ntsc is also good too because it will be used on ntsc games only which do not have overscan pixel at the bottom right? We should try some ntsc games and see whether the fixed sizes cut off their bottom graphics or not 😬 in which case we simple would lower the 48 to lets say 42 or so…

@Vweber73
Copy link
Author

Well, problem, in borderless with keyboard, moving to NTSC cuts the cockpit completely, and moving back does not restore it completely... See attached
Screenshot_20220527-235216_Chrome
Screenshot_20220527-235248_Chrome

@mithrendal
Copy link
Contributor

mithrendal commented May 28, 2022

in borderless with keyboard, moving to NTSC cuts the cockpit completely, and moving back does not restore it completely...

confirmed ...
the -48pixel is applied to borderless too 🙈…there are now with ntsc so much ifs in the code ... did not test all code paths...😬

just pushed new version out which should correct this and do not introduce new bugs 🙄hopefully

EDIT: for testing purposes I created an actionbutton which toggles NTSC
document.getElementById("ntsc_pixel_ratio_switch").click();

@Vweber73
Copy link
Author

Confirmed working, thanks,
In borderless PAL the bottom of the cockpit is touching the edge of the app controls, so the color of the last line is the same as the app one, blending into it and giving the impression of a cut... Oh well, never mind.

@Vweber73
Copy link
Author

Vweber73 commented May 28, 2022

With picture
Screenshot_20220528-090617_Chrome

@mras0
Copy link
Contributor

mras0 commented May 28, 2022

FWIW Interceptor isn't really running in NTSC mode it just uses the same screen dimensions, so on a real PAL amiga the bottom of the screen is also empty and the aspect ratio is (probably) off compared to a NTSC machine.

This is what it looks like on my PAL A1200:

WB (Standard hi-res PAL, notice the mouse cursor where the screen ends):
image

Interceptor:
image

@mithrendal
Copy link
Contributor

In borderless PAL the bottom of the cockpit is touching the edge of the app controls, so the color of the last line is the same as the app one, blending into it and giving the impression of a cut... Oh well, never mind.

we could give the keyboard a darker top border ... to make that effect vanish

@Vweber73
Copy link
Author

@mras0 Thanks ! Yes indeed it is cut on PAL Amiga, that was the same on my 500.
@mithrendal Good idea, thanks !

@mithrendal
Copy link
Contributor

In borderless PAL the bottom of the cockpit is touching the edge of the app controls, so the color of the last line is the same as the app one, blending into it and giving the impression of a cut... Oh well, never mind.

try this javascript command in an action button via the + icon in the navbar ...

$("#virtual_keyboard").css("box-shadow", "inset 0 0 0.2em black");

it will give the keyboard a black borderline on the top

image

or this

$("#virtual_keyboard").css("background-color", "black");

it will make the keyboard background black...

image

@Vweber73
Copy link
Author

Sweet, thanks !

@dirkwhoffmann
Copy link

I've merged the current NTSC code (main functionality is working) into the main branch. Before doing more "NTSC" stuff in the web version, I recommend to merge the latest code and do all further experiments with real NTSC mode enabled. Use the following calls to switch between both modes:

amiga.configure(OPT_MACHINE_TYPE, MACHINE_PAL);
amiga.configure(OPT_MACHINE_TYPE, MACHINE_NTSC);

vAmiga supports "hot switching" which means it's safe to switch between PAL and NTSC any time. However, keep in mind that Kickstart runs a PAL / NTSC check during startup. Hence, Kickstart won't recognise any "hot switch". The same applies to games or demos that either run a similar check or rely on the value provided by the OS.

@Vweber73
Copy link
Author

Sorry to come back to this, but something is still wrong, the screen is cut left and right for some games.
Screenshot_20220530-192851_Chrome
Screenshot_20220530-192916_RetroArch (AArch64)

See attached settlers intro screen for vAmiga (narrow, but all modes show the problem - overscan is shifted to the right, strangely) and RetroArch/PUAE (the left and right circled are not cut)

@Vweber73
Copy link
Author

I understand the game uses overscan (720 pixel wide) and that therefore overscan mode should be used (but anyway to trigger it automatically, like PUE does ?). But see attached, the image is shifted to the right and therefore cut, not centered correctly...
Screenshot_20220530-193555_Chrome

@mithrendal
Copy link
Contributor

mithrendal commented May 30, 2022

good find 🤗 ... if you set viewport tracking or borderless it will be good for the left side but not for the right side ...

when I take a snapshot and look in the snapshot browser I can see that the core does not give us more than this image data ... right side circle is cut

image

I will upgrade to latest core as it seems that the overcsan implementation was wrong but has been fixed in the meantime see here dirkwhoffmann/vAmiga#698

@Vweber73
Copy link
Author

Excellent, thanks, let me know when it is available :)
What about automatic triggering, like PUAE does, i.e. when overscan resolution is detected, overscan mode is enforced ?

@mithrendal
Copy link
Contributor

mithrendal commented May 30, 2022

What about automatic triggering, like PUAE does, i.e. when overscan resolution is detected, overscan mode is enforced ?

you get this automatic when choosing viewport tracking or borderless ... or what does PUAE different than that?

@Vweber73
Copy link
Author

Oh ok, you mean that with the new core version things will be fine in borderless and viewport modes then. I thought it would not be the case, since for now both ends are cut, not just the right one...

@Vweber73
Copy link
Author

Vweber73 commented Jun 3, 2022

Hi,
Any progress on the new core (NTSC + Overscan fix + ?) into vAmigaWeb ?
Many thanks and best regards

@mithrendal
Copy link
Contributor

mithrendal commented Jun 3, 2022

yes the new core runs very fine 😎 ...

image

there is still a small minor pixel problem on the right side ... between software renderer and GPU renderer there is a difference in 4 pixels on the right side only in this extreme overscan of settler ... before pushing this I like to understand and solve this

the picture above shows software renderer which is missing 2 pixels to the right...

has to do with viewtracking reports hstop_max 4 pixels greater than the screenbuffer really is ... needs to be further analysed before we push out this version no? ... we want it to be perfect 😎

next is the NTSC capability of the new core which is fairly easy to connect to ...

@Vweber73
Copy link
Author

Vweber73 commented Jun 3, 2022

Excellent, thanks !
I was just thinking: could vAmigaWeb detect before hand the screen resolution and adapt to it ? Like if it is overscan, trigger overscan mode ? That's not what borderless / viewport do, they rather dynamically detect the border based on colors, not on screen resolution, right ?
Cheers

@mithrendal
Copy link
Contributor

that is because the screen resolutions and viewports are altered dynamically by the amiga software e.g. games ... in Amiga there is not such a thing that the resolution is initially set in boot block and then stays static until the next reset...

@Vweber73
Copy link
Author

Vweber73 commented Jun 3, 2022

That's right, but why not detecting those resolution changes rather than the colors borders ?

@mithrendal
Copy link
Contributor

viewport tracking = permanently tracks the resolution changes set by amiga software
borderless = takes the viewport values of viewport tracking and additionally tries to eliminate same colored borders

what you describe is already 😎 at your choice

@Vweber73
Copy link
Author

Vweber73 commented Jun 3, 2022

I see, thanks ! I got fooled by the Burning Spear demo, it changes resolutions so many times...and that causes vAmigaWeb extreme zoom changes. PUAE ones are not that extreme, maybe different scaling ?, so I thought that viewport was different...

@Vweber73
Copy link
Author

Vweber73 commented Jun 3, 2022

A bit of problems still with viewport tracking, cut on the left... Same issue that the one you mentionned ?
Screenshot_20220603-120312_Chrome

@mithrendal
Copy link
Contributor

mithrendal commented Jun 5, 2022

@Vweber73

first

I felt the need for an environment to evaluate and test vAmigaWeb before releasing to the masses ...

therefore there is now a UAT environment (UAT stands for user acceptance test)

at https://vamigaweb.github.io/uat

second

into the uat goes:

  • a brand new version with the cores brand new NTSC capabilities so it is not just the screensize and pixelratio which will be NTSC like but also clockspeed of chipset is raised to 60Hz and more

image

  • I did reset all settings to support overscan screen sizes

when vAmigaWeb at uat proves to be stable then we will publish it to its regular address at
https://vamigaweb.github.io which is currently still the stable version

@Vweber73
Copy link
Author

Vweber73 commented Jun 5, 2022

Hi,

Many thanks for creating this test app ! I could replace the current stable one with this one and test it, after a few tries.

My experience so far:

  1. My snapshots don't work anymore (the Amiga resets) but I guess this is normal. Saving new snapshots and restoring them seems to work.
  2. Settlers now seems to work fine, but while viewport uses all the width of the screen, overscan mode keeps a small margin left and right. Normal ?
  3. Settlers has no intro music in NTSC mode when hot-swapping. Hot-swapping back to PAL restores the sound...
  4. Most importantly, Interceptor is screwed up because super slow in 7mhz mode, be it in PAL or NTSC mode. I first thought it was a sound problem like Settlers since I didn't hear the music, but then I realize how slow the text was, and the music started... during the flight demo mode ! Complete desynch...

Cheers

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

No branches or pull requests

4 participants