Dosbox-x: Add menu options to select a CPU model, e.g. 486DX-33, Pentium 60, 75, etc

Created on 13 Sep 2020  Â·  62Comments  Â·  Source: joncampbell123/dosbox-x

Describe the solution you'd like
If possible, please add a menu to select a CPU model (to simulate a specific speed) in DOSBox-X. I'll like this.

Describe alternatives you've considered
This should give DOSBox-X better options.

Additional context
The menu should contain separate CPU types, which should be like this:

8086 - 7/8/9/10/12/16Mhz
8088 - 4/7/8/10/12/16Mhz
80286 - 6/8/10/12/16/20/25Mhz
80386 - SX/DX 16/20/25/33/40Mhz
80486 - SX/DX 16/20/25/33/40/50/66Mhz
Pentium - 60/75/90/100/120/133/150/166/200Mhz
Pentium MMX - 166/200/233Mhz

enhancement suggestion CPU

Most helpful comment

Emulating a specific speed CPU is not straight forward. DOSBox, and
DOSBox-X by extension is NOT cycle accurate.

DOSBox will run one x86 instruction per-cycle, so if you set 1000 cycles,
it will run 1000 instructions per second. But actual legacy CPUs, depending
on the instruction, and the CPU model, may take several cycles to execute a
instruction.

The best you can do, is to try to approximate it. Especially programs using
x87 (floating point unit) are affected by this.

Have a look at the dosbox wiki for more information:
https://www.dosbox.com/wiki/Performance

On Sun, Sep 13, 2020 at 7:06 PM DSN notifications@github.com wrote:

@Wengier https://github.com/Wengier I asked you if you can add options
to select a specific CPU speed, like PCem have.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/joncampbell123/dosbox-x/issues/1854#issuecomment-691697213,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AEHBR2UJQUXYQ473BCTYKLDSFT3X5ANCNFSM4RKXPI6A
.

All 62 comments

@DSN9990 In the current "CPU" menu, select "CPU type", and you will find a list of CPU options from 8086 to Pentium Pro. Please let me know if it is still missing something.

@Wengier I asked you if you can add options to select a specific CPU speed, like PCem (and 86Box) have.

Emulating a specific speed CPU is not straight forward. DOSBox, and
DOSBox-X by extension is NOT cycle accurate.

DOSBox will run one x86 instruction per-cycle, so if you set 1000 cycles,
it will run 1000 instructions per second. But actual legacy CPUs, depending
on the instruction, and the CPU model, may take several cycles to execute a
instruction.

The best you can do, is to try to approximate it. Especially programs using
x87 (floating point unit) are affected by this.

Have a look at the dosbox wiki for more information:
https://www.dosbox.com/wiki/Performance

On Sun, Sep 13, 2020 at 7:06 PM DSN notifications@github.com wrote:

@Wengier https://github.com/Wengier I asked you if you can add options
to select a specific CPU speed, like PCem have.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/joncampbell123/dosbox-x/issues/1854#issuecomment-691697213,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AEHBR2UJQUXYQ473BCTYKLDSFT3X5ANCNFSM4RKXPI6A
.

FWIW in D-Fend Reloaded:

2020-09-13_23-23-06

core/cycles:

  • normal/auto
  • dynamic/45000
  • auto/500
  • auto/10000
  • auto/3000

IMO it could be nice to have a few presets that approximates families of CPUs.

I made approximate cycles values by analogy with the Norton Utilities System Information and NSSI (Navrаtil Software System Information) performance index:

8088 XT 4.77MHz (cycles=240, core=auto, cputype=auto). The value was chosen as accurately as possible, according to the sound of the music in the game Arkanoid on a real machine 8088 XT 4.77MHz: https://youtu.be/_7mouV05qy0
sysinfo_XT_Mono (240)

286-8MHz (cycles=750, core=auto, cputype=auto)
sysinfo_286-8 (750)

286-12MHz (cycles=1510, core=auto, cputype=auto)
sysinfo_286-12 (1510)

286-25MHz (cycles=3300, core=auto, cputype=auto)
sysinfo_286-25 (3300)

386DX-25MHz (cycles=4595, core=auto, cputype=auto)
sysinfo_386DX-25 (4595)

386DX-33MHz (cycles=6075, core=auto, cputype=auto)
sysinfo_386DX-33 (6075)

486DX-33MHz (cycles=12010, core=auto, cputype=auto)
sysinfo_486DX-33 (12010)

486DX2-66MHz (cycles=23880, core=auto, cputype=auto)
sysinfo_486DX2-66 (23880)

486DX4-100MHz (cycles=33445, core=auto, cputype=auto)
sysinfo_486DX4-100 (33445)

486DX5-133MHz (cycles=47810, core=auto, cputype=auto)
sysinfo_486DX5-133 (47810)
nssi_486DX5-133 (47810)

Pentium-60MHz (cycles=31545, core=auto, cputype=pentium_mmx)
sysinfo_Pentium-60 (31545)
nssi_Pentium-60 (31545)

Pentium-66MHz (cycles=35620, core=auto, cputype=pentium_mmx)
sysinfo_Pentium-66 (35620)
nssi_Pentium-66 (35620)

Pentium-75MHz (cycles=43500, core=auto, cputype=pentium_mmx)
sysinfo_Pentium-75 (43500)
nssi_Pentium-75 (43500)

Pentium-90MHz (cycles=52000, core=auto, cputype=pentium_mmx)
sysinfo_Pentium-90 (52000)
nssi_Pentium-90 (52000)

Pentium-100MHz (cycles=60000, core=auto, cputype=pentium_mmx)
sysinfo_Pentium-100 (60000)
nssi_Pentium-100 (60000)

Pentium-120MHz (cycles=74000, core=auto, cputype=pentium_mmx)
sysinfo_Pentium-120 (74000)
nssi_Pentium-120 (74000)

Pentium-133MHz (cycles=80000, core=auto, cputype=pentium_mmx)
sysinfo_Pentium-133 (80000)
nssi_Pentium-133 (80000)

Pentium MMX-166MHz (cycles=97240, core=auto, cputype=pentium_mmx)
sysinfo_Pentium MMX-166 (97240)
nssi_Pentium MMX-166 (97240)

AMD-K6-2-400 (cycles=max, core=dynamic, cputype=pentium_mmx)
sysinfo_AMD-K6-2-400 (Dynamic Max)
nssi_AMD-K6-2-400 (Dynamic Max)

@maximus105 amazing, you just need to add the core you've used and it'll be perfect !

I added to the description the core and cputype.

I added to the description the core and cputype.

Can you explain how you measured the cycles? Trial and error?

@brunocastello Yes.

@maximus105 Great work! I will try to add menu options based on the data you provided. Please check if there are errors in the data before it is added. If you (or anyone else) want to add more to the list it is very welcomed of course.

8088 XT 4.77MHz: cycles=240

286-8MHz: cycles=750

286-12MHz: cycles=1510

386DX-33MHz: cycles=6075

486DX-33MHz: cycles=12010

486DX2-66MHz: cycles=23880

Pentium-66MHz: cycles=35618

Pentium-100MHz: cycles=60000

Given that MMX apparently doesn't work well (at least for me), how about adding the popular Pentium 133MHz? I'm sure I had that model straight after the 486DX2 decades ago.

@Wengier Thanks.

I have already added "Emulate CPU speed" menu group (under "CPU") to emulate the speed of these CPU classes in the latest code. Thanks for the data provided by @maximus105. If @maximus105 (or anyone else) wants to add more CPU classes to the list, please free feel to do so.

I thought that the emulated CPU speed largely depends of how powerful your host computer is?

I performed the selection of cycles on the i9-9900K processor. I added cycles for Pentium-120 MHz, Pentium-133 MHz, Pentium MMX-166 MHz to the description. A further increase in cycles (above the value of 97240) does not lead to an increase in performance, but even to a slowdown in programs (Volkov Commander), and hangs of Norton Utilities System Information and NSSI (Navrаtil Software System Information). I also added cycles for the highest possible performance to the description (if you set cycles = max), roughly corresponding to AMD-K6-2-400 (cycles = max, core = dynamic, cputype = pentium_mmx).

I have already added the emulation options for Pentium-120 MHz, 133 MHz, and 166 MHz in the latest code (thanks to @maximus105). The emulated cycles provided should be considered accurate overall, as I have checked with NSSI on my own computer and found that the speeds largely match here too (maybe around 5% difference sometimes). Since minor adjustments may be desired in some cases, I have added a new config option "cycle emulation percentage adjust" in [cpu] section for users who wish to make relative percentage adjustments (between -25% and 25%) of the emulated CPU cycles.

Could you give me a updated build?

Sure! Here it is the updated Windows binary package:

dosbox-x-update.zip

Note: FluidSynth support is fully enabled in this build. The sound font GeneralUser_GS.sf2 is bundled and enabled by default. Furthermore, the DOSMID program now appears on the Z drive to play MIDI audios.

Can you give me a link to NSSI?

I checked the DOSBox-X 0.83.6 build posted above here. With my mapper configured in cga_mono or svga_s3 mode, when starting DOSBox-X, the image gets corrupted:
Config.zip

command_002

command_003

In addition, the Volkov Commander file manager is launched in my .conf file, and if I do "Reset Virtual Machine" or "Reboot Guest System", an error window will appear and DOSBox-X will close:

2020-09-20_135916

In addition, if you do "Reset Virtual Machine", then an error window appears randomly and DOSBox-X will close:

2020-09-20_140256

In addition, cycles values ​​over 60000 slow down overall performance. Programs start to slow down noticeably. The previous build DOSBox-X 0.83.5 did not have the above problems.

@maximus105 Please check out the following Windows binary:

dosbox-x-update.zip

The banner image issue only happened with your modified key setting (not default configuration), which was fixed. Also, the issue with rebooting the system only occurred with the setting "keyb ru" as we discussed in Issue #1732. It seems that the fix mentioned thare did not work when the Volkov Commander file manager is currently running (and with "keyb ru" applied), so I have modified the fix in the updated build.

However, I am not able to notice that cycles values ​​over 60000 slow down overall performance. For example, when I select Pentium 120/133/166 CPUs (all >60000 cycles) to emulate, the benchmarks do increase as expected.

You may run into issues, if your host system is not able to sustain the number of cycles chosen. Remember that DOSBox is for the most part single-threaded, so CPU clock rating is more important than core count.

@Wengier In the new build, the above issues are gone, apart from the performance drop over cycles > 60000. This is especially noticeable with cycles = 97240. The performance indices themselves, in the form of numbers or bars, have not changed. A performance has decreased in the form:

  1. In Volkov Commander, the cursor in the panels began to move up/down noticeably slower.
  2. In Norton Utilities System Information, windows maximize noticeably more slowly.
  3. In NSSI, windows unfold noticeably slower and PC Speaker stutters several times at startup.

Maybe this is due to the fact that I tested DOSBox-X 0.83.5 Win x64 SDL1, and the new DOSBox-X build 0.83.6 Win x32 SDL1?
Can you make the new build as Win x64 SDL1 ?

@maximus105 I think the DOSBox-X 0.83.5 build you tested was MinGW x64 SDL1 build. Why not try the Visual Studio x86 SDL1 build and see how it works (compared to DOSBox-X 0.83.6 Visual Studio x86 SDL1 build). All 0.83.5 Windows builds are included in the Windows installer (available from http://dosbox-x.com).

@Wengier I tested DOSBox-X 0.83.5 Visual Studio x86 SDL1 and DOSBox-X 0.83.5 Visual Studio x64 SDL1. Yes, they both slow down at cycles = 97240. It turns out that I would rather use MinGW x64 SDL1, since it does not slow down ?

@Wengier Please correct the cycles value for Pentium 66 MHz to 35620. I have found a more accurate cycle value.

@maximus105 Done in the latest code.

@Wengier Yes, and don't forget to correct the description in the menu "(~ 35618 cycles)" to "(~ 35620 cycles)". Can you make the new build as MinGW Win x64 SDL1 ?

@maximus105 The description has been updated accordingly. A MinGW 64-bit SDL1 Windows binary I built is available from:

Download link: dosbox-x-mingw64.zip

Can you update the file dosbox-x-update.zip to MinGW 32Bit SDL1?

@DSN9990 You want the Visual Studio build or the MinGW build?

@DSN9990 If you want the Visual Studio build, the dosbox-x-update.zip file is already updated.

MinGW.

@DSN9990 Use the dosbox-x-mingw64.zip file for the MinGW build (and dosbox-x-update.zip for the Visual Studio build). Both files will be maintained from now on and updated sometimes (regularly or on request).

@Wengier I want the MinGW 32bit build.

@DSN9990 I don’t have 32-bit MinGW so I cannot build MinGW 32-bit binary myself. Wait for the next official release if you want that.

@Wengier The VisualStudio build is 32Bit? I want that.

@DSN9990 Visual Studio 2019 can build both 32-bit and 64-bit binaries easily from a single solution, which is not the case for MinGW 64-bit. I think I tried 32-bit MinGW a few months ago but it did not work for some reason, so I uninstalled it and never tried it again.

@Wengier Can you give me the 64Bit VisualStudio build?

@DSN9990 I will do that tomorrow (I had already left my main computer).

@Wengier Thanks. I'll wait.

In the new MinGW x64 SDL1 build, the aspect = true option does not work with fullscreen = true. And there is no direct3d in the output option. Or is it the way it should be? And where can I get the "glshaders" folder?

@DSN9990 A 64-bit Visual Studio SDL1 build is available from:

dosbox-x-64-update.zip

@maximus105 The MinGW build was built by me just for testing, and it does not come with things like Direct3D support. As for glshaders, at this time you can get them from:

https://github.com/tyrells/dosbox-svn-shaders

@maximus105 You can now find GLSL shaders in the contrib/glshaders directory of this source tree:

https://github.com/joncampbell123/dosbox-x/tree/master/contrib/glshaders

The Windows installer will copy them to the glshaders subdirectory of the DOSBox-X install directory as well.

@Wengier Can you add options for Pentium 60, 75 and 90mhz?

@DSN9990 Yes if you (or anyone else) can provide the data for them.

Just a comment. Don't you think that when people select a CPU this way,
that they also expect the emulated CPU to be set to match?

The problem with that obviously is that it will require a reset of the
emulation.

On Fri, Sep 25, 2020 at 10:34 PM Wengier notifications@github.com wrote:

@DSN9990 https://github.com/DSN9990 Yes if you (or anyone else) can
provide the data for them.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/joncampbell123/dosbox-x/issues/1854#issuecomment-699142086,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AEHBR2SC2NGE3PBHPKTEQL3SHT5FTANCNFSM4RKXPI6A
.

@rderooy Yes, I had thought of that too, but requiring a reset the emulation will be a big impact. So the menu is named "emulate CPU speed" and placed in the cycles subsection to make it clearer that it is just for emulating the speed in terms of CPU cycles, not something like "select CPU subtype" near "CPU type".

@maximus105 Can you provide data for Pentium 60Mhz (not 66Mhz), Pentium 75Mhz and Pentium 90Mhz?

There is certainly a positive response to this feature!
Firefox_Screenshot_2020-10-04T05-01-28 579Z

@joncampbell123 I am certainly very happy to hear that. You have definitely done great work in maintaining the project and I hope more people will like it.

@maximus105 You had made very helpful efforts to provide the data for the CPUs. Please feel free to add more so that users can benefit more from this feature.

I added cycles for 486DX4-100, 486DX5-133, Pentium-75, Pentium-90 to the description. Please correct my nickname in the changelog (In the word "maximum", you need to correct the last letter "m" for "s").

@maximus105 Thanks for adding the cycles for these CPU types to the description. I have already added them to the latest code (https://github.com/joncampbell123/dosbox-x/commit/7b4aa110b071a4523935f36ced56aca2e70eca6a). Also sorry for the typo of your nickname, and I think I have already corrected it in CHANGELOG.

@maximus105 I have corrected your nickname in the Releases page also. If you have data for other CPU models, please feel free to add them as well. Thanks!

@Wengier I added cycles for 286-25, 386DX-25, Pentium-60 to the description. Can you add a hotkey to the menu for "Edit cycles"?

1

@maximus105 Thanks! I have already added them to the latest code (https://github.com/joncampbell123/dosbox-x/commit/807221bf6efe1e2345d15a31ec5aaeafe8bd2e3b).

Meanwhile, the "Edit cycles" function is already in the mapper editor, named "EditCycles". You can certainly add a hotkey for it yourself.

@Wengier Is it possible to make the "Show details" option persist (on or off) after closing and then starting DOSBox-X ?

1

@maximus105 The "show details" menu option is equivalent to the -showcycles and -showrt command-line options combined. So you can just run DOSBox-X with these command-line options.

@Wengier Thanks!

Was this page helpful?
0 / 5 - 0 ratings