• 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

Dosbox on pi 4, game window is fullscreen but not centered on screen

Scheduled Pinned Locked Moved Help and Support
dosbox
97 Posts 16 Posters 18.1k 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.
  • Q
    quicksilver
    last edited by 14 May 2020, 17:33

    So I started using raspi-config to set display res to 640x480, rebooting then playing my dosbox games using output=surface. It's the only way I can get it to work fullscreen and give the performance I'm looking for. Then if I want to play other emulators I revert back to 1080p. It's a very clunky way of doing it but for now it's all I can come up with. I wish there was a better way to switch video modes on the fly on the pi 4.

    F 1 Reply Last reply 24 May 2020, 17:12 Reply Quote 1
    • F
      fede999 @quicksilver
      last edited by fede999 24 May 2020, 17:12

      @quicksilver said in Dosbox on pi 4, game window is fullscreen but not centered on screen:

      So I started using raspi-config to set display res to 640x480, rebooting then playing my dosbox games using output=surface. It's the only way I can get it to work fullscreen and give the performance I'm looking for. Then if I want to play other emulators I revert back to 1080p. It's a very clunky way of doing it but for now it's all I can come up with. I wish there was a better way to switch video modes on the fly on the pi 4.

      I've got the same problem on my Pi 4 (my Pi3B+ works perfectly with default config) and it's the only way I've managed to play games with a correct aspect ratio.
      However, I 've found it's not a "one size fits all" solution, as several games get a forced small window in the center or on the top of the screen, despite having the same config settings as other running full screen. What could it be?

      Here's my dosbox config, I'm on a 1920x1080 tv:
      fullscreen = true
      fulldouble = false
      fullresolution = original
      windowresolution = original
      output = overlay
      autolock = true
      sensitivity = 100
      waitonerror = true
      priority = higher,normal
      mapperfile = mapper-SVN.map
      usescancodes = false
      frameskip = 0
      aspect = true
      scaler = none

      It's a real bummer, since playing DOS games with improved graphics was one of the reasons for upgrading to the Pi 4.

      Q 1 Reply Last reply 24 May 2020, 18:46 Reply Quote 0
      • S
        shavecat
        last edited by 24 May 2020, 17:23

        Have the same issue too :\

        1 Reply Last reply Reply Quote 0
        • Q
          quicksilver
          last edited by quicksilver 24 May 2020, 17:41

          This is my latest workaround for this issue. Youll need to create two scripts and place them in:/opt/retropie/configs/all/

          runcommand-onstart.sh:

          #! /usr/bin/env bash
          echo "Hello logfile - runcommand-onstart checking in here" >&2
          #START DOSBOX SECTION - SNIP CONTENTS IF PASTING INTO EXISTING SCRIPT
          if [ $2 = "dosbox" ]
          then
              echo "dosbox detected - changing video mode to 640x480@60hz" >&2
              tvservice -e "DMT 4"
          fi
          #END DOSBOX SECTION
          

          runcommand-onend.sh:

          #! /usr/bin/env bash
          echo "Hello logfile - runcommand-onend checking in here" >&2
          #START DOSBOX SECTION - SNIP HERE IF PASTING INTO EXISITNG SCRIPT
          if [ $2 = "dosbox" ]
          then
              echo "Reverting display back to preferred mode" >&2
              tvservice -p
          fi
          #END DOSBOX SECTION
          

          This script/hack will force 640x480 mode for Dosbox, so your TV will need to support that mode, otherwise modify the script to a mode your TV does support (as close to 640x480 as you can).

          For best performance in full-screen use these dosbox settings in conjunction with the above scripts:

          fullscreen = true
          fulldouble       = false
          fullresolution = original
          windowresolution = original
          output = surface
          autolock         = true
          sensitivity      = 100
          waitonerror      = true
          priority         = higher,normal
          usescancodes = false
          frameskip = 0
          aspect    = true
          scaler = normal2x
          

          These setting are working great for me and I can now run Tie Fighter Collectors CD-ROM edition in fullscreen with SVGA mode (gorgeous 640x480 resolution during gameplay) with absolutely no slow down. All 30 of the dos games I have on my pi are working good with these settings. I did have to lower the display res of windows 3.1 from 800x600 to 640x480 for my windows 3.1 games to display correctly.

          If you run into issues let me know! :)

          F G S 3 Replies Last reply 1 Jun 2020, 19:27 Reply Quote 1
          • Q
            quicksilver @fede999
            last edited by 24 May 2020, 18:46

            @fede999 said in Dosbox on pi 4, game window is fullscreen but not centered on screen:

            @quicksilver said in Dosbox on pi 4, game window is fullscreen but not centered on screen:

            So I started using raspi-config to set display res to 640x480, rebooting then playing my dosbox games using output=surface. It's the only way I can get it to work fullscreen and give the performance I'm looking for. Then if I want to play other emulators I revert back to 1080p. It's a very clunky way of doing it but for now it's all I can come up with. I wish there was a better way to switch video modes on the fly on the pi 4.

            I've got the same problem on my Pi 4 (my Pi3B+ works perfectly with default config) and it's the only way I've managed to play games with a correct aspect ratio.
            However, I 've found it's not a "one size fits all" solution, as several games get a forced small window in the center or on the top of the screen, despite having the same config settings as other running full screen. What could it be?

            Here's my dosbox config, I'm on a 1920x1080 tv:
            fullscreen = true
            fulldouble = false
            fullresolution = original
            windowresolution = original
            output = overlay
            autolock = true
            sensitivity = 100
            waitonerror = true
            priority = higher,normal
            mapperfile = mapper-SVN.map
            usescancodes = false
            frameskip = 0
            aspect = true
            scaler = none

            It's a real bummer, since playing DOS games with improved graphics was one of the reasons for upgrading to the Pi 4.

            I would recommend trying the settings in my above post first as I think it will give you the best performance on the pi 4 (better than the pi 3!)

            However if you don't want to use that method for whatever reason then you'll need to change to these settings:

            fullscreen = false
            fulldouble       = false
            fullresolution = original
            windowresolution = 1920x1080
            output = overlay
            

            Just be aware that performance will still not be as good as your pi 3. So I'd encourage you to use my above method.

            1 Reply Last reply Reply Quote 0
            • S
              Simrose
              last edited by Simrose 25 May 2020, 12:35

              I copied your settings exactly also, put scripts in correct place and changed dosbox settings to match yours and ended up with tiny screen in top left. The other settings using output overlay still work ok though.

              This is how mine looks maybe i missed something?
              I have a 2 files added in opt/retropie/configs/all
              called runcommand-onstart.sh
              with this code

              #! /usr/bin/env bash
              echo "Hello logfile - runcommand-onstart checking in here" >&2
              #START DOSBOX SECTION - SNIP CONTENTS IF PASTING INTO EXISTING SCRIPT
              if [ $2 = "dosbox" ]
              then
              echo "dosbox detected - changing video mode to 640x480@60hz" >&2
              tvservice -e "DMT 4"
              fi
              #END DOSBOX SECTION

              and
              runcommand-onend.sh

              #! /usr/bin/env bash
              echo "Hello logfile - runcommand-onend checking in here" >&2
              #START DOSBOX SECTION - SNIP HERE IF PASTING INTO EXISITNG SCRIPT
              if [ $2 = "dosbox" ]
              then
              echo "Reverting display back to preferred mode" >&2
              tvservice -p
              fi
              #END DOSBOX SECTION

              and edited dosbox-SVN.conf

              fullscreen = true
              fulldouble = false
              fullresolution = original
              windowresolution = original
              output = surface
              autolock = true
              sensitivity = 100
              waitonerror = true
              priority = higher,normal
              mapperfile = mapper-SVN.map
              usescancodes = false
              frameskip = 0
              aspect = true
              scaler = normal2x

              Thanks Sim

              Q 1 Reply Last reply 25 May 2020, 13:22 Reply Quote 0
              • Q
                quicksilver @Simrose
                last edited by 25 May 2020, 13:22

                @Simrose what specific game is causing you issues? Can you confirm that your TV is switching to 640x480 resolution?

                S 1 Reply Last reply 25 May 2020, 13:34 Reply Quote 0
                • S
                  Simrose @quicksilver
                  last edited by 25 May 2020, 13:34

                  @quicksilver

                  Arkanoid is the one i tried.

                  With the other settings it all works fine for me.

                  Ill test if tv switches correctly. thanks

                  Q 1 Reply Last reply 25 May 2020, 14:51 Reply Quote 0
                  • Q
                    quicksilver @Simrose
                    last edited by 25 May 2020, 14:51

                    @Simrose I suspect that your TV isn't switching to 640x480 mode. I just downloaded and tested arkanoid for dos using my settings and I get a fullscreen image. The fact that your seeing the game in a small window in the corner of the screen confirms it for me (at 640x480 display resolution, even if the games render resolution was very low it still shouldn't be a small window like that).

                    Can you confirm what the permissions and ownership of the two scripts you created are? Also what type of display are you using?

                    1 Reply Last reply Reply Quote 0
                    • S
                      Simrose
                      last edited by Simrose 25 May 2020, 14:57

                      @quicksilver

                      I am just waiting to test again as others are using the tv i need.

                      Its a 4k uhd samsung display but i am using in my boot config file
                      hdmi_group=1
                      hdmi_mode=16
                      as recommended on here to use 1080p
                      my info on control shows 1080p
                      within ES

                      permissions for the script i transferred over with winscp as pi user and its on pi and they show owner pi

                      I follow a rule im not sure if right or wrong when i transfer any changes check first what the owner is for files mostly in that folder and stick to the same.

                      e.g. in my configs\all they are all owner pi user

                      dosbox-SVN.conf is pi user which was default

                      the only one from memory i transfer over with root user is es_systems.cfg changes or emulators.

                      thanks
                      sim

                      Q 1 Reply Last reply 2 Jun 2020, 00:14 Reply Quote 0
                      • F
                        fede999 @quicksilver
                        last edited by fede999 6 Jan 2020, 20:27 1 Jun 2020, 19:27

                        @quicksilver seeing that we are running the same game (TIE Fighter Collector's Edition), did you manage to play it wth a joypad?

                        I have a Xbox 360 knockoff and it seems to calibrate just fine, but for some reason it will only move left and up once ingame. Is there any kind of driver I have to install?

                        I have the same problem with other games from the same period (Fifa 96, NBA Live 95, for example)

                        Q 1 Reply Last reply 1 Jun 2020, 19:41 Reply Quote 0
                        • Q
                          quicksilver @fede999
                          last edited by 1 Jun 2020, 19:41

                          @fede999 Yes I am using a wireless xbox360 controller exclusively. Are you launching your game via a custom .conf file? If not, you should be :) If so, then make sure that under the [joystick] section that

                          joysticktype  = 2axis
                          timed         = false
                          

                          I also used the dosbox key mapper (cntrl+f1) to map all the important controls to my xbox360 controller. That way I dont need to use the mouse and keyboard at all.

                          1 Reply Last reply Reply Quote 1
                          • Q
                            quicksilver @Simrose
                            last edited by 2 Jun 2020, 00:14

                            @Simrose somehow I missed your response. Did you ever figure it out.

                            1 Reply Last reply Reply Quote 0
                            • S
                              Simrose
                              last edited by 2 Jun 2020, 14:19

                              @quicksilver I never figured it out and started experimenting with other things. But I would love to get it working as you have.

                              Q 1 Reply Last reply 2 Jun 2020, 14:36 Reply Quote 0
                              • Q
                                quicksilver @Simrose
                                last edited by quicksilver 6 Feb 2020, 15:40 2 Jun 2020, 14:36

                                @Simrose does your TV remote have a button labeled "display" or something similar? My Vizio TV has this, and when pressed it shows the current input selected and the current resolution. Then you can launch a dos game and check to see what resolution it's running in.

                                A few other things to check. Can you launch a dos game then exit the game. Then go to /dev/shm/runcommand.log and post the contents of that file here?

                                Also you might try looking up your exact Samsung TV model and see if you can get a list of supported resolutions. Perhaps we are requesting a resolution that your TV doesn't support.

                                CrushC 1 Reply Last reply 3 Jun 2020, 18:10 Reply Quote 0
                                • CrushC
                                  Crush @quicksilver
                                  last edited by 3 Jun 2020, 18:10

                                  Great thread, this answers pretty much all the questions i had on this subject really.
                                  But is this an issue that is being worked on to resolve or is it just incompatible with the PI4 drivers and that's the end of story?

                                  Q 1 Reply Last reply 3 Jun 2020, 18:27 Reply Quote 0
                                  • Q
                                    quicksilver @Crush
                                    last edited by 3 Jun 2020, 18:27

                                    @Crush said in Dosbox on pi 4, game window is fullscreen but not centered on screen:

                                    But is this an issue that is being worked on to resolve or is it just incompatible with the PI4 drivers and that's the end of story?

                                    Not much can be done I'm afraid. It doesn't sound like much development is happening on the fkms drivers. But it's possible this isn't an issue on the full kms drivers. Kms seems to be what the rpi devs are focused on right now.

                                    1 Reply Last reply Reply Quote 0
                                    • G
                                      Glaglachel @quicksilver
                                      last edited by 5 Jun 2020, 17:16

                                      @quicksilver Very nice workaround, it takes just some time for my projector to adapt the display resolution but as it is automatic, fine for me :-) Thanks !

                                      I even had to slow some games... :-D

                                      1 Reply Last reply Reply Quote 1
                                      • S
                                        Simrose
                                        last edited by Simrose 6 Jun 2020, 14:47 6 Jun 2020, 13:46

                                        @quicksilver
                                        The resoltion on tv info says 1920x1080p
                                        so that must be the issue that its not switching and the scripts not activated.
                                        i have them in correct location, do i need to do anything with them before running games.
                                        Sorry took along time to respond
                                        Thanks
                                        Sim

                                        Q 1 Reply Last reply 6 Jun 2020, 14:10 Reply Quote 0
                                        • Q
                                          quicksilver @Simrose
                                          last edited by quicksilver 6 Jun 2020, 15:14 6 Jun 2020, 14:10

                                          @Simrose try this: drop to the command line (press f4 if youre in emulation station) and type

                                          tvservice -m DMT
                                          

                                          Post the output here.

                                          Also do

                                          tvservice -m CEA
                                          

                                          And post the output here

                                          S 1 Reply Last reply 6 Jun 2020, 14:47 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