Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: What is the oldest CPU that can run DF?  (Read 1543 times)

methylatedspirit

  • Bay Watcher
  • it/its
    • View Profile
What is the oldest CPU that can run DF?
« on: September 11, 2020, 09:02:42 am »

(I asked this question somewhere else on this forum, but there was no response there, so I'm asking somewhere more relevant. A cursory search, both on Google and on this forum yields old (Pentium 4-era, oldest being Pentium III-era as in the link below), but even that one doesn't confirm that it's the oldest CPU capable of running DF. No-one seems to have asked what I'm asking.)

Exactly what the subject says. I've seen a 700 MHz Coppermine (Pentium III-era) Celeron with 180 MB of RAM running DF, so now I'm wondering, how low and old can you go, CPU-wise? Pentium II? Pentium MMX? OG Pentium? 486? What instruction sets are needed to run DF? This isn't a question of how well it will run, this is more about what will run DF, as badly as it would.

Since I want this question to have some meaning, I have to specify some rules: 47.04, any variant (32/64-bit, legacy/SDL), any OS, any amount of RAM (try to max out the RAM to rule out out-of-memory crashes), and screenshots of DF running on the system (title screen, worldgen, embark) are highly recommended. "Running" here means that it is able to do worldgen (any parameters, including advanced), and it's able to do an embark (any size, any bought items). For bonus points, record how long worldgen takes and the FPS after embarking.

Summary (based on using virtual machines; if possible, confirm with real hardware and post it here):

32-bit Windows DF requires SSE2, thus making the Willamette Pentium 4s (2000) the oldest CPUs capable of running Windows DF.
32-bit Linux DF requires SSE, making the Katmai Pentium IIIs (1999) the oldest CPUs capable of running Linux DF.
The oldest x86 Macs have Yonah Core Solos/Duos, which has SSE3. Assuming that Mac DF doesn't need SSSE3 or later (I don't see why this would be the case), this would make the Yonah Core Solos/Duos the oldest CPUs capable of running Mac DF. I would still like conformation with VMs or real hardware, just to make sure.
« Last Edit: October 05, 2020, 07:30:12 am by methylatedspirit »
Logged

Starver

  • Bay Watcher
    • View Profile
Re: What is the oldest CPU that can run DF?
« Reply #1 on: September 11, 2020, 09:16:28 am »

PTW.

(I know I used to run it on my P133 w95 machine, with 40Mb of RAM but a helluva lot of disk space, which I can dig up again from the bottom of the less used pile of old hardware. Whether sometime between that old build and the latest ones the code has become disqualified by various compiler changes, I don't know. May also have been via Wine on the Linux boot, too, which complicates matters significantly. Needs testing before I can stake this claim properly. Hell, the machine probably needs testing, as it's likely not been touched in ~decade. CMOS battery probably dead, at the very least.)
Logged

Maximum Spin

  • Bay Watcher
  • [OPPOSED_TO_LIFE] [GOES_TO_ELEVEN]
    • View Profile
Re: What is the oldest CPU that can run DF?
« Reply #2 on: September 11, 2020, 11:25:16 am »

I saw this before, but wasn't terribly confident in my answer. But since you asked again, I'll hazard the guess that I don't think any of the x86 extensions are directly implicated here (unless the game does more floating-point math than I would ever have programmed for the purpose), so, in theory, you should be able to run the 32bit version on an 8086.
Logged

Clément

  • Bay Watcher
    • View Profile
Re: What is the oldest CPU that can run DF?
« Reply #3 on: September 11, 2020, 01:47:32 pm »

the 32bit version on an 8086.
That would be the 80386.

But I've just check the 32 bits linux version, it contains SSE instructions, so the oldest would be the Pentium III. It could be different on Windows though. Checked on Windows too: the 32 bits SDL version contains SSE instructions too.
« Last Edit: September 11, 2020, 01:57:17 pm by Clément »
Logged

methylatedspirit

  • Bay Watcher
  • it/its
    • View Profile
Re: What is the oldest CPU that can run DF?
« Reply #4 on: September 11, 2020, 05:37:02 pm »

Ah, that's a shame. I was hoping that it's possible to go older than a Pentium III. Is legacy Windows any different, or is it the same story there? If so, what version added SSE instructions and broke compatibility with Pentium II and older CPUs?

the 32bit version on an 8086.
That would be the 80386.

I checked: the 386 can theoretically address up to 4 GB of RAM (though good luck finding that much for something that old). A 286 can only address 16 MB of memory. With that little, you'd run out of memory at the title screen, given that you'd need ~40 MB (32-bit, legacy Windows) for that.
Logged

Clément

  • Bay Watcher
    • View Profile
Re: What is the oldest CPU that can run DF?
« Reply #5 on: September 11, 2020, 07:44:05 pm »

The 286 is a 16 bits, it does not even support the base instruction set. You will need an emulator if you want to try that one.

And even the oldest version available contains a few SSE instructions, but I am not so sure it's actually instructions, it may be data interpreted as instructions.

Code: [Select]
  634d56:       0a 0b                   or     (%ebx),%cl
  634d58:       2d 2d 2d 2d 2d          sub    $0x2d2d2d2d,%eax
  634d5d:       2d 2d 2d 2d 2d          sub    $0x2d2d2d2d,%eax
  634d62:       2d 2d 2d 2d 2d          sub    $0x2d2d2d2d,%eax
  634d67:       2d 2d 0c 0d 0e          sub    $0xe0d0c2d,%eax
  634d6c:       0f 10 11                movups (%ecx),%xmm2
  634d6f:       12 13                   adc    (%ebx),%dl
  634d71:       2d 2d 2d 2d 2d          sub    $0x2d2d2d2d,%eax
  634d76:       2d 14 2d 15 16          sub    $0x16152d14,%eax
  634d7b:       17                      pop    %ss
  634d7c:       18 19                   sbb    %bl,(%ecx)
Looking at it more closely, it does not look like real instructions.

There are a lot more SSE instructions since the 64 bits port. Maybe 0.43.04 and older versions (when DF was built using MSVC 2010 instead of MSVC 2015) do not contains any real SSE instructions.
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: What is the oldest CPU that can run DF?
« Reply #6 on: September 12, 2020, 06:58:30 pm »

Code: [Select]
  634d56:       0a 0b                   or     (%ebx),%cl
  634d58:       2d 2d 2d 2d 2d          sub    $0x2d2d2d2d,%eax
  634d5d:       2d 2d 2d 2d 2d          sub    $0x2d2d2d2d,%eax
  634d62:       2d 2d 2d 2d 2d          sub    $0x2d2d2d2d,%eax
  634d67:       2d 2d 0c 0d 0e          sub    $0xe0d0c2d,%eax
  634d6c:       0f 10 11                movups (%ecx),%xmm2
  634d6f:       12 13                   adc    (%ebx),%dl
  634d71:       2d 2d 2d 2d 2d          sub    $0x2d2d2d2d,%eax
  634d76:       2d 14 2d 15 16          sub    $0x16152d14,%eax
  634d7b:       17                      pop    %ss
  634d7c:       18 19                   sbb    %bl,(%ecx)
Looking at it more closely, it does not look like real instructions.
Those are definitely not real instructions - I just ran that version (0.21.93.19a) through IDA 7.0 and it clearly identified that as part of a jump table:
Code: [Select]
.text:00630D7A                 mov     cl, ds:byte_634D40[eax]
.text:00630D80                 jmp     ds:off_634C88[ecx*4] ; switch jump
...
.text:00634C88 off_634C88      dd offset loc_630E79, offset loc_630E85, offset loc_630EC2
.text:00634C88                                         ; DATA XREF: sub_630900+480↑r
.text:00634C88                 dd offset loc_630FDD, offset loc_63103B, offset loc_63108C ; jump table for switch statement
.text:00634C88                 dd offset loc_6310A6, offset loc_630EDC, offset loc_630F04
...
.text:00634D40 byte_634D40     db      0,     1,     2,     3
.text:00634D40                                         ; DATA XREF: sub_630900+47A↑r
.text:00634D40                 db      4,     5,     6,   2Dh ; indirect table for switch statement
.text:00634D40                 db    2Dh,     7,     8,     9
.text:00634D40                 db    2Dh,   2Dh,   2Dh,   2Dh
.text:00634D40                 db    2Dh,   2Dh,   2Dh,   2Dh
...
Those old versions were compiled with Microsoft Visual C++ 6.0, so they should work on anything as old as a Pentium II (the last Intel CPU released before 1998).
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

methylatedspirit

  • Bay Watcher
  • it/its
    • View Profile
Re: What is the oldest CPU that can run DF?
« Reply #7 on: September 13, 2020, 02:14:20 am »

I've set up a Windows XP Professional SP3 VM in Bochs, which with I can change what CPU is being emulated. I'm not going to embark or anything, because any performance metrics from that are a product of the speed of the host computer, not the CPU being emulated. I'll be using a weaker criteria for "running": running the Object Testing Arena. To help identification and as a blatant "this is not real hardware" sign (look at the clock speeds), I've also put a CPU-Z window in the screenshots. The version being used is 47.04, Win32 SDL.





It's a foregone conclusion that anything older will not work. From this testing, it appears that SSE2 is a requirement for 47.04, not just SSE. This makes the Willamette Pentium 4s the oldest CPUs capable of running DF (at least for Windows), assuming the emulation is accurate. If anyone has real hardware and is willing to try and confirm these findings, please do.

(That website I linked back in the OP was for an older version, judging from the publication date. I cannot test the legacy Win32 version because it requires OpenGL, and Bochs doesn't seem to emulate an OpenGL device (or I haven't checked around hard enough). It throws an error instead, stating that DF "is not a valid Win32 application". It does work on the host system (Windows 10 x64), so I think Windows XP is being drunk.)
« Last Edit: September 13, 2020, 05:40:49 am by methylatedspirit »
Logged

Clément

  • Bay Watcher
    • View Profile
Re: What is the oldest CPU that can run DF?
« Reply #8 on: September 13, 2020, 05:29:31 am »

I checked SSE2 only on the linux version and there were none, so you should try this one if you want to use old hardware. As said earlier, my method (objdump + grep) gives false positives, but I think false negatives are less likely.

Or you could a version older than 0.43.05 on Windows.

This page says the default for the latest MSVC version is SSE2, but the page is not available for older versions like MSVC 2010.

For GCC, I am not sure. On my version of Fedora (which is not the same distribution that Toady uses for building DF), if I am using the correct command:
Code: [Select]
$ gcc -m32 -Q --help=target | grep march
  -march=                      i686
That would mean that GCC default target architecture for 32 bits is i686 a.k.a. Pentium Pro (MMX + CMOVcc instructions).
Logged

methylatedspirit

  • Bay Watcher
  • it/its
    • View Profile
Re: What is the oldest CPU that can run DF?
« Reply #9 on: September 16, 2020, 10:42:28 am »

I have spent days trying to get DF to work on Linux. Not because of DF being annoying, but because the virtual machine(s) I've been using are horrendously slow. Same stuff about a weaker definition of "run" (title screen and Object Testing Arena only) and not testing performance applies here. You'll have to take my word for the CPUs; I couldn't be bothered to get a CPU identification utility (something like CPU-Z), because this thing is unbearably slow. I've included a screenshot of the setup in Qemu Manager (yes, it's very out of date, but it's the only one that worked) for verification.

Spoiler: Pentium III (success) (click to show/hide)

Spoiler: Pentium II (failed) (click to show/hide)

In other words, 32-bit Linux DF requires SSE, but not SSE2. It would be pointless, but it's impossible to test anything older; Puppy Linux (this one is based on Ubuntu 19.04) will not boot on a Pentium due to lack of features, specifically PAE and CMOV. Qemu (the ancient version that I'm using, at least) doesn't have the option to emulate a Pentium Pro, so I can't do anything there.
« Last Edit: September 16, 2020, 10:47:47 am by methylatedspirit »
Logged