Author Topic: Dosbox  (Read 11030 times)

vader

  • Sr. Member
  • ****
  • Posts: 285
    • View Profile
Dosbox
« on: August 09, 2018, 07:47:45 pm »
After playing around for a while, I have managed to get dosbox compiling on the gemini. I modified the renderer so that it is landscape inverted, and it worked. I haven't tested sound yet, and there are some scaling and keyboard (layout) issues, but it is basically functional. I'll see what I can get done this weekend, and maybe write a small qml front end. I'm sure there are lots of issues, like touch screen that I haven't seen yet, but the good news is that it is running on the gemini!

When it is in a stable state, I can post it for people to test if anyone is interested. I'm sure there are lots of things that will need to be tweaked. As a matter of interest, I did all the compiling/editing on the gemini under sailfish. Same with ffmpeg.

vader

  • Sr. Member
  • ****
  • Posts: 285
    • View Profile
Dosbox
« Reply #1 on: August 15, 2018, 04:39:33 am »
Ok, so with a bit of help from the sailfish forum (thanks coderus), I have got sound working in dosbox. It is now fully functional and works quite well on the Gemini. I am going to write a nice qml front end so you can rotate and change the settings. I installed doom (shareware version) and it runs well. There are a very large number of abandonware dos titles out there, so if you like retro games, dosbox is for you

epninety

  • Newbie
  • *
  • Posts: 18
    • View Profile
Dosbox
« Reply #2 on: August 15, 2018, 09:40:10 am »
Quote from: vader
Ok, so with a bit of help from the sailfish forum (thanks coderus), I have got sound working in dosbox. It is now fully functional and works quite well on the Gemini. I am going to write a nice qml front end so you can rotate and change the settings. I installed doom (shareware version) and it runs well. There are a very large number of abandonware dos titles out there, so if you like retro games, dosbox is for you

No interest in games, but I'd like to try it out for a few old dos utilites when you thinks its ready for an audience.  

Meganerd

  • Newbie
  • *
  • Posts: 34
    • View Profile
Dosbox
« Reply #3 on: August 15, 2018, 10:16:02 am »
Hey Vader! I am definitely interested in this project. Out of curiousity I would like to run and old version of Windows.

vader

  • Sr. Member
  • ****
  • Posts: 285
    • View Profile
Dosbox
« Reply #4 on: August 15, 2018, 06:39:35 pm »
Quote from: Meganerd
Hey Vader! I am definitely interested in this project. Out of curiousity I would like to run and old version of Windows.
Dosbox should be able to run windows 3.1 if you can find a copy  There are many howtos online. I should have the package ready by the end of the weekend. The hardest part will be working out which dependent libraries aren't installed by default, as I have installed a bucket load. The jolla store doesn't like SDL rotated apps as they mess with the GUI (volume bar goes vertical on the right hand side). I'll make rotation an option, but this will probably only be useful for geminis.

Good news is that I can now compile pretty much any SDL2 app and have fully working video and sound now that I worked out how to rotate the video and get sound working through pulse audio (yuck).

depscribe

  • Sr. Member
  • ****
  • Posts: 252
    • View Profile
Dosbox
« Reply #5 on: August 16, 2018, 12:08:13 am »
Hey, Vader . . .

Glad to see it's moving along. I tried the compiled binaries in the distro a while back: https://www.oesf.org/forum/index.php?showtopic=35015

The biggest problem I found, besides scaling, was keymapping.
dep

Atari Portfolio (yes, it still works and yes, I bought it new)
Libretto 110 CT (with docking station and all kinds of PCMCIA stuff)
And, now, a Gemini and, fortunately, a GPD Pocket

vader

  • Sr. Member
  • ****
  • Posts: 285
    • View Profile
Dosbox
« Reply #6 on: August 20, 2018, 07:37:37 pm »
Quote from: depscribe
Hey, Vader . . .

Glad to see it's moving along. I tried the compiled binaries in the distro a while back: https://www.oesf.org/forum/index.php?showtopic=35015

The biggest problem I found, besides scaling, was keymapping.

Scaling was easy - we use gl for the renderer, so I just rotated and scaled using gl (single function call). For key mapping, you would normally use the dosbox mapper, but that has proven problematic. I manually created the keymap file by adding some printfs in the code to give me the SDL codes, then made dosbox create a template mapper file which I edited with the discovered codes. I should have probably written a nice util to do this (maybe in the qml frontend), but this took all of 5 minutes. I have Fn keys, and all the normally required things. I added a mod_3 which picks up the gemini's fn key. I installed Elder scrolls last night, but it needed a mouse. Dosbox isn't normally touchscreen friendly, so I might add something to get it to work.

Any keyboard games (eg. doom etc) work really well. You get a 4x3 sceen at full height (ie 1440x1080 - black bars either side). It is getting close to being packagable and it receiving a good amount of testing  Scumm games work well on the original DOS installations, so I probably won't bother fixing scummvm.

depscribe

  • Sr. Member
  • ****
  • Posts: 252
    • View Profile
Dosbox
« Reply #7 on: August 20, 2018, 08:24:21 pm »
Quote from: vader
Scaling was easy - we use gl for the renderer, so I just rotated and scaled using gl (single function call). For key mapping, you would normally use the dosbox mapper, but that has proven problematic. I manually created the keymap file by adding some printfs in the code to give me the SDL codes, then made dosbox create a template mapper file which I edited with the discovered codes. I should have probably written a nice util to do this (maybe in the qml frontend), but this took all of 5 minutes. I have Fn keys, and all the normally required things. I added a mod_3 which picks up the gemini's fn key. I installed Elder scrolls last night, but it needed a mouse. Dosbox isn't normally touchscreen friendly, so I might add something to get it to work.

Any keyboard games (eg. doom etc) work really well. You get a 4x3 sceen at full height (ie 1440x1080 - black bars either side). It is getting close to being packagable and it receiving a good amount of testing  Scumm games work well on the original DOS installations, so I probably won't bother fixing scummvm.
That's really cool -- especially under Sailfish. Because when you get it all happily packaged, I'll install it instantly and will run the old (and now, free) Word for DOS in it and save as .rtf. There being no Sailfish-native word processor and at this screen size terminal fonts are nicer and more readable than GUI ones, anyway. Good job!
dep

Atari Portfolio (yes, it still works and yes, I bought it new)
Libretto 110 CT (with docking station and all kinds of PCMCIA stuff)
And, now, a Gemini and, fortunately, a GPD Pocket

vader

  • Sr. Member
  • ****
  • Posts: 285
    • View Profile
Dosbox
« Reply #8 on: August 21, 2018, 07:02:28 pm »
So I got the touchscreen working last night, however for DOS games to successfully use the mouse, it listens to movement, rather than absolute position. I have implemented it like a touchpad but want to see if people like the way I have done it, or can suggest a better way. For simplicity, touching the screen doesn't activate a mouse button, but enables mouse move mode. When you touch and move, the cursor moves like a touchpad ie. the cursor moves. To generate a mouse button, you double tap. If two taps occur within a fast timeframe (ie. 300ms), it activates a left mouse down. If the taps are within a slower timeframe (600ms), it activates the right button. To click and drag, double tap but don't lift your finger. To get an actual double click, you tripple tap. I can't find an SDL routing to detect multiple touches. So:

1) press and release screen (tap): nothing
2) press and drag: mouse move in trackpad style mode
3) tap then press less than 300ms apart: left mouse button down
4) tap then press more than 300ms, but less than 600ms: right mouse button down
5) release after either 3 or 4: mouse button up

You can do 3 or 4, and move your finger to do a "click and drag".

Works well in all the games I have tried so far.

I have also installed word 5.5 (the now free version), and it works. The mouse functionality works, as do the Fn keys etc.

depscribe

  • Sr. Member
  • ****
  • Posts: 252
    • View Profile
Dosbox
« Reply #9 on: August 21, 2018, 07:59:40 pm »
Quote from: vader
I have also installed word 5.5 (the now free version), and it works. The mouse functionality works, as do the Fn keys etc.
Do you have it RPMified?

Made a trip to town a few hours ago and was delighted that the phone stuff all works. This without having selected the SIM card in an Android boot, on an X27 device, so perhaps that bug got squashed. I  need to experiment a little with getting it to connect to the VPN over the mobile network, but that will involve sitting in a park with a cup of coffee and playing with configuration for awhile.

Having a useful word processor will make my life pleasanter. You have done a service.

Am I right in thinking you've upgraded your Sailfish from 2.14.14? Notice any differences? (Sailfish's one real weakness, I think, is in documentation -- there isn't any I can find.)
dep

Atari Portfolio (yes, it still works and yes, I bought it new)
Libretto 110 CT (with docking station and all kinds of PCMCIA stuff)
And, now, a Gemini and, fortunately, a GPD Pocket

vader

  • Sr. Member
  • ****
  • Posts: 285
    • View Profile
Dosbox
« Reply #10 on: August 21, 2018, 09:45:07 pm »
Quote from: depscribe
Do you have it RPMified?

No, that is tonight's job. I'll call it an early beta  just for gemini. I need to work out the dependencies - I have installed quite a few libraries.

Quote from: depscribe
Having a useful word processor will make my life pleasanter. You have done a service.

Welcome. I had a play and it looks usable.

Quote from: depscribe
Am I right in thinking you've upgraded your Sailfish from 2.14.14? Notice any differences? (Sailfish's one real weakness, I think, is in documentation -- there isn't any I can find.)

Nope, still the standard 2.1.4.14! I've beaten it into submission now, which is why I am starting to go and compile up apps which are missing. There are a few good docs out there. This is a good start:

https://github.com/sailfishos-community/awesome-sailfishos

vader

  • Sr. Member
  • ****
  • Posts: 285
    • View Profile
Dosbox
« Reply #11 on: August 22, 2018, 09:07:26 pm »
So I think I have an RPM which has the correct dependencies. It is still in an early state, but pretty much everything works. The mouse is as discussed earlier, and the keyboard has most keys mapped out for the US keyboard. One annoying thing is that to get the colon ":" character, you need to press shift-FN-K as dosbox "knows" that : is above ;

There are still a lot of FN key combinations not set up, but I haven't needed them yet so......To get function keys, press FN-Alt-1 to FN-Alt-0 (Fn1 -> Fn10). The RPM creates a ~/dos directory and sets dosbox to mount it as c:. You can change you setup by editing the map or config files in ~/.dosbox . I will add the ability to the qml page later.

The only annoying thing at the moment, is that when no sound or input is detected for a while, sailfish thinks the app has died and brings up a popup asking you to wait or close the app. I am looking into this and will fix it soon. This is a gemini only port, as I have set the rotations etc for the gemini - another thing to add to the qml front end. This is really a pre-release so people can test/make suggestions.

Enjoy!

PS. if you can't install due to dependency problems, give me a yell and I'll add them. I checked against the original sailfish image mounted on my linux box.

Before installing, unzip the attached file (gunzip Dosbox-0.1-1.armv7hl.rpm.gz). As usual, you install at your own risk.

depscribe

  • Sr. Member
  • ****
  • Posts: 252
    • View Profile
Dosbox
« Reply #12 on: August 22, 2018, 09:25:17 pm »
Quote from: vader
So I think I have an RPM which has the correct dependencies. It is still in an early state, but pretty much everything works. The mouse is as discussed earlier, and the keyboard has most keys mapped out for the US keyboard. One annoying thing is that to get the colon ":" character, you need to press shift-FN-K as dosbox "knows" that : is above ;

There are still a lot of FN key combinations not set up, but I haven't needed them yet so......To get function keys, press FN-Alt-1 to FN-Alt-0 (Fn1 -> Fn10). The RPM creates a ~/dos directory and sets dosbox to mount it as c:. You can change you setup by editing the map or config files in ~/.dosbox . I will add the ability to the qml page later.

The only annoying thing at the moment, is that when no sound or input is detected for a while, sailfish thinks the app has died and brings up a popup asking you to wait or close the app. I am looking into this and will fix it soon. This is a gemini only port, as I have set the rotations etc for the gemini - another thing to add to the qml front end. This is really a pre-release so people can test/make suggestions.

Enjoy!

PS. if you can't install due to dependency problems, give me a yell and I'll add them. I checked against the original sailfish image mounted on my linux box.

Before installing, unzip the attached file (gunzip Dosbox-0.1-1.armv7hl.rpm.gz). As usual, you install at your own risk.
Way cool! I've d/led it but probably won't install it until the morning and coffee -- we're at about the hour when I make foolish, basic, hard-to-find-later mistakes. I'm hoping that dosbox treats autoexec.bat as dos itself did. Dosemu did, but your setup sounds far better than dosemu ever was.

Many thanks!
dep

Atari Portfolio (yes, it still works and yes, I bought it new)
Libretto 110 CT (with docking station and all kinds of PCMCIA stuff)
And, now, a Gemini and, fortunately, a GPD Pocket

vader

  • Sr. Member
  • ****
  • Posts: 285
    • View Profile
Dosbox
« Reply #13 on: August 22, 2018, 10:51:59 pm »
Quote from: depscribe
Way cool! I've d/led it but probably won't install it until the morning and coffee -- we're at about the hour when I make foolish, basic, hard-to-find-later mistakes. I'm hoping that dosbox treats autoexec.bat as dos itself did. Dosemu did, but your setup sounds far better than dosemu ever was.

It doesn't automatically run autoexec.bat, *however* the dosbox configuration file has an autoexec section at the bottom which runs the given commands. You will see I added the mount and change to c drive

eg. (from dosbox-SVN.conf)

[autoexec]
# Lines in this section will be run at startup.
# You can put your MOUNT lines here.
mount c ~/dos -freesize 1024
c:

PS. I think I am on the other side of the planet, so sometimes the response time is a bit slow

depscribe

  • Sr. Member
  • ****
  • Posts: 252
    • View Profile
Dosbox
« Reply #14 on: August 23, 2018, 01:42:08 pm »
Quote from: vader
PS. I think I am on the other side of the planet, so sometimes the response time is a bit slow

Yup -- I'm in the middle of the U.S., so I couldn't be much farther from you.

Slightly OT: are there any Fn key mappings generally in SFOS for Gemini? I have some terminal mode utilities that don't much work without them, but I cannot find any combination of keys that profuces a function key.

Back on topic: Your Dosbox package installed easily and perfectly. Great work! I have Word for DOS running well. It *seems* to run a bit more nicely in one of the graphics modes allowed in the Edit>Preferences settings. And you're entirely right that the "Application not responding" sideways pop-up is really, really irritating.

A probably stupid question: are we limited to the various SFOS repositories, or might we harvest RPMs from elsewhere? Do we know the distribution and version on which Sailfish is based and therefore know where we might resolve dependencies?
« Last Edit: August 23, 2018, 02:56:11 pm by depscribe »
dep

Atari Portfolio (yes, it still works and yes, I bought it new)
Libretto 110 CT (with docking station and all kinds of PCMCIA stuff)
And, now, a Gemini and, fortunately, a GPD Pocket