RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    crt-pi shader users - reduce scaling artifacts with these configs in lr-mame2003, lr-fbalpha, lr-nestopia (and more to come)

    Scheduled Pinned Locked Moved Ideas and Development
    crt-pi shadercrt-picrt-pi-verticalshaderslr-mame2003
    385 Posts 42 Posters 263.5k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • RiverstormR
      Riverstorm
      last edited by Riverstorm

      @omitrix02 - Here's a download link to the script files. It's been quite a while since I used them but they should still be valid. There's 8 files in the zip.

      1. crt-pi - mame2003
      2. crt-pi - mame2003-plus
      3. zfast - mame2003
      4. zfast - mame2003-plus

      I modified the scripts so they could also be used for mame2003-plus. They are identical cores except for a few hundred games. Mostly mame2003-plus exclusives but there's also around a dozen or so that are 2003 only.

      If a game is not in one of the resolution_db files (as they are getting older now) you can add an entry fairly easy by looking at what information is needed. It's a flat text file, one game entry per line and most of the fields are unused.

      Another option is to find a clone or parent ROM .cfg file that has already been generated for the core and just copy/rename it. For example you can easily use the Donkey Kong .cfg file for Donkey Kong Remix, etc.

      The other 4 files in the archive are just batch files to create both a 720 and 1080 set of cfgs at the same time. You can modify the batch file and add/remove the resolutions you would like to use for your setup. They aren't needed though if you prefer to just run python script from the command line.

      Also I haven't updated FBA in a while (still running lr-fbalpha) so I don't know the exact path changes for new FBNeo core rename or I would modify it.

      O ectoE 2 Replies Last reply Reply Quote 0
      • O
        omitrix02 @Riverstorm
        last edited by

        @Riverstorm Thanks for the scripts, as well as the detailed explanation, but I'm getting the same issue when I was editing the script myself: when using the zfast shader alongside curvature, the resulting configs will have completely empty lines. This only occurs with the zfast shader and curvature, as crt-pi works perfectly in all cases and zfast works when using 1920x1080.

        1 Reply Last reply Reply Quote 0
        • RiverstormR
          Riverstorm
          last edited by Riverstorm

          @omitrix02 - Ok, I am getting the same issue using the curvature parameter.

          From what I can tell something in the last commit (c89aee3) that was meant to correct a curvature issue broke it. Maybe @dankcushions can take a look.

          1 Reply Last reply Reply Quote 0
          • ectoE
            ecto @Riverstorm
            last edited by

            @Riverstorm Hi, Can I use your script to mass-change the shader and resolution settings of my already installed Bezelproject game cfg files?

            I couldn't look into the script because the download link has expired...

            Thanks!

            1 Reply Last reply Reply Quote 0
            • RiverstormR
              Riverstorm
              last edited by Riverstorm

              @ecto - I don't think it's possible or at least not easy. You can generate a new set and it shouldn't be to hard doing a compare of old and new folders to pull a new set of cfgs named the same. If you're using custom resolutions on a per game basis for bezels I don't see any easy way.

              Here's a new download link to the files for you to take a look though. I made a few more modifications.

              One set for the crt-pi shaders and one for the zfast shaders. Also in the zip is the resolution_db files. You only need to install Python and they should work.

              crt_pi_configs.bat
              crt_pi_configs.py
              zfast_configs.bat
              zfast_configs.py

              I modified the scripts so they could also be used for mame2003 or mame2003-plus. They are identical cores except for a few hundred games. Mainly mame2003-plus additions but there's also around a dozen or so that are mame2003 only.

              I also added FBNeo but left FB Alpha for those still using the older core.

              If a game is not in one of the resolution_db files (as they are getting older now) you can add an entry fairly easy by looking at what information is needed. It's a flat text file, one game entry per line and most of the fields are unused.

              Another option is to find a clone or parent ROM .cfg file that has already been generated for the core and just copy/rename it. For example you can easily use the Donkey Kong (dkong.cfg) and modify it for Donkey Kong 3 (dkong3.cfg), etc.

              The other 2 files in the archive are just batch files to create both a 1280x720, 1920x1080 and curvature set of cfgs, for all the cores at the same time and then zip them up. You can modify the batch file and add/remove specific cores and resolutions you're targeting for your setup.

              The batch files aren't needed though. If you prefer to just run the python scripts from the command line similar to below which would not be zipped up but in a folder only.

              python crt_pi_configs.py mame2003 1920 1080

              For the other cores you can replace mame2003 with the specific core you want. For the x (horizontal resolution) replace 1920 for y (vertical resolution) replace 1080.

              For curvature just remove the resolution values and add curvature 0 like so:

              python crt_pi_configs.py mame2003 curvature 0.

              Core Names:
              MAME 2003 = mame2003
              MAME-2003 Plus = 2003plus
              FinalBurn Alpha = fbalpha
              FinalBurn Neo = fbneo
              Consoles = consoles

              ectoE 1 Reply Last reply Reply Quote 2
              • I
                iainjh
                last edited by

                Hi

                Riverstorm would you mind checking that download location, as it timesout :( TIA!

                also could someone please re confirm the correct folder names in retropie/configs/all/retroarch/config for mame2003plus and for fbneo.

                thank you so much, I'm running 1280 x 1024 and these scanline improvements have been so appreciated

                iain

                1 Reply Last reply Reply Quote 0
                • ectoE
                  ecto @Riverstorm
                  last edited by

                  @Riverstorm Thanks for uploading the scripts and explaining them once again!

                  Regarding my provious question, I think I may have come to a solution:
                  The Bezelproject just downloads cfg files for each game containing a path to the bezel (like here dondonpachi):

                  input_overlay = "/opt/retropie/configs/all/retroarch/overlay/ArcadeBezels/ddonpach.cfg"
                  

                  I will now just take your generated zfast_curvature cfg files and merge them into one file with something like

                  #!/bin/bash
                  
                  cd 'bezelproject_cfgs'
                  for bezel_file in *.cfg; do
                    zfast_file="zfast_curvature_cfgs/$bezel_file"
                    cat "$bezel_file" "$zfast_file" > "merged_cfgs/$bezel_file"
                  done
                  

                  (Mind, I haven't tested the script, just googled away and found a solution to merge two textfiles!) Use at your own risk and only with backed up data!

                  Last thing worth noting is, that probably my Rpi3b+ isn't fast enough for handling bezels and a shader... That's at least what I learned reading through this thread. But that doesn't matter: It's alway fun to have new project going! Also, this paves the way for a future Rpi4! ;)

                  1 Reply Last reply Reply Quote 0
                  • dankcushionsD
                    dankcushions Global Moderator
                    last edited by

                    the scripts are all broken (again, but this time in a new way) with the latest version of retroarch :|

                    ectoE 1 Reply Last reply Reply Quote 0
                    • ectoE
                      ecto @dankcushions
                      last edited by

                      @dankcushions What happend?

                      1 Reply Last reply Reply Quote 0
                      • RiverstormR
                        Riverstorm
                        last edited by

                        @iainjh - Doing a quick download test it seems to be working fine.

                        The cfg files need to be located in:

                        /opt/retropie/configs/all/retroarch/config/MAME 2003-Plus
                        /opt/retropie/configs/all/retroarch/config/FinalBurn Neo

                        @ecto - Thanks for a solution to merge. The cfg file generated is fairly small with 4 comment lines and only 7 "functional" lines but still it could be a lot of work without a script. :)

                        I would also be curious as to what's broke with the latest RetroArch. I mainly use RetroPie and when downloading the latest RetroPie script 4.5.1 (896b34e1) and updating RetroArch it's still on 1.7.6. Everything in 1.7.6 works still so I am guessing it's something in 1.7.7 but I can't find a thread on what's broke.

                        dankcushionsD I 2 Replies Last reply Reply Quote 0
                        • dankcushionsD
                          dankcushions Global Moderator @Riverstorm
                          last edited by

                          @Riverstorm https://www.libretro.com/index.php/retroarch-1-7-8-released/

                          i've not tried it, but looks like the shader changes will break them.

                          mituM 1 Reply Last reply Reply Quote 0
                          • mituM
                            mitu Global Moderator @dankcushions
                            last edited by

                            @dankcushions said in crt-pi shader users - reduce scaling artifacts with these configs in lr-mame2003, lr-fbalpha, lr-nestopia (and more to come):

                            i've not tried it, but looks like the shader changes will break them.

                            Yes, the video_shader parameter has disappeared, hence any usage of it in a .cfg file will be ignored.

                            1 Reply Last reply Reply Quote 0
                            • RiverstormR
                              Riverstorm
                              last edited by

                              Some neat features in that version like the OCR, text to speech and CD support.

                              I use whatever RetroPie defaults to which I think is RA 1.7.6 which works well but it does look like when RetroPie goes to RA 1.7.8 some things will need tweaked in the script.

                              Example of new shader command line for RA 1.7.8:

                              retroarch --set-shader "D:\RetroArch\shaders\shaders_glsl\blurs\kawase_blur_5pass.glslp" -L <core> <content>

                              Example with relative path:

                              retroarch --set-shader "shaders_glsl\blurs\kawase_blur_5pass.glslp" -L <core> <content>

                              1 Reply Last reply Reply Quote 0
                              • I
                                iainjh @Riverstorm
                                last edited by

                                thanks, I tried again and after a few goes it downloaded. thanks also re the paths!

                                I'll avoid updating retroarch.

                                :):):)

                                @Riverstorm said in crt-pi shader users - reduce scaling artifacts with these configs in lr-mame2003, lr-fbalpha, lr-nestopia (and more to come):

                                @iainjh - Doing a quick download test it seems to be working fine.

                                The cfg files need to be located in:

                                /opt/retropie/configs/all/retroarch/config/MAME 2003-Plus
                                /opt/retropie/configs/all/retroarch/config/FinalBurn Neo

                                @ecto - Thanks for a solution to merge. The cfg file generated is fairly small with 4 comment lines and only 7 "functional" lines but still it could be a lot of work without a script. :)

                                I would also be curious as to what's broke with the latest RetroArch. I mainly use RetroPie and when downloading the latest RetroPie script 4.5.1 (896b34e1) and updating RetroArch it's still on 1.7.6. Everything in 1.7.6 works still so I am guessing it's something in 1.7.7 but I can't find a thread on what's broke.

                                1 Reply Last reply Reply Quote 0
                                • I
                                  iainjh
                                  last edited by

                                  Hi all

                                  Stupidly, I've managed to lose the file "crt-pi-configs-master-prod.zip" and the download link requires a subscription. Could someone please share the file?

                                  I have acquired a new monitor panel and need to output new .cfg's for its 1600x1200 resolution

                                  Also, back over my normal pi (pi4, most recent retropie, 1280x1024 monitor and the .cfg's created above) it appears the optimum vertical mask and sizing works perfectly even though the last posts indicated some problems with recent retroarch builds. Are those issues now fixed?

                                  But I have a new issue. The display on some games is now upside down! Donpachi for example. Has anyone else seen this or could suggest how to fix? ive added:

                                  video_allow_rotate = "true"
                                  video_rotation = "2"

                                  with no change.

                                  thank you very much for any pointers! scanlines FTW!:)

                                  1 Reply Last reply Reply Quote 0
                                  • RiverstormR
                                    Riverstorm
                                    last edited by

                                    @iainjh - Here's a link to the files. I haven't tested them yet on the Pi 4 with the latest RP image on Buster. I've mainly use the old version on the Pi 3 for gaming and have been just messing on the Pi 4 but will eventually migrate to the new board.

                                    1 Reply Last reply Reply Quote 0
                                    • I
                                      iainjh
                                      last edited by iainjh

                                      thank you!!! superstar :)

                                      @Riverstorm said in crt-pi shader users - reduce scaling artifacts with these configs in lr-mame2003, lr-fbalpha, lr-nestopia (and more to come):

                                      link

                                      edit: however now I've applied the whole set anew, I believe the issue remains that latest retroarch on Pi4/buster implements the scaling correctly but ignores the selection of shader and the vertical mask in the cfg. As was said above...

                                      Some games are also rendered upside down.

                                      I was wrong in my earlier post as i must have saved some overrides.

                                      thanks again for the link, i'll save these properly this time:)

                                      1 Reply Last reply Reply Quote 0
                                      • RiverstormR
                                        Riverstorm
                                        last edited by

                                        @iainjh - It looks like you figured it out from the edit but I did some testing over the weekend and the scripts should still work fine running RetroPie 4.6.1 on a Pi 4 using Retroarch 1.8.8.

                                        1 Reply Last reply Reply Quote 0
                                        • RiverstormR
                                          Riverstorm
                                          last edited by

                                          I don't know how many folks still use it but I uploaded the shader script to Github here temporarily. The "free" file hosting sites seem to charge you after 30 days to download the file.

                                          I consolidated the script down to one file for all cores and shaders.

                                          A few things were broken but have been fixed.

                                          If you used curvature it would generate zero byte files. It's been corrected.

                                          There's no need to pad the command line when using curvature anymore (it was added but that commit was broke also). Just use curvature with no width or height.

                                          The Scale Factor is included in the cfg files. Same reason as above, it was added after it was broke with a commit. If under 3 it's disabled in the cfg files. To see how it looks enabled check out Popeye or Rampage as good examples of games under a scale factor of 3. They don't look so good.

                                          I also added a shader argument so you can use either the crt-pi or the zfast shader.

                                          Usage:
                                          python pi_shader_configs.py <core> <shader> <screen width> <screen height>

                                          Parameters:
                                          core (mame2003, 2003plus, fbalpha, fbneo or consoles)
                                          shader (crtpi or zfast)
                                          screen width (i.e. 1920 or curvature)
                                          screen height (i.e. 1080)

                                          NOTE: If using the curvature parameter don't add width or height to the command line.

                                          Examples:

                                          python pi_shader_configs.py mame2003 crtpi 1920 1080
                                          python pi_shader_configs.py fbalpha crtpi curvature
                                          python pi_shader_configs.py 2003plus zfast 1280 720
                                          python pi_shader_configs.py fbneo zfast curvature

                                          You can also use the bat file to auto-generate different target resolutions and have them zipped in one step. The .bat file has 1920x1080, 1280x720 and curvature for all cores using both shaders. It's pretty self-explanatory to modify it to your needs. It's easier to copy one zip file than thousands of cfg files! :)

                                          There's a readme that explains most of the information.

                                          I did download the .44 resolution database posted up further in the thread generated by UDb23. I know it's outdated but more current than the older fbalpha database. It needs a lot of corrections but once completed I'll modify the script to use it for fbneo and leave the fbalpha database for the older core.

                                          1 Reply Last reply Reply Quote 2
                                          • dankcushionsD
                                            dankcushions Global Moderator
                                            last edited by

                                            @Riverstorm appreciate the help but please offer PRs to the original code rather than copy it, modify and rehost it under your own name, without the commit history from the other contributors, even if temporarily. if you’re going to that effort of putting it on git, why not just do a PR?

                                            1 Reply Last reply Reply Quote 1
                                            • First post
                                              Last post

                                            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.