Scanlines in Libretro AdvMAME and FBA
-
@dankcushions said in Scanlines in Libretro AdvMAME and FBA:
there are a bunch of vector settings (flicker, intensity, etc) that are available on mame2003, but they need to be exposed to the front-end as a libretro core option. i might try that soon!
That would be the cat's meow! I can't help to think of Omega Race with a nice bloom effect. It was a great game! ;)
-
@Riverstorm said in Scanlines in Libretro AdvMAME and FBA:
@dankcushions said in Scanlines in Libretro AdvMAME and FBA:
it can't. libretro only i'm afraid.
Well shoot. I am really impressed. The scanlines in FBA are really sharp. I will probably convert to the MAME Libretro core vs. MAME4ALL but it will take some time.
they will work on lr-imame4all also, which uses the same romset as mame4all-pi.
I have a "portable" setup that I use to hookup to TV's at friends and family. When it's a case like do you guys leave the default resolution or change on the fly? I noticed on certain resolutions in FBA it would stretch to fill the screen but if I left it blank it seems the correct proportions but of course had black around the borders usually left and right sides.
not sure i understand :) i use the default 'video-output' retroarch resolution (which is whatever your connected TV is - in my case, 1080p). the borders on the left/right depend on what aspect ratio you have set. the default should mean that it fills the vertical space, but (for me) has borders on the left + right, as very few arcade games are natively widescreen. i never mess with the resolution or aspect ratio as i want it to look true to life.
-
@dankcushions said in Scanlines in Libretro AdvMAME and FBA:
:) all i could find is this, which looks like a no: http://libretro.com/forums/showthread.php?t=3815
there are a bunch of vector settings (flicker, intensity, etc) that are available on mame2003, but they need to be exposed to the front-end as a libretro core option. i might try that soon! it also needs to use the full screen resolution, as right now it's stuck at 640x480 default, i believe.
Yeah, I found that thread a while back too. I am tempted to load/compile experimental MAME (current? I guess) and try using it JUST for vector titles to see if I can pull off some fancy bloom which it supposedly can do now. Might be a complete waste of time if performance is an issue, but if it works for old vector titles it would be beautiful.
As for vector in 2003, I haven't really tried it, but won't bother if it is locked to a max res of 640x480. Buzz updated AdvanceMAME code to allow specifying a vector resolution in the config so that's what I use for all vector games right now, and I get crisp lines at 1280x1024. I have a slight flicker enabled as well as anti-aliasing. The only thing I am missing is the bloom effects, but it's a "best so far" situation with vector.
There are really just 3 reasons I still need AdvanceMAME: 1. Vector resolution, 2. Analog controls (spinners, trackballs), 3. Boolean "not" controls mapping (used to exclude direction combinations to make a single joystick act as a tankstick).
-
@Riverstorm said in Scanlines in Libretro AdvMAME and FBA:
@caver01
Could you explain or link to the aspect_ratio_index = "22"? Also I was curious how you do this on a per ROM basis with .cfg, if I am saying that correctly?Here's the thread where I picked up on this idea.
The basic idea is that with a given display resolution, what is the best way to have consistent scanlines? The answer is integer scaling. The way to achieve this is to know your game's native resolution and calculate the largest scale that will fit inside your own display using integer multipliers. For example, if a vertical game is to be displayed in rotated fashion (with black pillars on the left and right) what's the largest rectangle you could use that would fit in a 1280x1024 monitor by scaling the game with an exact integer magnification of 240x320 (wxh)?
The answer is a 3x scale, at 720x960. If you go 4x it would be too tall to fit (320 times 4 = 1280 and that won't fit into 1024). Follow me so far? We could just let it do it's thing automatically and fill to 1024, but that would be a fractional scale, not an integer, and some pixels would have to be 3 high, and others (other rows) would be 4 high. This would make scanlines inconsistent. Some might appear lighter or darker, or more accurately, some would appear thicker or thinner. This problem goes away with high-res displays, but with older hardware like I have, it makes scanlines look messy.But if we go with 3x magnification, every scanline will be equal. So, how do we tell RetroArch to render the game at EXACTLY 3x resolution? We need to build a .cfg file that contains the right parameters to force it. Maybe there are easier ways to do it, but you can go totally manual and specify every detail for a ROM inside a config saved right next to it (name it "rom.zip.cfg). In this example, you might specify the following:
aspect_ratio_index = "22"
custom_viewport_width = "720"
custom_viewport_height = "960"
custom_viewport_x = "280"
custom_viewport_y = "32"Don't get too wrapped up in the aspect ratio index 22 thing. It is apparently number setting that tells RetroArch that you are specifying a custom viewport in the following lines.
The width and height are easy enough to understand, as these are the 3x magnification for our example game, But the x and y are interesting. They come from a calculation of the available screen area. If we are only rendering 720 pixels horizontally, and we have 1280, we have 560 unused pixels that will be our black borders. To get the image centered, we start the viewport at half of that--at 280. Then, for the 960 vertical, we have a slight black border at the top and bottom because we are not all the way to 1024. We have 64 pixels leftover, so to center the image, we start a half of that--32.That's my understanding of it. Custom viewports like this give you complete control over your rendered image, and as a result, allow you to calculate integer scaling if you want consistently shaped pixels. Note that some games don't have 1:1 Pixel Aspect Ratios (PAR). They expect stretching of the image. I am thinking of a game like Blasteroids. If that were the case, it would be obvious and you would be multiplying by a different value, maybe doubling the vertical or something. Anyway, it can get complicated.
I don't actually do this per ROM. I do some rotation per ROM, and a few ROMs I drop the curvature because of moire patterns (and I will be exploring @dankcushions link to further improve these titles), but I have enough resolution going for me that the curvature looks good and most vertical games play sideways on my cabinet at fullscreen.
-
@caver01
i think you're incredibly overcomplicating integer scaling :) if you simple do
video_scale_integer = true
(which you can do via the retropie config editor, rather than editing files), then it will automatically use the largest integer scale that fits into your resolution. you don't need to calculate or tweak anything. -
@dankcushions Ha ha ha! Yeah, you are right! This would be WAY easier.
Thanks for pointing that out. If that works, and it centers and so on. . . no need to do a custom viewport at all. I guess the tool is there if you need it. Maybe for games that have odd PAR that are typically stretched with CRT hardware adjustments? It has been fun to discover that RetroArch can accommodate just about any need.
-
@dankcushions said in Scanlines in Libretro AdvMAME and FBA:
they will work on lr-imame4all also, which uses the same romset as mame4all-pi.
Thanks Dank! :) I have about 250 ROMS all non-merged for use with MAME4ALL. I'll be flipping over until I can rebuild a set for lr-2003. Would it be forward thinking to make lr-2010 set or is that jumping the gun? When lr-2010 goes official will have the same features as 03? I think lr-2003 is .78 and lr-2010 is .139 about 7 years difference.
Also thanks on the resolution. I always left things at the default or I end up removing them from the game launch menu as every time I set something it just didn't look right. That will be a nice simplification, leaving the settings at default that is.
@caver01
Thanks for the explanation the really nice thing is I will have some idea of why I am turning on video_scale_integer = true instead of just doing it so I don't think the explanation was in vain by no means. :)Does video_scale_integer center up the image too then? A nice feature for sure.
-
@Riverstorm said in Scanlines in Libretro AdvMAME and FBA:
@dankcushions said in Scanlines in Libretro AdvMAME and FBA:
they will work on lr-imame4all also, which uses the same romset as mame4all-pi.
Thanks Dank! :) I have about 250 ROMS all non-merged for use with MAME4ALL. I'll be flipping over until I can rebuild a set for lr-2003. Would it be forward thinking to make lr-2010 set or is that jumping the gun? When lr-2010 goes official will have the same features as 03? I think lr-2003 is .78 and lr-2010 is .139 about 7 years difference.
this thread pretty much sumarises my thoughts on mame2010: https://retropie.org.uk/forum/topic/490/mame-2010-cfg-save-files
-
@dankcushions said in Scanlines in Libretro AdvMAME and FBA:
this thread pretty much sumarises my thoughts on mame2010: https://retropie.org.uk/forum/topic/490/mame-2010-cfg-save-files
Thanks Dank, 2003 it is! :)
-
I see a crt-pi1.zip is at both of these locations and they have differences. The Petroblock has additional shaders and the Libretro has only one, the crt-pi shader, but it is a large increase of about 3k to the file in the shaders folder. Is there a link for an up-to-date file or would combining the Libretro file with the Petroblock be the way to go?
http://blog.petrockblock.com/forums/topic/crt-pi-a-pi2-friendly-crt-shader/
http://libretro.com/forums/showthread.php?t=4937
Also Dank so you did create a vertical version of the shader? I was reading through the thread. Can you apply the shaders on a per ROM basis to take advantage of that?
-
@dankcushions said in [Scanlines in Libretro AdvMAME and FBA](/topic/834/scanlines-in->
they will work on lr-imame4all also, which uses the same romset as mame4all-pi.
Nevermind Dank, having a moment and forgot to change the emulator.
-
@Riverstorm You can tell what it runs by checking the runcommand menu on boot
https://github.com/RetroPie/RetroPie-Setup/wiki/Runcommand -
@Riverstorm The shader I am using is the crt-pi. I loaded and ran Floob's utility before I started, so I don't know if there was already a shader by that name in the directory before I ran the update config using Floob's script. As I scroll through them, I think I am using what ended up being #10 (my system was built from retropie 3.6 image).
I haven't had time to do it yet, but in lieu of something official from DaveJ in that linked thread, I will probably make a copy of crt-pi and edit the parameters as described in the linked thread such that vertical games on a landscape display will have improved scanlines. Then, yes, I will update the config file per ROM for just those few ROMs that require this on my cabinet (1941, maybe Mercs, and any other side-by-side simultaneous play vertical games) by adding the shader to ROM.zip.cfg.
-
@Riverstorm said in Scanlines in Libretro AdvMAME and FBA:
I see a crt-pi1.zip is at both of these locations and they have differences. The Petroblock has additional shaders and the Libretro has only one, the crt-pi shader, but it is a large increase of about 3k to the file in the shaders folder. Is there a link for an up-to-date file or would combining the Libretro file with the Petroblock be the way to go?
I just use the one packaged with retropie 3.7. it's the most up to date one as far as I'm aware.
http://blog.petrockblock.com/forums/topic/crt-pi-a-pi2-friendly-crt-shader/
http://libretro.com/forums/showthread.php?t=4937
Also Dank so you did create a vertical version of the shader? I was reading through the thread. Can you apply the shaders on a per ROM basis to take advantage of that?
I did. yes - I just use per rom configs. ie, romname.zip.cfg - put these in the relevant rom folder. mine just have a line pointing to the right shader.
-
@Floob said in Scanlines in Libretro AdvMAME and FBA:
@Riverstorm You can tell what it runs by checking the runcommand menu on boot
https://github.com/RetroPie/RetroPie-Setup/wiki/RuncommandThanks Floob, by the way love your video's I have learned so much from them. I wasn't sure about the length at first but when I am done I have a through understanding of how to do something.
I had to watch the video about Retroarch remaps a few times but I finally caught on how A is more of a position or constant on the joystick and you're remapping that position to another variable that was defined on the controller setup screen.
-
@caver01 said in Scanlines in Libretro AdvMAME and FBA:
@Riverstorm The shader I am using is the crt-pi. I loaded and ran Floob's utility before I started, so I don't know if there was already a shader by that name in the directory before I ran the update config using Floob's script. As I scroll through them, I think I am using what ended up being #10 (my system was built from retropie 3.6 image).
I haven't had time to do it yet, but in lieu of something official from DaveJ in that linked thread, I will probably make a copy of crt-pi and edit the parameters as described in the linked thread such that vertical games on a landscape display will have improved scanlines. Then, yes, I will update the config file per ROM for just those few ROMs that require this on my cabinet (1941, maybe Mercs, and any other side-by-side simultaneous play vertical games) by adding the shader to ROM.zip.cfg.
Ok, Caver you got me all strung out on scanlines now. I really like the effect. I keep an eye out here if you do a public release of your shader! :)
Do you use the same shader for NES, SNES, etc?
-
@dankcushions said in Scanlines in Libretro AdvMAME and FBA:
I did. yes - I just use per rom configs. ie, romname.zip.cfg - put these in the relevant rom folder. mine just have a line pointing to the right shader.
Ok this is the correct file: "crt-pi-vertical.glsl.zip" from the Libretro thread.
Then you add these two lines to say for example kong.zip.cfg:
video_shader = /opt/retropie/emulators/retroarch/shader/crt-pi-vertical.glsl
video_shader_enable = true -
@Riverstorm said in Scanlines in Libretro AdvMAME and FBA:
@dankcushions said in Scanlines in Libretro AdvMAME and FBA:
I did. yes - I just use per rom configs. ie, romname.zip.cfg - put these in the relevant rom folder. mine just have a line pointing to the right shader.
Ok this is the correct file: "crt-pi-vertical.glsl.zip" from the Libretro thread.
Then you add these two lines to say for example kong.zip.cfg:
video_shader = /opt/retropie/emulators/retroarch/shader/crt-pi-vertical.glsl
video_shader_enable = trueyou got it :)
-
@dankcushions said in Scanlines in Libretro AdvMAME and FBA:
I just use the one packaged with retropie 3.7. it's the most up to date one as far as I'm aware.
Ok, so it's pre-packaged that solves it. :) I'm overloaded with changes. I am going to put these tweaks in place over the weekend. I create a "notes" document just to track all these tweaks and changes when a new RetroPie version is released so it's easier to start all over again.
-
@Riverstorm said in Scanlines in Libretro AdvMAME and FBA:
Do you use the same shader for NES, SNES, etc?
Yeah. We played all of the home consoles on a TV anyway, and they were in landscape mode--slam dunk.
I'd probably use the gameboy shader for those games if I load them, but I probably won't bother. My next exploit is going to be apple II games, and for those, I'll probably turn on the CRT-PI shader too.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.