vscale_mode extended functionality - explanation please

https://github.com/MiSTer-devel/Main_MiSTer/wiki

Moderators: Mug UK, Zorro 2, Greenious, spiny, Sorgelig, Moderator Team

esmith13
Atari User
Atari User
Posts: 32
Joined: Tue Oct 30, 2018 8:06 pm
Contact:

vscale_mode extended functionality - explanation please

Postby esmith13 » Fri Dec 21, 2018 4:36 pm

Hello all,

In the main MiSTer file update today (20181221) there was a change to the integer scaling option in the associated .ini file.
What was once vscale_integer= is now vscale_mode= and has new options.

Here is the new section in the MiSTer.ini:

Code: Select all

vscale_mode=0
; 0 - scale to fit the screen height.
; 1 - use integer scale only.
; 2 - use 0.5 steps of scale.
; 3 - use 0.25 steps of scale.


Could someone explain the advantages and/or disadvantages of modes 2 & 3 in relation to screen size @ 1080p and using the new scaler filters?
I personally have always used integer scaling in all my gaming setups to get the most crisp pixels and in some cases use scan lines or LCD (square pixel outlines) filters. In emulation, any scaling that wasn't integer would make filters or overlays look horrific - but I never had control over precisely choosing quarter or half step scaling.

Short of simply trying it myself on many games for each core for hours of testing, does anyone know how good or bad it would look to use these new options with filters for scan lines or LCD effects since they are exactly quarter or half steps?

Thanks in advance.

BlockABoots
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 141
Joined: Sat Oct 20, 2018 3:20 pm

Re: vscale_mode extended functionality - explanation please

Postby BlockABoots » Fri Dec 21, 2018 6:00 pm

Im guessing you use it to allow for smaller jumps in screen size when using integer scaling, so you can get a better fit on your display rather than losing some of the picture!??

esmith13
Atari User
Atari User
Posts: 32
Joined: Tue Oct 30, 2018 8:06 pm
Contact:

Re: vscale_mode extended functionality - explanation please

Postby esmith13 » Fri Dec 21, 2018 6:05 pm

BlockABoots wrote:Im guessing you use it to allow for smaller jumps in screen size when using integer scaling, so you can get a better fit on your display rather than losing some of the picture!??


How it itself works I understand. I'm looking to find out how it interacts with scandoubling, filters, scan lines, LCD effects, etc...

Also, just so you know, integer won't allow a scale value that makes the picture go off screen in the sense of resolution. It will go a step smaller if that would happen. If you have that issue where you do loose some top or bottom lines then you need to either adjust your TV/Monitor overscan settings or use the border option in the MiSTer.ini. That is not a result of using integer scaling.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5831
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: vscale_mode extended functionality - explanation please

Postby Sorgelig » Fri Dec 21, 2018 7:34 pm

it's related to filters and it was discussed in Filters topic.
half steps gives good look of scanlines and LCD effects while providing larger picture.

esmith13
Atari User
Atari User
Posts: 32
Joined: Tue Oct 30, 2018 8:06 pm
Contact:

Re: vscale_mode extended functionality - explanation please

Postby esmith13 » Fri Dec 21, 2018 7:37 pm

Sorgelig wrote:it's related to filters and it was discussed in Filters topic.
half steps gives good look of scanlines and LCD effects while providing larger picture.


Thanks for the info! Sorry about that. I looked around for a topic about integer scaling and the like but never thought to search the filters thread.

ghogan42
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 109
Joined: Wed Oct 17, 2018 7:27 pm

Re: vscale_mode extended functionality - explanation please

Postby ghogan42 » Fri Dec 21, 2018 7:49 pm

esmith13 wrote:
Sorgelig wrote:it's related to filters and it was discussed in Filters topic.
half steps gives good look of scanlines and LCD effects while providing larger picture.


Thanks for the info! Sorry about that. I looked around for a topic about integer scaling and the like but never thought to search the filters thread.


To see it most clearly, use a filter like normal_scanlines_100 with vscale_mode=0 (free scaling), vscale_mode=1 (integer scaling) and vscale_mode=2 (0.5 scaling) with the newest SNES core (maybe tg16 too).

You'll see that
(1) The scanlines look horrible with 0
(2) The scanlines look perfect with 1 but the image is quite small
(2) The scanlines look almost perfect with 2 and the image is bigger than with vscale_mode=0

esmith13
Atari User
Atari User
Posts: 32
Joined: Tue Oct 30, 2018 8:06 pm
Contact:

Re: vscale_mode extended functionality - explanation please

Postby esmith13 » Fri Dec 21, 2018 7:52 pm

ghogan42 wrote:
esmith13 wrote:
Sorgelig wrote:it's related to filters and it was discussed in Filters topic.
half steps gives good look of scanlines and LCD effects while providing larger picture.


Thanks for the info! Sorry about that. I looked around for a topic about integer scaling and the like but never thought to search the filters thread.


To see it most clearly, use a filter like normal_scanlines_100 with vscale_mode=0 (free scaling), vscale_mode=1 (integer scaling) and vscale_mode=2 (0.5 scaling) with the newest SNES core (maybe tg16 too).

You'll see that
(1) The scanlines look horrible with 0
(2) The scanlines look perfect with 1 but the image is quite small
(2) The scanlines look almost perfect with 2 and the image is bigger than with vscale_mode=0


Thank you so much for the clarification... And your filters!

BlockABoots
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 141
Joined: Sat Oct 20, 2018 3:20 pm

Re: vscale_mode extended functionality - explanation please

Postby BlockABoots » Sun Dec 23, 2018 8:21 pm

Just a quick question about these settings....
vscale_mode=0
; 0 - scale to fit the screen height.
; 1 - use integer scale only.
; 2 - use 0.5 steps of scale.
; 3 - use 0.25 steps of scale.

i take it if you use either option 2 or 3 your going to get uneven scanlines if using scanline filters?

BlockABoots
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 141
Joined: Sat Oct 20, 2018 3:20 pm

Re: vscale_mode extended functionality - explanation please

Postby BlockABoots » Sun Dec 23, 2018 8:30 pm

double post

ghogan42
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 109
Joined: Wed Oct 17, 2018 7:27 pm

Re: vscale_mode extended functionality - explanation please

Postby ghogan42 » Mon Dec 24, 2018 5:14 am

BlockABoots wrote:Just a quick question about these settings....
vscale_mode=0
; 0 - scale to fit the screen height.
; 1 - use integer scale only.
; 2 - use 0.5 steps of scale.
; 3 - use 0.25 steps of scale.

i take it if you use either option 2 or 3 your going to get uneven scanlines if using scanline filters?


Technically yes. But the whole point of adding mode "2" is that visually scanlines will look close to perfect anyway compared to mode 0. Mode 3 doesn't have too much of a point but requires no extra code so why not have it.

To see the most benefit from vscale_mode=2 or 1 you need to use a core with the PhaseAcc mode of the scaler. Which is just SNES, NES, TG16 and my test build of game boy that I put up here: https://drive.google.com/open?id=1J3le1 ... i0C9LHvdNa

The PhaseAcc mode (stands for phase accumulator) is needed for the phases for the filters to be calculated correctly across the whole screen. If you use older builds you won''t get perfectly even scanlines even with integer vscale (on some cores anyway. game boy is the worst offender).

BlockABoots
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 141
Joined: Sat Oct 20, 2018 3:20 pm

Re: vscale_mode extended functionality - explanation please

Postby BlockABoots » Tue Dec 25, 2018 12:26 am

Thanks for that does the Megadrive core not use the PhaseAcc mode scaler?

ghogan42
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 109
Joined: Wed Oct 17, 2018 7:27 pm

Re: vscale_mode extended functionality - explanation please

Postby ghogan42 » Tue Dec 25, 2018 6:52 am

BlockABoots wrote:Thanks for that does the Megadrive core not use the PhaseAcc mode scaler?


The new Genesis release does. My last post was before that release. Everything using the ascal scaler just needs a tiny change to enable PhaseAcc.

BlockABoots
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 141
Joined: Sat Oct 20, 2018 3:20 pm

Re: vscale_mode extended functionality - explanation please

Postby BlockABoots » Tue Dec 25, 2018 3:01 pm

Hmm so ive just tried mode 2 (0.5 steps of scale.) and on the NES core and using filter Catmull-Rom_Scanlines_40 on the game Rollergames on the very first stage when you move the screen vertically you can clearly see banding of the scanlines on the grey of colour of the road, yet if i use mode 0 then i dont get these banding issues at all. Any ideas why this happens?

ghogan42
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 109
Joined: Wed Oct 17, 2018 7:27 pm

Re: vscale_mode extended functionality - explanation please

Postby ghogan42 » Wed Dec 26, 2018 2:18 am

BlockABoots wrote:Hmm so ive just tried mode 2 (0.5 steps of scale.) and on the NES core and using filter Catmull-Rom_Scanlines_40 on the game Rollergames on the very first stage when you move the screen vertically you can clearly see banding of the scanlines on the grey of colour of the road, yet if i use mode 0 then i dont get these banding issues at all. Any ideas why this happens?


Well it could be several things

First of all, 4.5x scaling, like all non-integer scaling will have slightly uneven scanlines.

But it really shouldn't be something that you notice anymore with the updated nes core. I'm linking a photo (from my phone but it should be good enough) of Rollergames at 4.5x (vscale_mode=2 at 1080p) with Normal_Scanlines_100. That's the worst case for non-uniform looking scanlines. You TV should look this even with these settings. Using an older nes core will look worse.

Here's the newer nes core wih 4.5x scaling:
https://drive.google.com/open?id=198gi_ ... KhaOq6rsdi

Here's the older Dec 07 core with 4.5x scaling
https://drive.google.com/open?id=1LpbVy ... r4-klaGUKQ

Download and view at full size. If it looks like the first picture for you...that's as good as it will get. If it looks like the second then either you don't have an updated nes core or your tv is doing additional scaling (overscan). If it looks *worse* then it's got to be your tv or maybe you're feeding a 1080p tv with 720 or something.

ghogan42
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 109
Joined: Wed Oct 17, 2018 7:27 pm

Re: vscale_mode extended functionality - explanation please

Postby ghogan42 » Wed Dec 26, 2018 5:14 am

I checked again. There is a sizing problem when the NES core option "Hide Overscan" is on. That's what needs to be fixed. Set "Hide Overscan" to off and your problem should go away.

User avatar
Newsdee
Atari God
Atari God
Posts: 1539
Joined: Fri Sep 19, 2014 8:40 am

Re: vscale_mode extended functionality - explanation please

Postby Newsdee » Wed Dec 26, 2018 11:43 am

The hide overscan is supposed to be some black bands to hide parts of the image (removing artifacts in scrolling in e.g. Mario 3 and Double Dragon 2), but it looks like the upscaler attempts to make it full screen. That's good per se, but I suppose we'd need some filters that work with the new resolution, or adjust the overscan size to play ball better with the filters. Not sure what would be easier.

BlockABoots
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 141
Joined: Sat Oct 20, 2018 3:20 pm

Re: vscale_mode extended functionality - explanation please

Postby BlockABoots » Wed Dec 26, 2018 5:02 pm

ghogan42 wrote:
BlockABoots wrote:Hmm so ive just tried mode 2 (0.5 steps of scale.) and on the NES core and using filter Catmull-Rom_Scanlines_40 on the game Rollergames on the very first stage when you move the screen vertically you can clearly see banding of the scanlines on the grey of colour of the road, yet if i use mode 0 then i dont get these banding issues at all. Any ideas why this happens?


Well it could be several things

First of all, 4.5x scaling, like all non-integer scaling will have slightly uneven scanlines.

But it really shouldn't be something that you notice anymore with the updated nes core. I'm linking a photo (from my phone but it should be good enough) of Rollergames at 4.5x (vscale_mode=2 at 1080p) with Normal_Scanlines_100. That's the worst case for non-uniform looking scanlines. You TV should look this even with these settings. Using an older nes core will look worse.

Here's the newer nes core wih 4.5x scaling:
https://drive.google.com/open?id=198gi_ ... KhaOq6rsdi

Here's the older Dec 07 core with 4.5x scaling
https://drive.google.com/open?id=1LpbVy ... r4-klaGUKQ

Download and view at full size. If it looks like the first picture for you...that's as good as it will get. If it looks like the second then either you don't have an updated nes core or your tv is doing additional scaling (overscan). If it looks *worse* then it's got to be your tv or maybe you're feeding a 1080p tv with 720 or something.


Hmmm, the issue im having is not the scanlines per say its like a band behind the scanlines, ill try and take a video and see if it shows up in that. Would having old config files from the older NES cores (in the config folder) course any issues?

EDIT: ok i have just tried to capture it and the issue is not there anymore the only option ive changed was i disabled the 'vsync_adjust' option as with it enabled i was getting screen tearing now and again, could the be the cause of the issue i was having?

ghogan42
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 109
Joined: Wed Oct 17, 2018 7:27 pm

Re: vscale_mode extended functionality - explanation please

Postby ghogan42 » Wed Dec 26, 2018 10:40 pm

Newsdee wrote:The hide overscan is supposed to be some black bands to hide parts of the image (removing artifacts in scrolling in e.g. Mario 3 and Double Dragon 2), but it looks like the upscaler attempts to make it full screen. That's good per se, but I suppose we'd need some filters that work with the new resolution, or adjust the overscan size to play ball better with the filters. Not sure what would be easier.


No it's not the filters that need a fix. It wouldn't be possible to fix them anyway. I'm pretty sure that it's just a rounding error or something that causes the computed output size to be 1 line more or less than it should be with hide_overscan.

And the problem is gone. At least at 1080p with vscale_mode=2

You can try it here: https://drive.google.com/open?id=1O-t0z ... vlkoPiwqzH
I'll make a post in the NES thread too.

EDIT: It's just an issue when 0.5x scaling is used with a core that outputs an odd number of lines to the scaler. For example NES with hide_overscan=1 outputs 225 lines so at 4.5x the output height should be 1012.5. Which obviously is truncated to 1012. The only way to avoid the issue is not combine an odd number of scanlines with half integer scaling.

Locutus73
Atari Super Hero
Atari Super Hero
Posts: 538
Joined: Wed Feb 07, 2018 6:13 pm

Re: vscale_mode extended functionality - explanation please

Postby Locutus73 » Sat Jan 12, 2019 10:29 am

I think a cool additional scaling mode could be an integer+crop, I mean an integer scaler which uses the same factor as the integer we have now added by one and cropping the lines exceeding the actual resolution. i.e. NES and SNES 224 pixel vertical resolution would be integer scaled x5 when using 1080p, getting an integer scaled game window with an height of 1120 pixel; those 1120 pixel should be cropped removing 20 lines in the upper part of the image and 20 lines in the bottom part, getting 1080 pixels. Those 20 lines correspond to 5 lines of the original game and usually old CRT games were designed to display useful information in a “safe zone” smaller than the actual resolution, i.e. Nintendo recommended this (pay attention, this image considers NES/SNES vertical resolution as 240, which isn’t wrong, since PPU is able to use all those lines, regardless take account of this for considering the image) Image
We would gain full screen and integer scale and we would loose some peripheral pixels mostly cropped back then by CRT TV sets.

Thank you in advance.
Best regards.

Locutus73
Last edited by Locutus73 on Sat Jan 12, 2019 12:41 pm, edited 1 time in total.

esmith13
Atari User
Atari User
Posts: 32
Joined: Tue Oct 30, 2018 8:06 pm
Contact:

Re: vscale_mode extended functionality - explanation please

Postby esmith13 » Sat Jan 12, 2019 12:34 pm

Sounds like an excellent idea!

Locutus73
Atari Super Hero
Atari Super Hero
Posts: 538
Joined: Wed Feb 07, 2018 6:13 pm

Re: vscale_mode extended functionality - explanation please

Postby Locutus73 » Sat Jan 12, 2019 12:38 pm

esmith13 wrote:Sounds like an excellent idea!

Well, that’s not an original idea of mine.

Locutus73

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5831
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: vscale_mode extended functionality - explanation please

Postby Sorgelig » Sat Jan 12, 2019 12:41 pm

Almost all cores don't expect any cuts, so NES example is not representative.
NES has overscan hide which is actually already what you are asking just a little differently implemented.

Integer scaling is too exaggerated. There are good filters making arbitrary scaling look almost the same as NN and cover the whole screen.

Locutus73
Atari Super Hero
Atari Super Hero
Posts: 538
Joined: Wed Feb 07, 2018 6:13 pm

Re: vscale_mode extended functionality - explanation please

Postby Locutus73 » Sat Jan 12, 2019 1:06 pm

Sorgelig wrote:Almost all cores don't expect any cuts, so NES example is not representative.

I can’t honestly speak for other systems, but I guess that for TV connected consoles, programmers had to take account of some overscan.

Sorgelig wrote:NES has overscan hide which is actually already what you are asking just a little differently implemented

Interesting, I see this code in NES

Code: Select all

      if(hide_overscan) begin
         HBlank <= (hc > (256-8)) || (hc<7);
         VBlank <= (vc > (240-10)) || (vc<7);
      end else begin
         HBlank <= (hc >= 256);
         VBlank <= (vc >= 240);
      end

Does it mean that, with hide overscan off, the whole 256x240 PPU image gets stretched to 4:3 by the scaler to the final gaming window (regardless of the scaling factor, i.e. 240x4 or 240x4.5), while with hide overscan on the inner 242x224 pixels are stretched by the scaler (i.e. 224x4, 224x4.5, 224x4.8 for full screen)?

Sorgelig wrote:Integer scaling is too exaggerated. There are good filters making arbitrary scaling look almost the same as NN and cover the whole screen.

I agree with you that is exaggerated especially for HDTV at couch distance, but options are always welcome (I know, you may say Locutus73 implement the options you want).

Regards.

Locutus73

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5831
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: vscale_mode extended functionality - explanation please

Postby Sorgelig » Sat Jan 12, 2019 1:26 pm

Locutus73 wrote:I can’t honestly speak for other systems, but I guess that for TV connected consoles, programmers had to take account of some overscan.

Not correct. Only very old consoles like NES, Atari 2600 and others of that age didn't take in account the visible area.
Newer consoles like SMS, SNES, Genesis, TG16, etc. - they already don't include overscan area that's why they use 224 lines for NTSC. So they don't expect additional cut.

Locutus73
Atari Super Hero
Atari Super Hero
Posts: 538
Joined: Wed Feb 07, 2018 6:13 pm

Re: vscale_mode extended functionality - explanation please

Postby Locutus73 » Sat Jan 12, 2019 3:29 pm

Sorgelig wrote:Not correct. Only very old consoles like NES, Atari 2600 and others of that age didn't take in account the visible area.
Newer consoles like SMS, SNES, Genesis, TG16, etc. - they already don't include overscan area that's why they use 224 lines for NTSC. So they don't expect additional cut.


Thnx... even if AFAIK NES and SNES are identical in that regard, and software potentially could use all 240 lines, i.e. SNES 240p test suite has an Overscan 239p test pattern.
Regardless, what about the other question about the Hblank and scaler in my previous post? Does MiSTer work in the way I guessed?

Thank you in advance as always Sorg.
Ciao.

Locutus73


Return to “MiSTer”

Who is online

Users browsing this forum: No registered users and 14 guests