• Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
RetroPie forum home
  • Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

LR-MAME2003 - flipping the screen in SOME games

Scheduled Pinned Locked Moved Help and Support
flipping screenlr-mame2003
20 Posts 8 Posters 4.8k 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.
  • A
    Alturis
    last edited by Alturis 19 Mar 2018, 12:44

    You need to create a custom game cfg for the games in question and set the rotation which is a setting in increments of 90 degrees.

    You create a .cfg file with the same name as the game .zip file including the .zip in it like [game].zip.cfg which is just a text file and goes right next to that game.zip file in its roms folder. This will override any default settings from retroarch.cfg for that particular game.

    Here is my example of Rip Off which had the same issue for me.
    video_rotation = 1 is the key element that is rotating the screen. I also have it setup to use an overlay and adjust the positioning of the display to fit within that overlay.

    ripoff.zip.cfg

    aspect_ratio_index = "22"
    custom_viewport_width = "1130"
    custom_viewport_height = "820"
    custom_viewport_x = "395"
    custom_viewport_y = "130"
    video_rotation = 1
    
    input_overlay = /opt/retropie/emulators/retroarch/overlays/arcade-bezels/ripoff.cfg
    input_overlay_enable = true
    input_overlay_opacity = 0.850000
    input_overlay_scale = 1.000000
    

    RP 4.7.1 • Pi4 4Gig • CanaKit Aluminum • 64GB microSD • 1920x1080 BarTop [2 Sanwa sticks]

    P 1 Reply Last reply 19 Mar 2018, 13:29 Reply Quote 0
    • P
      paf @Alturis
      last edited by 19 Mar 2018, 13:29

      @alturis said in LR-MAME2003 - flipping the screen in SOME games:

      You need to create a custom game cfg for the games in question and set the rotation which is a setting in increments of 90 degrees.

      Thanks, but the problem is that I need to flip the screen horizontally (like in a mirror), not to rotate it! And I didn't find a parameter for that.

      Is there one? Or maybe with a shader?

      1 Reply Last reply Reply Quote 0
      • A
        Alturis
        last edited by Alturis 19 Mar 2018, 15:04

        Hmm... well there is a whole series of video options. I would have thought there woudl be a video_flip, but there is a video_scale which I would think might accept a -1 value?

        #### Video
        
        # Video driver to use. "gl", "xvideo", "sdl"
        # video_driver = "gl"
        
        # Which OpenGL context implementation to use.
        # Possible ones for desktop are: glx, x-egl, kms-egl, sdl-gl, wgl.
        # By default, tries to use first suitable driver.
        # video_context_driver =
        
        # Windowed x resolution scale and y resolution scale
        # (Real x res: base_size * xscale * aspect_ratio, real y res: base_size * yscale)
        # video_scale = 3.0
        
        # Fullscreen resolution. Resolution of 0 uses the resolution of the desktop.
        # video_fullscreen_x = 0
        # video_fullscreen_y = 0
        
        # Start in fullscreen. Can be changed at runtime.
        # video_fullscreen = false
        
        # If fullscreen, prefer using a windowed fullscreen mode.
        # video_windowed_fullscreen = true
        
        # Which monitor to prefer. 0 (default) means no particular monitor is preferred, 1 and up (1 being first monitor),
        # suggests RetroArch to use that particular monitor.
        # video_monitor_index = 0
        
        # Forcibly disable composition. Only works in Windows Vista/7 for now.
        # video_disable_composition = false
        
        # Video vsync.
        # video_vsync = true
        
        # Forcibly disable sRGB FBO support. Some Intel OpenGL drivers on Windows
        # have video problems with sRGB FBO support enabled.
        # video_force_srgb_disable = false
        
        # Attempts to hard-synchronize CPU and GPU. Can reduce latency at cost of performance.
        # video_hard_sync = false
        
        # Sets how many frames CPU can run ahead of GPU when using video_hard_sync.
        # Maximum is 3.
        # video_hard_sync_frames = 0
        
        # Sets how many milliseconds to delay after VSync before running the core.
        # Can reduce latency at cost of higher risk of stuttering.
        # Maximum is 15.
        # video_frame_delay = 0
        
        # Inserts a black frame inbetween frames.
        # Useful for 120 Hz monitors who want to play 60 Hz material with eliminated ghosting.
        # video_refresh_rate should still be configured as if it is a 60 Hz monitor (divide refresh rate by 2).
        # video_black_frame_insertion = false
        
        # Use threaded video driver. Using this might improve performance at possible cost of latency and more video stuttering.
        video_threaded = true
        
        # Use a shared context for HW rendered libretro cores.
        # Avoids having to assume HW state changes inbetween frames.
        # video_shared_context = false
        
        # Smoothens picture with bilinear filtering. Should be disabled if using pixel shaders.
        video_smooth = true
        
        # Forces rendering area to stay equal to content aspect ratio or as defined in video_aspect_ratio.
        # video_force_aspect = true
        
        # Only scales video in integer steps.
        # The base size depends on system-reported geometry and aspect ratio.
        # If video_force_aspect is not set, X/Y will be integer scaled independently.
        # video_scale_integer = false
        
        # A floating point value for video aspect ratio (width / height).
        # If this is not set, aspect ratio is assumed to be automatic.
        # Behavior then is defined by video_aspect_ratio_auto.
        # video_aspect_ratio =
        
        # If this is true and video_aspect_ratio is not set,
        # aspect ratio is decided by libretro implementation.
        # If this is false, 1:1 PAR will always be assumed if video_aspect_ratio is not set.
        video_aspect_ratio_auto = true
        
        # Forces cropping of overscanned frames.
        # Exact behavior of this option is implementation specific.
        # video_crop_overscan = true 
        
        # Path to shader. Shader can be either Cg, CGP (Cg preset) or GLSL, GLSLP (GLSL preset)
        # video_shader = "/path/to/shader.{cg,cgp,glsl,glslp}"
        
        # Load video_shader on startup.
        # Other shaders can still be loaded later in runtime.
        # video_shader_enable = false
        
        # Defines a directory where shaders (Cg, CGP, GLSL) are kept for easy access.
        video_shader_dir = /opt/retropie/emulators/retroarch/shader/
        
        # CPU-based video filter. Path to a dynamic library.
        # video_filter =
        
        # Defines a directory where CPU-based video filters are kept.
        # video_filter_dir =
        
        # Path to a font used for rendering messages. This path must be defined to enable fonts.
        # Do note that the _full_ path of the font is necessary!
        # video_font_path = 
        
        # Size of the font rendered.
        video_font_size = 12
        
        # Enable usage of OSD messages.
        # video_font_enable = true
        
        # Offset for where messages will be placed on screen. Values are in range 0.0 to 1.0 for both x and y values. 
        # [0.0, 0.0] maps to the lower left corner of the screen.
        # video_message_pos_x = 0.05
        # video_message_pos_y = 0.05
        
        # Color for message. The value is treated as a hexadecimal value.
        # It is a regular RGB hex number, i.e. red is "ff0000".
        # video_message_color = ffffff
        
        # Video refresh rate of your monitor.
        # Used to calculate a suitable audio input rate.
        # video_refresh_rate = 59.95
        
        # Allows libretro cores to set rotation modes.
        # Setting this to false will honor, but ignore this request.
        # This is useful for vertically oriented content where one manually rotates the monitor.
        # video_allow_rotate = true
        
        # Forces a certain rotation of the screen.
        # The rotation is added to rotations which the libretro core sets (see video_allow_rotate).
        # The angle is <value> * 90 degrees counter-clockwise.
        # video_rotation = 0
        

        Are you running a cocktail supported rom?

        RP 4.7.1 • Pi4 4Gig • CanaKit Aluminum • 64GB microSD • 1920x1080 BarTop [2 Sanwa sticks]

        P 1 Reply Last reply 19 Mar 2018, 18:45 Reply Quote 0
        • P
          paf @Alturis
          last edited by 19 Mar 2018, 18:45

          @alturis said in LR-MAME2003 - flipping the screen in SOME games:

          Are you running a cocktail supported rom?

          To be very honest, I don't understand exactly what "cocktail mode" means. A screen split in two? If that's it, then no, I don't think. In the game settings in MAME, there is no such DIP switch.

          The screen is simply inverted left-right.

          I have tried video_scale=-1 but if it does nothing. Anyways, how should it mirror in X or Y direction or both?

          1 Reply Last reply Reply Quote 0
          • dankcushionsD
            dankcushions Global Moderator
            last edited by 19 Mar 2018, 18:56

            @paf said in LR-MAME2003 - flipping the screen in SOME games:

            othunder

            this is interesting - this game has a flag i haven't seen before in the code: ORIENTATION_FLIP_X

            see https://github.com/libretro/mame2003-libretro/blob/7b55725e744ac9702db092f996e2fca2276146b2/src/drivers/othunder.c#L659

            you can see the other games that use it here: https://github.com/libretro/mame2003-libretro/search?p=1&q=ORIENTATION_FLIP_X&type=&utf8=✓

            i would guess that standard mame 0.78 plays these games right, but the libretro version (lr-mame2003) is not. @markwkidd are you able to confirm?

            if standard mame 0.78 plays them right, then this is a mame2003 bug that should be logged :)

            markwkiddM 1 Reply Last reply 19 Mar 2018, 19:07 Reply Quote 0
            • markwkiddM
              markwkidd @dankcushions
              last edited by 19 Mar 2018, 19:07

              @dankcushions said in LR-MAME2003 - flipping the screen in SOME games:

              @paf said in LR-MAME2003 - flipping the screen in SOME games:

              othunder

              this is interesting - this game has a flag i haven't seen before in the code: ORIENTATION_FLIP_X

              see https://github.com/libretro/mame2003-libretro/blob/7b55725e744ac9702db092f996e2fca2276146b2/src/drivers/othunder.c#L659

              you can see the other games that use it here: https://github.com/libretro/mame2003-libretro/search?p=1&q=ORIENTATION_FLIP_X&type=&utf8=✓

              i would guess that standard mame 0.78 plays these games right, but the libretro version (lr-mame2003) is not. @markwkidd are you able to confirm?

              if standard mame 0.78 plays them right, then this is a mame2003 bug that should be logged :)

              Confirmed -- it works in original MAME 0.78 but not in mame2003.

              dankcushionsD 1 Reply Last reply 19 Mar 2018, 19:29 Reply Quote 0
              • dankcushionsD
                dankcushions Global Moderator @markwkidd
                last edited by dankcushions 19 Mar 2018, 19:29

                @markwkidd bah! :)

                i think the problem is here: https://github.com/libretro/mame2003-libretro/blob/78720e819c1fe0ad516e0a478f43f52d1fa092cf/src/usrintrf.c#L273

                it looks like this is never called in mame2003. i guess the rotation stuff is replaced here: https://github.com/libretro/mame2003-libretro/blob/master/src/libretro/libretro.c#L633

                ...but not the X/Y flipping... i don't know how you do that via the libretro API.

                markwkiddM 1 Reply Last reply 19 Mar 2018, 20:51 Reply Quote 0
                • SanoS
                  Sano @paf
                  last edited by 19 Mar 2018, 19:57

                  @paf said in LR-MAME2003 - flipping the screen in SOME games:

                  Under LR-MAME2003 (Retroarch / Retropie), a few games are flipped horizontally (usually games with a light gun, no idea why).

                  I believe the explanation is that those light gun games often worked with mirrors, in order to have a certain "distance" feeling from the display.
                  See here :
                  http://forum.arcadecontrols.com/index.php?topic=93369.0

                  jonnykeshJ 1 Reply Last reply 19 Mar 2018, 20:44 Reply Quote 1
                  • jonnykeshJ
                    jonnykesh @Sano
                    last edited by jonnykesh 19 Mar 2018, 20:44

                    @sano You are correct @Sano The screen was reflected in a mirror just as you describe. I tried the very ROM OP mentioned othunder.zipand it was flipped on the horizontal as OP stated.
                    The same ROM works perfectly in AdvanceMame and is showing correctly.

                    1 Reply Last reply Reply Quote 0
                    • markwkiddM
                      markwkidd @dankcushions
                      last edited by 19 Mar 2018, 20:51

                      @dankcushions said in LR-MAME2003 - flipping the screen in SOME games:

                      @markwkidd bah! :)

                      i think the problem is here: https://github.com/libretro/mame2003-libretro/blob/78720e819c1fe0ad516e0a478f43f52d1fa092cf/src/usrintrf.c#L273

                      it looks like this is never called in mame2003. i guess the rotation stuff is replaced here: https://github.com/libretro/mame2003-libretro/blob/master/src/libretro/libretro.c#L633

                      ...but not the X/Y flipping... i don't know how you do that via the libretro API.

                      Someone like radius or hunterk from the libretro team is probably the best on to ask once this is on github.

                      As opposed to fixing the problem it may also be possible to work around it by way of a shader although I don't think there's anything like that in the libretro shaders repository at the moment.

                      1 Reply Last reply Reply Quote 0
                      • P
                        paf
                        last edited by paf 19 Mar 2018, 21:19

                        I just tried with a 0.139 ROM and LR-MAME2010, but it crashes with the following info "/opt/retropie/supplementary/runcommand/runcommand.sh: line 1006: 4692 Segmentation fault"...

                        Any alternative?

                        jonnykeshJ 1 Reply Last reply 19 Mar 2018, 21:22 Reply Quote 0
                        • jonnykeshJ
                          jonnykesh @paf
                          last edited by 19 Mar 2018, 21:22

                          @paf It would do no harm. Also try AdvanceMame, as I suggested. I was playing it earlier with a mouse, got to level 3.

                          1 Reply Last reply Reply Quote 0
                          • DNunoD
                            DNuno
                            last edited by 2 Jun 2021, 08:55

                            I have the same issue.

                            I'm trying to run Disc Of Tron in flipped mode.

                            I tried a couple of things in the dotron.zip.cfg file, such

                            ORIENTATION_FLIP_Y = "ON"
                            

                            or

                            ORIENTATION_FLIP_Y = "true"
                            

                            or

                            ORIENTATION_FLIP_Y = "yes"
                            

                            But it doesn't affect the display :-(
                            I'm note sure what is the correct syntax to use in the .cfg file ? And/or if an other parameter is require too?

                            I'm using mame-libretro 2003 (mame version 0.78 build), on a fresh image downloaded here (retropie-buster-4.7.1-rpi2_3.img.gz)

                            Can someone point me the exact syntax to use for doing this in the .cfg file ?

                            M dankcushionsD 2 Replies Last reply 2 Jun 2021, 20:39 Reply Quote 0
                            • M
                              mahoneyt944 @DNuno
                              last edited by 2 Jun 2021, 20:39

                              @dnuno the screen should be displayed properly without changing any settings. Or are you trying to make the screen mirrored for use with a mirror?

                              DNunoD 1 Reply Last reply 6 Jun 2021, 07:47 Reply Quote 0
                              • DNunoD
                                DNuno @mahoneyt944
                                last edited by 6 Jun 2021, 07:47

                                @mahoneyt944 said in LR-MAME2003 - flipping the screen in SOME games:

                                @dnuno are you trying to make the screen mirrored for use with a mirror?

                                Yes, that's the idea.

                                1 Reply Last reply Reply Quote 0
                                • dankcushionsD
                                  dankcushions Global Moderator @DNuno
                                  last edited by 6 Jun 2021, 10:41

                                  @dnuno said in LR-MAME2003 - flipping the screen in SOME games:

                                  Can someone point me the exact syntax to use for doing this in the .cfg file ?

                                  i think you’re misreading my post. those are internal variables within the code, not configuration settings. there is no way to flip things via the libretro API but you could try a shader. a quick google led me here: https://www.reddit.com/r/miniSNESmods/comments/99eevo/quick_guide_for_flippingmirroring_the_screen_in/?utm_source=share&utm_medium=ios_app&utm_name=iossmf

                                  DNunoD 1 Reply Last reply 9 Jun 2021, 19:26 Reply Quote 0
                                  • DNunoD
                                    DNuno @dankcushions
                                    last edited by 9 Jun 2021, 19:26

                                    @dankcushions said in LR-MAME2003 - flipping the screen in SOME games:

                                    i think you’re misreading my post. those are internal variables within the code, not configuration settings. there is no way to flip things via the libretro API but you could try a shader. a

                                    Well, it shouldn't be an issue for me as I do not plan to 'Y flip' for certain games. I want to dedicated the 'YFlip' for only one game(and I do not plan to run any other game on this setup. So instead using a shader, could this be such a option in the general config of LR Mame 2003. I've found this option in Advance Mame .94, but I would prefer to go with Mame2003 ?

                                    dankcushionsD 1 Reply Last reply 9 Jun 2021, 19:45 Reply Quote 0
                                    • dankcushionsD
                                      dankcushions Global Moderator @DNuno
                                      last edited by 9 Jun 2021, 19:45

                                      @dnuno why not run a shader for one game? it probably could become an option in the core but you’d have to find someone to implement it: https://github.com/libretro/mame2003-libretro/issues

                                      DNunoD 1 Reply Last reply 12 Jun 2021, 09:51 Reply Quote 0
                                      • DNunoD
                                        DNuno @dankcushions
                                        last edited by 12 Jun 2021, 09:51

                                        @dankcushions Thanks, I'll look in that way. I wasn't aware of the use of shaders so far :-)

                                        1 Reply Last reply Reply Quote 0
                                        • 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.

                                          This community forum collects and processes your personal information.
                                          consent.not_received