VOGONS


First post, by carangil

User metadata
Rank Newbie
Rank
Newbie

The instructions to download the dosbox source, editing a couple header files, and enabling recompiler support for ARM has been known for years. I've done it myself on an arm chromebook, and on a raspberry pi. So why don't the Raspbian or Arch Linux ARM distributions just package it that way? Being able to apt-get or pacman a working fast emulator should be as easy on ARM as it is on x86. Is this something that the dosbox developers need to work on to get the distros to take it?

Reply 1 of 16, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

maybe the configure test to enable it fails ?

Can you post the config.h (and config.log) after running configure (e.g without doing any edits yourself)

Water flows down the stream
How to ask questions the smart way!

Reply 2 of 16, by carangil

User metadata
Rank Newbie
Rank
Newbie

This is what my arm chromebook (Nvidia Tegra) gives in the log: (Raspberry pi does something ) similar.

configure:6274: result: no
configure:6476: checking for target cpu type
configure:6514: result: unknown
configure:6536: checking whether x86 dynamic cpu core will be enabled
configure:6548: result: no
configure:6561: checking whether recompiling cpu core will be enabled
configure:6584: result: no
configure:6598: checking whether fpu emulation will be enabled
configure:6601: result: yes
configure:6618: checking whether x86 assembly fpu core will be enabled
configure:6631: result: no
configure:6648: checking whether to enable unaligned memory access
configure:6656: result: no
configure:6661: checking png.h usability

Now, dosbox has core for arm v4 and arm v7, and a raspberry pi is arm v6. However, an arm v6 runs v4 instructions just fine, its not not perfect... like using only 486 instructions when you have a pentium. Even on my armv7 netbook, armv4 instructions also run fine, and it much faster than pure software emulation. Quake is playable on dynamic (like a slow pentium), but on normal it is a complete slideshow, worse than when I tried on my 486. (On these machines I would run the source port natively, but Quake is a good DOS performance test.)

When I look at the configure script, it seems it doesn't even attempt to recognize any arm cpu: (I do find 68k interesting... are people running DOS games on amigas and old macs? 😀 )

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for target cpu type" >&5
$as_echo_n "checking for target cpu type... " >&6; }
case "$host_cpu" in
x86_64 | amd64)
$as_echo "#define C_TARGETCPU X86_64" >>confdefs.h

{ $as_echo "$as_me:${as_lineno-$LINENO}: result: x86-64 bit compatible" >&5
$as_echo "x86-64 bit compatible" >&6; }
c_targetcpu="x86_64"
c_unalignedmemory=yes
;;
i?86)
$as_echo "#define C_TARGETCPU X86" >>confdefs.h

{ $as_echo "$as_me:${as_lineno-$LINENO}: result: x86 compatible" >&5
$as_echo "x86 compatible" >&6; }
c_targetcpu="x86"
c_unalignedmemory=yes
;;
powerpc*)
$as_echo "#define C_TARGETCPU POWERPC" >>confdefs.h

{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Power PC" >&5
$as_echo "Power PC" >&6; }
c_targetcpu="powerpc"
c_unalignedmemory=yes
;;
m68k*)
$as_echo "#define C_TARGETCPU M68K" >>confdefs.h

{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Motorola 68000" >&5
$as_echo "Motorola 68000" >&6; }
c_targetcpu="m68k"
c_unalignedmemory=yes
;;
*)
$as_echo "#define C_TARGETCPU UNKNOWN" >>confdefs.h

{ $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown" >&5
$as_echo "unknown" >&6; }
c_unalignedmemory=no
;;
esac

Reply 3 of 16, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Right.

What does the $host_cpu have for contents at your place and which changes do you usually make to get it running on your pi ?
(C_TARGETCPU ARMV4LE and alligned memory or no alligned memory ?)

M86K isn't used, aside for the alligned memory stuff.
PowerPC, Old macs, yes dosbox runs on those 😀

Water flows down the stream
How to ask questions the smart way!

Reply 4 of 16, by carangil

User metadata
Rank Newbie
Rank
Newbie

armv7l is the host_cpu for my chromebook

Not sure on the raspberry pi, as I haven't done that one in a while, but this old forum post has the instructions for raspberry pi:

https://www.raspberrypi.org/forums/viewtopic.php?t=9542

The armv4 recompiler works fine for armv6 such as the pi and armv7 like my chromebook. But, as far as I can tell, even if I had a real armv4 processor, the build will never use the recompiler.

I was using it aligned, but I am trying an unaligned build. I know on some arms it is a bus error to do unaligned access, so it probably shouldn't be default.

Reply 5 of 16, by M-HT

User metadata
Rank Newbie
Rank
Newbie
Qbix wrote:

maybe the configure test to enable it fails ?

Unless something changed since I made the arm backend for dynrec, there's no configure test for arm dynrec, because I didn't create it - I have no idea how and it doesn't bother me, so it's a job for someone else.

Reply 6 of 16, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I can write those tests. That is not a problem, however I will need information on what needs to be enabled and I need config.log of the chromebook and the raspberry pi

(that forum post doesn't exist btw)

Water flows down the stream
How to ask questions the smart way!

Reply 7 of 16, by carangil

User metadata
Rank Newbie
Rank
Newbie

That's because I screwed up the pasting.

https://www.raspberrypi.org/forums/viewtopic.php?t=95421

I can get the logs for a raspberry pi zero and the chromebook, but I don't have any armv4 devices, which is what the original recompiler from M-HT seems to target. I don't even know what device has that chip, perhaps an old phone?

Reply 8 of 16, by M-HT

User metadata
Rank Newbie
Rank
Newbie
carangil wrote:

That's because I screwed up the pasting.

https://www.raspberrypi.org/forums/viewtopic.php?t=95421

I can get the logs for a raspberry pi zero and the chromebook, but I don't have any armv4 devices, which is what the original recompiler from M-HT seems to target. I don't even know what device has that chip, perhaps an old phone?

The original armv4 recompiler was written for GP2X.

Reply 9 of 16, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Seems that the ARM is different between versions of the PI ?
Ideally I'd need logs for all, but I am happy with any config.log files that I can get:
https://www.raspberrypi.org/forums/viewtopic. … t=95421#p695887

This has the information with what I have to enable for version 2. do you need to do the same for the zero ? (I am totally not familiar with the versions of the PI)

Water flows down the stream
How to ask questions the smart way!

Reply 10 of 16, by carangil

User metadata
Rank Newbie
Rank
Newbie

Here is the config log from a raspberry pi zero w. The pi zero, and original pi should have the same CPU.

Note, to build on the current version of Raspbian, I needed to add stddef.h to doc_inc.h.

Those instructions for raspberry pi 2 seem about the same as what I did on the chromebook, except I didn't do any special math flags. Perhaps my floating point is not as optimized as it could be. Probably doesn't matter for anything except maybe quake. I doubt quake will be playable on the pi. It is building right now, this damned thing is sooooo slow. (If I really wanted good Quake on pi, I'd use the source port, not dosbox.) But the default build in Raspbian even made old stuff I used to play like on a 286 like Jill of the Jungle really lag.

Just to give an idea how weak the pi is, my k6-2 machine running 600Mhz, with an old build of DOSBOX plays the above mentioned Jill of the Jungle, just fine.

Reply 11 of 16, by carangil

User metadata
Rank Newbie
Rank
Newbie

Here is the arm chromebook config.

Reply 12 of 16, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Ah the pi zero has arm6, do you have a PI 2 log as well ?
I almost have enough info to add the tests

Water flows down the stream
How to ask questions the smart way!

Reply 13 of 16, by carangil

User metadata
Rank Newbie
Rank
Newbie

I do not have a pi2, but it is armv7.

Reply 14 of 16, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I have added something to the code for this.
As I don't have any info on the first pi with regards to if it allows unaligned memory access, i have not enabled this.
It is enabled for the armv7l processors (pi2/3 and chromebook)

Thanks for the logs

Water flows down the stream
How to ask questions the smart way!

Reply 15 of 16, by haemogoblin

User metadata
Rank Newbie
Rank
Newbie

Hey guys

I recently compiled dosbox with dynamic compilation for my Pi3, after i updated the system to Raspbian Stretch. The first thing I've noticed is that Dosbox doesn't work as well as it did under wheezy. Performance is slower, I can't use opengl even though it is enabled and the only way i can get a full screen, where the picture reaches the corners of my screen, is by using overlay.

Reply 16 of 16, by keenmaster486

User metadata
Rank l33t
Rank
l33t

Is there anything new in this realm? What if the DOSBox in the arm6 apt repository was updated to have dynamic recompilation enabled? (hint, hint)

World's foremost 486 enjoyer.