5× Vertical *Per-Game* Integer Scaling for Amiga Is Here

User avatar
limi
Top Contributor
Posts: 776
Joined: Sun May 24, 2020 6:53 pm
Has thanked: 180 times
Been thanked: 570 times

5× Vertical *Per-Game* Integer Scaling for Amiga Is Here

Unread post by limi »

The Amiga core (aka. Minimig) with MegaAGS now supports 5× vertical integer scaling, crop and offsets on a per-game basis. And the optimal settings are all handled for you — transparently — within the MegaAGS setup.

What does this mean?

First, as we say in the business — “Sometimes a GIF is worth a thousand words.”

Have a look at some example games:

(These are real screenshots from the core, superimposed on a TV graphic to give a better impression of how it appears in real life)

Flashback.gif
Flashback.gif (96.28 KiB) Viewed 54358 times
Gods.gif
Gods.gif (120.14 KiB) Viewed 54358 times
Megalomania.gif
Megalomania.gif (100.03 KiB) Viewed 54358 times
Lionheart.gif
Lionheart.gif (98.06 KiB) Viewed 54358 times

How does this work?

“I thought PAL on Amiga was 256 pixels tall, that results in a 1280 pixel tall image when doing a 5× zoom — which is more than a 1080p display has. Do I need a 1200px tall monitor to make use of this?”

No, we can actually make this work with 1080p. The large majority of Amiga games run in PAL, not NTSC, which on paper should make this impossible. However, pretty much all of the games (with some exceptions, which we handle) only use the top 200px of the viewport.

This was exceedingly common in Amiga games, since European developers would often restrict the games to be 200px tall to ensure that they could (theoretically!) work in NTSC resolutions, which on the Amiga was 200px (without overscan).

Interesting — what does that mean?

It means that we can apply a 5× scaling factor, since 200px × 5× scale = 1000px. You may have noticed that when you run a game on the Amiga core currently, there’s a lot of wasted, empty space — since everything runs at 4× scale on a 1080p display to ensure that all the pixels are visible. It theoretically has to do this, since the vertical resolution of the Amiga is 256px in PAL mode. But since most games don’t use the full 256px height, those games can be displayed with a 5× scale instead, as long as the game doesn’t have any critical elements outside of a 216px viewport (216×5 = 1080p).

Sounds good, but I can see some potential issues here?

You’re right. Amiga is kind of complicated, in the sense that it supports a wide range of different resolutions. So we couldn’t just blindly apply a 5× scale for the core, as many games would be unplayable.

Additionally, the offset when you do 5× scale could result in large parts of the image being off-screen, since games can choose their own offset when they target any resolution, include overscan, etc.

In summary, it’s hard to make a top-level setting do a good job at optimally using the 1080p display as a global setting.

What can we do, then?

What we need is a per-game setting for which games should use 5× scale, a custom setting per-game for the offset when it does, and the ability to revert to a different setting when you exit the game and start another game.

Additionally, Amiga was, interestingly, the first core to support 5× scaling in the first place, using a file in /config named minimig_vadjust.dat. But this setting was global, which didn’t solve our problem.

What we proposed, and what we ultimately implemented, was the ability for the Amiga core to read this vadjust file from the /shared directory that can be read, written, and interpreted by both the Amiga core as well as MiSTer’s scaler.

Whenever we start a game in MegaAGS — a script that produces an image with a launcher with a curated set of Amiga games and demos, given a set of games — we look up what the optimal settings for that particular game is, and copy a custom vadjust file to that directory.

When MiSTer changes resolutions in the Amiga core, it checks whether there is a vadjust file in the shared directory, and applies those settings.

And yes, that does mean that every single game in the resulting image needs to have its own 5× settings. We have gone through the top 700(!) games on the Amiga, manually adjusted whether it should use 5× scaling, and when it does — what kind of offset that game needs to not unnecessarily cut off any critical game elements.

(The games we didn’t touch are still at the default 4× setting, and will work as before.)

With the latest MegaAGS (the 2021 versions onwards), you will get customized 5× integer vertical scaling for the games that use 200px of the available viewport.

In general, the approach for 5× scale/crop is that it’s OK to sacrifice a few lines on the top and/or bottom.

This means that we may sacrifice a few pixels, which could be critical in e.g. a platformer like Flashback, where you could have platforms that were just 1-2 pixels of the viewport, and have a bad effect on difficulty level or gameplay in general. We take special care to make sure this never happens.

We make sure the offset is set to not affect the gameplay, while still using as much of the screen as possible.

There’s also entire classes of games, e.g. driving games and top-down games that don’t rely on seeing every single pixel for the game to work fine. This is when we accept cropping. And if you try the game in 4× vs. 5× on an actual TV instead of these screenshots, I think you will agree that losing a few pixels in-game to the 5× scale is a trade-off worth making.

Many of the European games have an interesting quirk: The game itself fits neatly into 5×PAL, sometimes with a few pixels of crop with the right vertical offset — but often have a 256px title screen with artwork that will have more serious crop in 5×PAL. We think this is a reasonable trade-off to make, so you might see some title screens and intermission screens have cropping that doesn’t look optimal at first glance. However, we only do this when there’s no information lost as far as gameplay is concerned.

We hope you enjoy this huge upgrade to the Amiga games you know and love on your 1080p screen!


Some additional notes:

  • NTSC is always 5× scale using MegaAGS, since it is usually 200px tall, and suffers no ill consequences or cropping, being scaled to 1000px tall with a 40px letterbox on top/bottom to make it 1080p.

  • You can turn off the Dynamic Crop setting in the Options section of the launcher if you prefer to not have this be the default behavior.

  • Just for the record, none of this has any effect on the analog output. Amiga usage on CRTs works the way it always did.


User avatar
mapf
Posts: 164
Joined: Mon Aug 31, 2020 8:05 pm
Has thanked: 58 times
Been thanked: 56 times

Re: 5× Vertical *Per-Game* Integer Scaling for Amiga Is Here

Unread post by mapf »

Is the script checking for the resolution that I am using with my MiSTer setup before tampering with the multiplicator (e.g. when using a 1600x1200 TFT)? Also: Is there a way to globally disable the feature instead of changing back each and every game?
User avatar
limi
Top Contributor
Posts: 776
Joined: Sun May 24, 2020 6:53 pm
Has thanked: 180 times
Been thanked: 570 times

Re: 5× Vertical *Per-Game* Integer Scaling for Amiga Is Here

Unread post by limi »

You can comment out the SetVAdjust script in S: to disable it altogether. We’ll add an Options script to do it soon. Update: There’s now a “Disable Dynamic Crop” in the Options section.

There’s unfortunately no realistic way to dynamically handle 5× scale for resolutions other than 1080p (which by far the most common resolution) at the moment.
User avatar
SegaSnatcher
Posts: 163
Joined: Sun May 24, 2020 9:18 pm
Has thanked: 36 times
Been thanked: 43 times

Re: 5× Vertical *Per-Game* Integer Scaling for Amiga Is Here

Unread post by SegaSnatcher »

Amazing!! Fantastic work Limi! I've absolutely been loving the Amiga core and this is extremely appreciated.
ByteMavericks
Posts: 56
Joined: Tue Oct 27, 2020 4:52 pm
Has thanked: 69 times
Been thanked: 11 times

Re: 5× Vertical *Per-Game* Integer Scaling for Amiga Is Here

Unread post by ByteMavericks »

That is excellent work! I was going to ask whether you'd created an API between the Amiga and core, but using share: is a really elegant way to achieve this with no core changes. Nice work everyone involved!
User avatar
LamerDeluxe
Top Contributor
Posts: 1239
Joined: Sun May 24, 2020 10:25 pm
Has thanked: 887 times
Been thanked: 284 times

Re: 5× Vertical *Per-Game* Integer Scaling for Amiga Is Here

Unread post by LamerDeluxe »

I just downloaded (non 5x) MegaAGS yesterday and it is really fantastic! Lots of different options of ordering and categorizing the games and demos. Fast loading and often no need for a mouse or even a keyboard. Great to see Amiga games fill the screen while still having clean scan lines.
Milspex
Posts: 167
Joined: Wed Jun 10, 2020 6:46 pm
Has thanked: 38 times
Been thanked: 35 times

Re: 5× Vertical *Per-Game* Integer Scaling for Amiga Is Here

Unread post by Milspex »

does the MegaAGS crew have a website? I find it super hard to find their releases. I have their 2020-09-28 release

(edit: obviously I dont mean where to download, just "release" information and stuff)
User avatar
limi
Top Contributor
Posts: 776
Joined: Sun May 24, 2020 6:53 pm
Has thanked: 180 times
Been thanked: 570 times

Re: 5× Vertical *Per-Game* Integer Scaling for Amiga Is Here

Unread post by limi »

I’m considering setting up something simple that tracks changes and explains the features, etc.

(and yes, we don’t distribute any of the games, for legal reasons — just the build script)
Higgy
Posts: 92
Joined: Mon May 25, 2020 9:37 am
Has thanked: 7 times
Been thanked: 30 times

Re: 5× Vertical *Per-Game* Integer Scaling for Amiga Is Here

Unread post by Higgy »

@limi thanks for the link and great work.
It mentions bootable .HDF formatted to FFS, I guess it will still work with say PFS3?
FFS is a bit creaky compared to the newer file systems.
User avatar
limi
Top Contributor
Posts: 776
Joined: Sun May 24, 2020 6:53 pm
Has thanked: 180 times
Been thanked: 570 times

Re: 5× Vertical *Per-Game* Integer Scaling for Amiga Is Here

Unread post by limi »

It converts everything to PFS as part of the script. :)
chanunnaki
Posts: 105
Joined: Tue Jul 07, 2020 1:33 am
Been thanked: 19 times

Re: 5× Vertical *Per-Game* Integer Scaling for Amiga Is Here

Unread post by chanunnaki »

I wish there was a guide showing me how to use the build scripts. I'm lost :P
User avatar
Aspie
Posts: 188
Joined: Sat Sep 26, 2020 1:07 pm
Location: Manchester
Has thanked: 20 times
Been thanked: 47 times
Contact:

Re: 5× Vertical *Per-Game* Integer Scaling for Amiga Is Here

Unread post by Aspie »

I was trying Sensible World of Soccer on the MegaAGS. I have the MegaAGS save file on the second drive. But when I try to save my game in career mode it doesn't work. I tried adding a save disk in floppy drive 0 but that didn't work. Anyone got this to save?

If I run the game from another standard Amiga setup from floppies in df0 and df1 it lets me format a save disk and the saves work.
mahen
Posts: 185
Joined: Sun May 24, 2020 8:25 pm
Has thanked: 19 times
Been thanked: 6 times

Re: 5× Vertical *Per-Game* Integer Scaling for Amiga Is Here

Unread post by mahen »

Hi everyone !

If I'm not mistaken, the current default integer scaling factor for the Amiga on the MiSTer in 1080p is actually 3X (286 lines with overscan according to the OSD) and not 4X.

I was really shocked when starting DOS games in 320*200 because they were scaled 5X and it looked ultra chunky. (so I added some fixed borders but it only plays well with a given resolution due to my use of scanlines)

I think 4X is a good compromise... 3X looks precise, almost as if I was in front of my 13.x inch TV in my teenager bedroom (I love it for the Amiga core), 5X looks horrible IMHO but it's a matter of taste :) As I see, a lot of people here seem to appreciate a 5X scaling :)

I would loooove if there could be some options global or per core to set a MAX scaling factor.
User avatar
Chris23235
Top Contributor
Posts: 983
Joined: Sun May 24, 2020 8:45 pm
Has thanked: 127 times
Been thanked: 197 times

Re: 5× Vertical *Per-Game* Integer Scaling for Amiga Is Here

Unread post by Chris23235 »

mahen wrote: Fri Jun 18, 2021 7:24 am I would loooove if there could be some options global or per core to set a MAX scaling factor.
Why don't use vscale_border in the Mister.ini?
vscale_border=0 ; set vertical border for TVs cutting the upper/bottom parts of screen (1-399)
As smaller maximum scaling results in a bigger border it should work to use vscale_border to set the size of the display area and then use vscale_mode=0. Didn't try it myself but this is how I think it would work.

I tried the Mega AGS 5x scaling and found it fantastic. I use the 25% composite blending filter to blur the image a little bit. It doesn't look exactly as my MiST connected to the Amiga 1084 monitor but it comes surprisingly close to the CRT experience.
retro
Posts: 148
Joined: Fri Jun 04, 2021 5:19 am
Location: Kuala Lumpur, Malaysia
Has thanked: 47 times
Been thanked: 14 times

Re: 5× Vertical *Per-Game* Integer Scaling for Amiga Is Here

Unread post by retro »

Is there anyway to do this without using the Mega AGS image? :)
I only have a small handful of Amiga HDFs in my MiSTer, and I have been having a lot of problems with the displays for Banshee and Fire & Ice.
User avatar
limi
Top Contributor
Posts: 776
Joined: Sun May 24, 2020 6:53 pm
Has thanked: 180 times
Been thanked: 570 times

Re: 5× Vertical *Per-Game* Integer Scaling for Amiga Is Here

Unread post by limi »

Updated the original post to mention that you can now turn off the 5× per-game zoom in the MegaAGS options menu.
User avatar
Chris23235
Top Contributor
Posts: 983
Joined: Sun May 24, 2020 8:45 pm
Has thanked: 127 times
Been thanked: 197 times

Re: 5× Vertical *Per-Game* Integer Scaling for Amiga Is Here

Unread post by Chris23235 »

limi wrote: Wed Dec 22, 2021 8:23 pm Updated the original post to mention that you can now temporarily turn off the 5× per-game zoom in the MegaAGS options menu, should you want that. Like with the Force NTSC/PAL settings etc, this persists until reboot.
You have a link to an issue tracker in your opening post that is giving a 404, maybe you can update that as well.
User avatar
limi
Top Contributor
Posts: 776
Joined: Sun May 24, 2020 6:53 pm
Has thanked: 180 times
Been thanked: 570 times

Re: 5× Vertical *Per-Game* Integer Scaling for Amiga Is Here

Unread post by limi »

Removed.
high-5
Posts: 8
Joined: Mon May 25, 2020 6:31 pm
Has thanked: 2 times

Re: 5× Vertical *Per-Game* Integer Scaling for Amiga Is Here

Unread post by high-5 »

limi wrote: Wed Dec 22, 2021 8:23 pm Updated the original post to mention that you can now temporarily turn off the 5× per-game zoom in the MegaAGS options menu, should you want that. This persists until you turn it back on, across reboots.
What is the latest MAGS version btw? Think I am on 2021-03, is this the latest with per game 5x configuration?
mahen
Posts: 185
Joined: Sun May 24, 2020 8:25 pm
Has thanked: 19 times
Been thanked: 6 times

Re: 5× Vertical *Per-Game* Integer Scaling for Amiga Is Here

Unread post by mahen »

> Why don't use vscale_border in the Mister.ini?

I thought it was broken ? At least it is not working anymore along with the global integer scaling option which apparently should not be used anymore (?) since the more complete scaling options were introduced in the osd... Hmmm...
User avatar
LamerDeluxe
Top Contributor
Posts: 1239
Joined: Sun May 24, 2020 10:25 pm
Has thanked: 887 times
Been thanked: 284 times

Re: 5× Vertical *Per-Game* Integer Scaling for Amiga Is Here

Unread post by LamerDeluxe »

mahen wrote: Tue Jan 04, 2022 7:42 pm > Why don't use vscale_border in the Mister.ini?

I thought it was broken ? At least it is not working anymore along with the global integer scaling option which apparently should not be used anymore (?) since the more complete scaling options were introduced in the osd... Hmmm...
vscale_border is still working fine here. I use it to get horizontal integer scaling in the vertical arcade cores.
mahen
Posts: 185
Joined: Sun May 24, 2020 8:25 pm
Has thanked: 19 times
Been thanked: 6 times

Re: 5× Vertical *Per-Game* Integer Scaling for Amiga Is Here

Unread post by mahen »

> vscale_border is still working fine here. I use it to get horizontal integer scaling in the vertical arcade cores.

Does it work with the vscale_mode=1 from the mister.ini or with the integer scaling from the OSD ? Or do you set a precise vscale_border value without the integer scaling option ? (which is acceptable for some cores but doesn't play well with machines that use several resolutions)

Sorge told me that the former was kinda deprecated.

Actually, I have to use the latter for the Minimig otherwise some games (like SOTB3) are displayed at an extremely low scaling factor (like 2x). But I use the former for the other cores so that it is automatic.
mahen
Posts: 185
Joined: Sun May 24, 2020 8:25 pm
Has thanked: 19 times
Been thanked: 6 times

Re: 5× Vertical *Per-Game* Integer Scaling for Amiga Is Here

Unread post by mahen »

Hi !
I'm looking for a global 4X vadjust file, could anyone share one with me please ?
Cheers :)
User avatar
LamerDeluxe
Top Contributor
Posts: 1239
Joined: Sun May 24, 2020 10:25 pm
Has thanked: 887 times
Been thanked: 284 times

Re: 5× Vertical *Per-Game* Integer Scaling for Amiga Is Here

Unread post by LamerDeluxe »

mahen wrote: Wed Jan 05, 2022 10:09 am > vscale_border is still working fine here. I use it to get horizontal integer scaling in the vertical arcade cores.

Does it work with the vscale_mode=1 from the mister.ini or with the integer scaling from the OSD ? Or do you set a precise vscale_border value without the integer scaling option ? (which is acceptable for some cores but doesn't play well with machines that use several resolutions)
It only works with vscale_mode=0. Which indeed isn't useful when a core switches between multiple resolutions.
mahen
Posts: 185
Joined: Sun May 24, 2020 8:25 pm
Has thanked: 19 times
Been thanked: 6 times

Re: 5× Vertical *Per-Game* Integer Scaling for Amiga Is Here

Unread post by mahen »

Hi ! My S:SetVAdjust (on the MegaAGS version I could get hold of) contains a PAL5 switch but not a PAL4 one. I'm not looking for an image of MegaAGS but would love it if someone could share just the latest SetVAdjust command (and the files required) to generate a PAL4 vadjust file. Thank you :-)
mahen
Posts: 185
Joined: Sun May 24, 2020 8:25 pm
Has thanked: 19 times
Been thanked: 6 times

Re: 5× Vertical *Per-Game* Integer Scaling for Amiga Is Here

Unread post by mahen »

Hm, I found a 4x vadjust.dat, don't know if that's optimal but...
With this, it seems I can combine the HQ2X scandoubler effect (picture gets too small if using a non cropped image) + scanlines + shadow masks.
Interesting...
User avatar
limi
Top Contributor
Posts: 776
Joined: Sun May 24, 2020 6:53 pm
Has thanked: 180 times
Been thanked: 570 times

Re: 5× Vertical *Per-Game* Integer Scaling for Amiga Is Here

Unread post by limi »

mahen wrote: Fri Jan 07, 2022 11:10 am Hi ! My S:SetVAdjust (on the MegaAGS version I could get hold of) contains a PAL5 switch but not a PAL4 one.
There is no “PAL4” switch — that’s the default setting in the minimig_vadjust.dat file included in MegaAGS that you put in MiSTer’s /config directory.

The PAL5 argument to setvadjust overrides it on a per-game basis. Any game that doesn’t specify that will run at 4×, as will every game if you turn off Dynamic Crop in the Options section of the MegaAGS launcher.
mahen
Posts: 185
Joined: Sun May 24, 2020 8:25 pm
Has thanked: 19 times
Been thanked: 6 times

Re: 5× Vertical *Per-Game* Integer Scaling for Amiga Is Here

Unread post by mahen »

Hi ! Thanks for the reply ! Actually, on the AGS2/VAdjust directory, there are tons of files ; do you know which one corresponds to this default 4x minimig_vadjust.dat ? Thanks :))
User avatar
limi
Top Contributor
Posts: 776
Joined: Sun May 24, 2020 6:53 pm
Has thanked: 180 times
Been thanked: 570 times

Re: 5× Vertical *Per-Game* Integer Scaling for Amiga Is Here

Unread post by limi »

limi wrote: Fri Jan 07, 2022 5:58 pm […] the minimig_vadjust.dat file included in MegaAGS that you put in MiSTer’s /config directory.
😊

(In other words, the file lives in the MiSTer file hierarchy, not the Amiga one)
User avatar
dfilskov
Posts: 34
Joined: Sun May 24, 2020 9:35 pm
Has thanked: 26 times
Been thanked: 9 times
Contact:

Re: 5× Vertical *Per-Game* Integer Scaling for Amiga Is Here

Unread post by dfilskov »

I hope cropping (with Integer) gets implemented as an OSD setting too for games run outside MegaAGS - since it's hard or expensive to get your hands on the MegaAGS release, since it doesn't work for users without a 1080p monitor and many users haven' set up a shared storage space (that MegaAGS Workbench can access in the MiSTer filesystem).
Post Reply