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] official thread

    Scheduled Pinned Locked Moved Help and Support
    dosdosboxdosbox-stagingdosbox-xdosbox-pure
    234 Posts 27 Posters 80.9k 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.
    • ectoE
      ecto @jamrom2
      last edited by

      @jamrom2

      Here are the important (?) parts of my dosbox-staging.conf

      [sdl]
      fullscreen       = true
      display          = 0
      fullresolution   = desktop
      windowresolution = default
      output           = openglpp
      texture_renderer = opengl
      
      [dosbox]
      language          = 
      machine           = vesa_nolfb
      captures          = capture
      memsize           = 16
      startup_verbosity = high
      
      [render]
      frameskip          = 0
      aspect             = true
      monochrome_palette = white
      scaler             = none
      glshader           = /opt/retropie/emulators/dosbox-staging/zfast_crt.glsl
      

      Maybe that helps ;)

      N 1 Reply Last reply Reply Quote 0
      • N
        nemo93 @ecto
        last edited by

        @ecto thanks for reporting back. Very useful. Whenever there's sound crackling that means you have either not enough cycles or too many. On either Pi3 or Pi4 I consider the maximum number of cycles you can set to be 35.000 (it's possible to go beyond that point on Pi4 using a specific dev branch). To me setting 35.000 should be done only for the most demanding games and usually this is where sound will start crackling. Also SVGA will require more processing power than VGA so try the latter in case of issue. As a rule try to stay under 35.000 whenever you can.

        In Staging MT32/Fluidsynth should run on their own thread automatically. Decision has been made to hide as much options as possible from users in order to expose only the most relevant ones in the conf. To keep things tidy and efficient.

        • Ultima VII: I'm a bit surprised you had to go up to 35.000 cycles. Can you try with far less than that? I'm using 10.000 cycles here and it looks ok. Anything in the range from 9000 to 11.000 cycles should be good for more recent Ultima's. It's fine to disable EMS as well.

        • Wing Commander IV: required a beast back in the days especially if you wanted to play in "hi-res" mode which is SVGA. This one should require more than 35.000 cycles to run smooth. Apparently it should be fine in the range 50-60.000 cycles. A bit too high even on a Pi4. Try VGA instead to see if this runs better and don't go above 30.000 cycles.

        @jamrom2 I believe @ecto provided everything :-) Just keep in mind you can set options/functionalities on a per-game basis. You need to rely on an opengl output for shaders to work.

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

          @nemo93
          You are right, with Ultima VII, I didn't need 35000 cycles there. I've settled for 16000, which is more than enough (it doesn't hurt to let the Avatar run a little faster). ;)

          But very good news: I think I just had a small breaktrough! In all (?) VGA (320x200) games that had some sort of sound crackling before, I completely got rid of it by setting

          [mixer]
          blocksize = 512
          prebuffer = 200
          

          This is a bit counter intuitive (according to the documentation), but it works. Also, for most of those games, the sweet spot of cpu cycles is (as you said) more around 20000 than around 30000.

          Now I still have to find out, why SVGA (640x480) games are so much worse on stagingas in comparison to SVN, where those run fluently! I tried different ones (Wing Commander 3+4, The Settlers 1+2, Terminal Velocity, Dungeon Keeper...) and there is always crackling sound even with my new settings from above. The crackling gets really bad, as soon as I move my mouse, so maybe there is a connection?

          jamrom2J 1 Reply Last reply Reply Quote 0
          • jamrom2J
            jamrom2 @ecto
            last edited by

            @ecto I'm not sure what I'm doing wrong with this, but no matter what I put in those SDL settings, I get either box in the middle of the screen as big as a birthday card, or I get a box in the lower left-hand screen the size of a business card.

            Is there a full write-up on making all this work? I must be missing a step somewhere.

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

              @jamrom2 The one in the top left corner of the screen sound like SVNSDL 1 scaling maybe. I think the easiest way for proper scaling is to follow these instructions.

              @nemo93 Do you know if it is possible to run dosbox-stagingwith XINIT:? I tried that before, but I had no keyboard/mouse input. But the performance looked ok on first glimpse.

              N 1 Reply Last reply Reply Quote 0
              • N
                nemo93 @ecto
                last edited by

                @ecto said in [DOSbox] official thread:

                XINIT

                I don't know unfortunately. I'm only using the base Retropie image without any tweaks or extras like a desktop env. Your issue remind me of an "interesting" problem discovered not long ago which has DOSbox to query like crazy the event queue (read here for more details). It should be merged soon in master and will bring lag improvement as well - hopefully on low-spec devices too! You could already try to compile the branch kc/synchronize-polling-1 if you can't wait.

                @jamrom2 first can you try the settings available from the wiki page please? Especially those about the "default config file". If you're relying on a standard Retropie + Pi4 those settings should work out-of-the-box for you with no display issue.

                ectoE jamrom2J 3 Replies Last reply Reply Quote 0
                • ectoE
                  ecto @nemo93
                  last edited by ecto

                  @nemo93 Thanks for the tip! I'll try that one out (I am compiling as I type)

                  But here is another interesting discovery I made just now: I started stagingwith the XINIT:command, and -as expected- the keyboard doesn't work. BUT I was able to use the mouse! So I checked some SVGA games (Wing commander 3+4, X-Com3, Settlers) and there was no sound crackling or laggyness at all! So if just the keyboard would work, that would be the best dosbox experience, I think?
                  I will report back in a few minutes after testing kc/synchronize-polling-1

                  EDIT
                  Nope, still crackling audio on mouse-movement (I only tested X-Com3 and WC4).

                  1 Reply Last reply Reply Quote 0
                  • jamrom2J
                    jamrom2 @nemo93
                    last edited by jamrom2

                    @nemo93 Hello... sorry to be a PIA with this... but a lot of this just doesn't make sense.

                    So here is what I did/have so far.

                    1. I removed all other instances of Dosbox (lr-, SDL, Pure) and reloaded only DosBox and Staging.
                    2. I looked at the instructions and checked my +Start DOSBox-Staging.sh files located in /home/pi/RetroPie/roms/pc and checked that on the first line it specifies..

                    if present
                    /home/pi/.config/dosbox/dosbox-staging.conf
                    will be used as primary config

                    1. I then created the required dosbox-staging.conf file and place in the in location specified above. In that file, I places all the parameters listed in the pull-down of the "default config file" section.
                    2. Now I switched over to my games... I still use .sh files to point to my game roms. Not sure if that's correct anymore because that is what used to be required to run Dosbox games. No where does it says how to setup the games to run, other than requiring individual *.config files. Having said that....
                    3. I will use Aces Over Europe (aoe) as my example... in my folder ./roms/pc resides all my .sh files. so aoe.sh is as follows... minus the "bin/bash" command at the top.

                    /opt/retropie/emulators/dosbox/bin/dosbox -conf "/home/pi/RetroPie/roms/dos/aoe/aoe.conf"

                    This tells me that dosbox is running the game, not dosbox-staging. No where does it say anything about pointing to dosbox-staging other than what is mentioned in my first step mentioned above.
                    6. I then open the ./roms/dos/aoe/aoe.conf file which is only has the following... my joystick mapper file location, the midi and autoexec to run the game.

                    [sdl]
                    mapperfile=/home/pi/RetroPie/roms/dos/aoe/aoe.map

                    [midi]
                    mpu401 = intelligent
                    mididevice = mt32

                    [autoexec]
                    mount c /home/pi/RetroPie/roms/dos
                    C:
                    CD aoe
                    AOE.COM
                    EXIT

                    1. Ok.. now I start the game and in the runcommand launch choose dosbox-staging? It points to DosBox SVN. I switch to DosBox, it points to Dosbox SVN.

                    So where in all this, aside from the statement in +Start DOSBox-Staging.sh, does Staging actually get called to start running. Why do I even need Dosbox loaded.

                    I don't like coming to someone with a laundry list of problems. I can offer this as a solution. I'd like to write-up clear instructions on how to get Staging working, for laymen like me... some of this stuff is a little verbose and technical. So if you help me getting it running, I'll do a step by step Staging build process... including shaders.

                    Thank you.

                    almost forgot... if I change the aoe.sh file to read.. /opt/retropie/emulators/dosbox-staging/dosbox -conf "/home/pi/RetroPie/roms/dos/aoe/aoe.conf"

                    Dosbox-staging runs... but I get the small box in the lower left corner, no shaders.

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

                      @nemo93 OK, I have great news regarding XINIT:

                      There seems to be a bug in staging. It seems that the keyboard doesn't work as long as it is running in fullscreen mode (either with fullscreen = true or when pressing alt-enter to enter fullscreen when running in windowed mode).

                      I have now the settings

                      [sdl]
                      fullscreen=false
                      windowresolution=1920x1080
                      

                      in dosbox-staging.conf and it's really running great with xinit. No lag, no crackling, no tearing and full speed even with shaders! SVGA games like WC 3+4, Settlers or XCom3 are very much playable! YESSS!!

                      Now the only problem in windowed mode is that the screen is flushed to the top and the left. Using output=openglnbscales the output vertically, so it's "only" flushed to the left,so it's not perfect yet.

                      I think I will post the issue with the non-working keyboard in fullscreen mode on the github project page. Maybe something can be done about that. The problem doesn't exist in SVN.

                      PS:
                      I think I can even get the Crusader games running! :D But there are still some adjustments to cycles needed.

                      EDIT
                      I just submitted a bug-report to the git project page. Let's see what comes from that.

                      jamrom2J 1 Reply Last reply Reply Quote 0
                      • jamrom2J
                        jamrom2 @ecto
                        last edited by jamrom2

                        after roughly 4 hours of playing around with this... I'm slightly better than I was before.

                        I removed all known traces of anything DOSbox related to all versions. Went back and reinstalled Staging from source. Checked that I had the correct dosbox-staging.conf placed in the .config\dosbox folder.

                        Installed XINIT as suggested and updated my emulators.cfg to reflect the new choice.. and removed all others. So all I have is Staging as the choice for DOS.

                        dosbox-staging = "XINIT:bash /home/pi/RetroPie/roms/pc/+Start\ DOSBox-Staging.sh %ROM%"
                        default = "dosbox-staging"

                        Reduced the aoe.conf to nothing but the joystick mapping and autoexec paramters...

                        Finally... In the main dosbox-staging config file. I have the following for the more important display parameters...

                        [sdl]
                        fullscreen = false
                        display = 0
                        fullresolution = default
                        windowresolution = 1920x1080
                        output = openglpp
                        texture_renderer = opengl
                        capture_mouse = onstart middlerelease
                        sensitivity = 100
                        waitonerror = true
                        priority = higher,normal
                        screensaver = auto

                        [dosbox]
                        language =
                        machine = vesa_nolfb
                        captures = capture
                        memsize = 16
                        startup_verbosity = high

                        [render]
                        frameskip = 0
                        aspect = true
                        monochrome_palette = white
                        scaler = none
                        glshader = /opt/retropie/emulators/dosbox-staging/zfast_crt.glsl

                        All I get now when I run a game is the middle of the screen is the game, shrunken to maybe 1/4 the size.

                        I'm at a total loss of analytical skill at this one.

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

                          @jamrom2 Try output=openglnb. This will scale the picture at least to the full height of your screen. Using stagung with XINIT isn't working correctly atm...

                          N 1 Reply Last reply Reply Quote 0
                          • N
                            nemo93 @ecto
                            last edited by

                            @ecto thanks again for reporting and for providing detailed feedback. Much appreciated and I see the bug you discovered is already fixed and about to be merged in. Your "feeling" about using XINIT proved to be very interesting. For now it's a bit too specific (+ you are on KMS) but I'll keep my eyes peeled. Feel free to keep on testing. At some point we may add a XINIT section to the wiki for those who want to give it a try. On my end though I'd prefer Staging to deliver best results on the console without any extra as it's the way Retropie does operate. I do have very good perf on my Pi4 with almost any games I've tested so far. It just requires some patience to be able to fine-tune the games conf files.

                            Speaking of conf files... @jamrom2 you're next :-) Don't worry about asking questions and seeking for help. That's what this forum and this thread are all about. Let me ask you to start over again and play by the book. It's fine for you to have already one (or several) of other DOSbox flavors installed (either SVN or any of "libretro" cores). Then follow the guide from the wiki to the letter. It will have you adding a new script which will compile Staging and create the required files for you. Read the guide to the end as it will show you how to tell Retropie to use Staging as the default emulator by editing <Retropie>/configs/pc/emulators.cfg.

                            At this point you should have a Staging binary, a default conf file under <Retropie>/configs/pc/dosbox-staging.conf and a launch script under <Retropie>/roms/pc/+Start DOSBox-Staging.sh. Do not touch that launch script and do not modify that default conf file.

                            All that's required from now on is one .conf file per game to tell Staging what to do - place these .conf file(s) in roms/pc. Under Retropie/EmulationStation/Pegasus, to run a game you'll have to simply point to that .conf file.

                            NOTE: even if .sh are indeed supported and other methods will allow you to run games, I do recommend the following simple approach: a default conf file + one .conf per game. That's all. The default conf file comes with default settings which will allow most games to run ok-ish and the game .conf file is there to overload (or to enforce) specific parameters allowing the game to run better/smoother. As a user you just need to edit that game .conf file located under your <Retropie>/roms/pc/ directory.

                            Let's use DOOM as an example. Because DOOM is awesome. Just create a doom.conf under <Retropie>/roms/pc/ directory and copy/paste the below:

                            [cpu]
                            cycles = 30000
                            
                            [midi]
                            mpu401     = intelligent
                            mididevice = fluidsynth
                            
                            [autoexec]
                            mount c /home/pi/RetroPie/roms/pc/games
                            C:
                            CD DOOM
                            DOOM.EXE
                            EXIT
                            

                            Change the line mount c /home/pi/RetroPie/roms/pc/games according to your system and where you have copied over the DOOM files. That's it. Now from your frontend any time you'll run doom.conf automatically Staging will launch it with the above parameters. Should the game does have issue, all you need to do is to edit that very doom.conf file. Nothing else.

                            Hope this helps.

                            jamrom2J 2 Replies Last reply Reply Quote 0
                            • jamrom2J
                              jamrom2 @nemo93
                              last edited by

                              @nemo93 Thanks Nemo

                              I went through all of this from scratch to make sure I have it all covered properly.

                              Observations:

                              1. According to the first line of the installed +dosbox-staging wrapper file, the placement of the dosbox-staging.conf calls for it being in ./conf./dosbox Anywhere else I put it failed.
                              2. The games do not display in full-screen no matter what until I add in "XINIT:" to the bash statement of emulators.cfg file in /opt/retropie/configs.hdmi/pc
                              3. When I got it running... it was woefully slow, regardless if the shader was on or off.
                              4. I like the one config for main, and other configs per game. That's a really good idea.
                              5. The .sh method would work as well, and it does, as long as you edit it to remove the setting you don't need, and keep the autoexec area.
                              6. After all this, and getting it running... I fell back to regular DosBox as it seems there is still work needing to be done. I have a Pi3b+ so most likely I'm restricted on the performance this needs to run right.

                              Thanks,

                              Jam

                              1 Reply Last reply Reply Quote 0
                              • jamrom2J
                                jamrom2 @nemo93
                                last edited by

                                @nemo93 I decided to fall-back to Dosbox and "upgrade" to the latest SDL2 version build.

                                In doing so, I noticed I don't have any keyboard support. I didn't have this issue with the previous version of DosBox, but it didn't look as good as SDL2.

                                So having said that... what is wrong? Did I miss something in the install? Seems every version of DOSbox I've tried I spend hours trying to get things to work.

                                Thanks.

                                Jam

                                N 1 Reply Last reply Reply Quote 0
                                • N
                                  nemo93 @jamrom2
                                  last edited by

                                  @jamrom2 I'm a bit concerned as the above guide is working fine. Do you have some unusual setup perhaps? Do you rely on official Retropie image and kernel (eg. do you have KMS/fKMS)? Remove any DOSbox modules and install first "SVN" and then Staging (if you want to) using the script provided.

                                  With anything DOSBox and whenever something is not working the way it should it's due to config issue. I can't help you further here but try to focus on one game until you have it working. I'll insist also that you stick to the one default config + one conf per game. You'll see it will greatly help you to make stuff working and simplify debug. For fullscreen/correct aspect and assuming you're running from the console/a frontend this will work for pi3/pi4 - add that to the default config file:

                                  [sdl]
                                  fullscreen       = true
                                  display          = 0
                                  fullresolution   = desktop
                                  windowresolution = original
                                  output           = texturenb
                                  texture_renderer = opengles2
                                  capture_mouse    = onstart middlerelease
                                  sensitivity      = 100
                                  waitonerror      = true
                                  priority         = higher,normal
                                  mapperfile       = mapper-sdl2-git.map
                                  screensaver      = auto
                                  
                                  jamrom2J 1 Reply Last reply Reply Quote 0
                                  • jamrom2J
                                    jamrom2 @nemo93
                                    last edited by jamrom2

                                    @nemo93 OK. I'm going to start with a clean slate...

                                    • My build is a legit Retropie 4.7.1 build running a no-frills EmulationStation front end. Nothing crazy (other than what I've added over the past year)... I don't know what KMS/fKMS is. So I'll say it isn't loaded.
                                    • The Staging install script works great, no issues installing Staging. It's listed in my Exp Packages list in RetroPie-Setup script now. I built the file and ran it as suggested. I had it running, but it was a slide show.
                                    • I'm going to clean out my "/roms/pc" folder where all the ".sh" were and where all the ".conf" files will reside, as all my actual games are located in another folder all together in "/roms/dos".
                                    • Ultimately I want to be able to do a side-by-side comparison of the game performance as I know the complexity of different games effects how the emulator runs. So if SDL2 runs better for flight sims, if Staging is better for newer DOS games, I'll use that and so on.
                                    • the only reason I had all the .sh files was because that was the only way it was recommended to run DOSBox games 5 years ago when I first built the DOSBox side of my image as ES didn't recognize .conf files. Since then, yes I agree, the config file method is much better. I will be switching over and editing my gamelist file to the .conf extension.

                                    As requested. I'll install DosBox-SVN first... then jump into Staging.

                                    Dosbox SVN installs a config file in /opt/retropie/configs.hdmi/pc called "dosbox-SVN.conf". I am assuming this will be the main config file that I will be working with to set the main setting in DosBox. From there, I will build 3 config files in "/roms/pc" for the following games... Aces Over Europe, Abuse and Doom. 3 games that I feel allow me to test performance and keyboard/gamepad use.

                                    They all work good as expected and I played around with each separate config just to see if it was reading it as it should and overwriting the main dosbox config file. All is good. Whatever I set for resolution in each .conf overwrites the main file.

                                    Now on to Staging...

                                    jamrom2J 1 Reply Last reply Reply Quote 0
                                    • jamrom2J
                                      jamrom2 @jamrom2
                                      last edited by

                                      @nemo93 ...and the results...

                                      • Staging loaded no issues. I used the default config and tweaked it with the settings above. The sound is a mess, very choppy and broken. The video is the same. Doom is livable, but AOE and Abuse are unplayable.
                                      • Loaded SDL2 as the final choice. Tweaked with the same settings above in your post. It ran great. Sound is good, all video on all games is fast and crisp. No muddy look, no Hardware stretching... but... no keyboard.

                                      So all in all.... I understand why I was having so many issues trying to get video to work. The .sh files were screwing me up. This direct .conf method is so much better and faster to tweak.

                                      I'd like to help more... I don't see why my keyboard (BT Rii mini i8) doesn't work in SDL2.

                                      Jam

                                      1 Reply Last reply Reply Quote 0
                                      • N
                                        nemo93
                                        last edited by nemo93

                                        @jamrom2 nice to see all the efforts! Good job :-) At least now you got a fine setup, easy to debug and to tweak whatever DOSBox "module" you're relying on. As mentioned above whenever sound is crackling and image is stuttering you either got not enough cycles or too many. Both Abuse and DOOM require quite some high cycles count to run fullspeed. Just for the record here are my 2 .conf for those games - keep in mind I'm on a Pi4 and using a specific branch of Staging:

                                        abuse.conf

                                        [cpu]
                                        cycles = 35000
                                        
                                        [midi]
                                        mpu401     = intelligent
                                        mididevice = fluidsynth
                                        
                                        [autoexec]
                                        mount c /home/pi/RetroPie/roms/pc/games
                                        C:
                                        CD ABUSE
                                        ABUSE.EXE
                                        EXIT
                                        

                                        doom.conf

                                        [sdl]
                                        capture_mouse = nomouse
                                        
                                        [cpu]
                                        cycles = 70000
                                        
                                        [midi]
                                        mpu401     = intelligent
                                        mididevice = fluidsynth
                                        
                                        [autoexec]
                                        mount c /home/pi/RetroPie/roms/pc/games
                                        C:
                                        CD DOOM
                                        DOOM.EXE
                                        EXIT
                                        

                                        Both games support General MIDI hence the [midi] section. I've set a soundfont in the default config file (dosbox-staging.conf) but you can also set a soundfont in each game .conf.

                                        I insist: it might be difficult to get those games to run fullspeed. They both got their own Raspberry port which run much better so if you really want to play these give a try to such ports (included within Retropie). Or you could try with "SVN" or the "SDL2" indeed.

                                        I can't help to respond why there's no keyboard on "SDL2" but just ensure to use the default config file provided with the installation and try running DOSbox in pure DOS mode (the "console") to see if you could type in something.

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

                                          Hi,

                                          has anyone successfully tried getting Frontier: First Encounters (Elite 3) to run?
                                          There is a shareware version online to try it out. Dosbox SVN and Stagingboth crash, when I press a button in the startup screen. Apparently dosbox pure crashes, too.

                                          I can run the game with the exact same files from my desktop Windows pc, so it's probably related to the platform?

                                          jamrom2J 1 Reply Last reply Reply Quote 0
                                          • jamrom2J
                                            jamrom2 @ecto
                                            last edited by

                                            so after playing with all the versions of each module... I'm finding that none of this is an exact science with getting any of this to work.

                                            • Lr-dosbox-pure looks fantastic, easy to install games (no config files) and has a great "retroarch based menu", but jeeze... it's nearly impossible to get one controller configuration to work on every game. Plus it keeps adding a *.save file which I can't figure out how to re-direct to another location to save to.

                                            • Dosbox-Staging - for whatever reason that four hours of tweaking couldn't find... the keyboard doesn't work, neither can I get the shader to display. Like every DOS game from back in the day, it must be tweaked per game. Not a big deal, it's kind-of expected.. but since the keyboard dosn't work, what's the point.

                                            • Dosbox-SDL2 - same as above. And I can see when it loads, it's loading the correct version in the blue DosBox "autoexec" load screen. It's loading SVN and having the exact issues Staging is, although the .conf has no info other than display and autoexec.

                                            • DosBox (the baseline version)- everything works in it, but the screen never displays is true 4:3 so it looks odd. Other than that, everything seems to work without much tweaking required.

                                            So in conculsion... this is a lot of work and I don't see anything working. It's like starting 10 projects at once, and not completing any of them.

                                            ectoE 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.