DosBox tips (Consejos y trucos para DosBox)

Software, versiones y novedades

DosBox tips (Consejos y trucos para DosBox)

Notapor tibono » 24 Ago 2015 21:00

Hi all,

I apologize not being able to write/speak Spanish. Feel free to answer in the forum language, internet translators are my friends to let me read you...

I suggest to share in this thread hints & tips built from experience applied to DOS chess oldies running with DosBox (latest version 0.74, mine running on Windows 7/64).
I start with: getting some chess programs to run without crashing...

I had a lot of pain with Battle Chess 4000: seemed to work fine except aborting some times when reaching some high depth plies; this being often reached at end of game with low material left on the board, or with long response time, or when ponder was on and the engine left thinking on.

With many tests I discovered it was linked to the parameter [cpu] core=dynamic I used for best performance.
From DosBox wiki : "The program instructions are, in blocks, translated to host processor instructions that execute directly. In the most cases this approach is more efficent than interpretation, except for programs that employ massive self-modifying code. This option is not present on all host platforms."

Setting [cpu] core=auto did solve the issue, I performed many tests for hours without getting any crash from Battle Chess 4000.

From now I keep on using core=dynamic as default parameter but, if I get any problem with a program, my best guess is to set it to core=auto and check again.

This is my list of DOS programs that get issues when using core=dynamic and run perfectly well when using core=auto:
battle chess 4000
chess genius 1
chessplayer 2150
Classic 5 chess
Necromancer chess

Hope this helps,
kind regards,
Última edición por berger el 24 Ago 2015 21:27, editado 1 vez en total
Razón: Ampliado título del hilo
Avatar de Usuario
Mensajes: 74
Registrado: 20 Ago 2015 22:07

Re: DosBox tips

Notapor eltaki » 24 Ago 2015 21:21

Hola Tibono, gracias por los comentarios.

En mi caso uso VirtualBox + FreeDos por un lado. Por otra parte uso un antiguo ASUS EEEPC 901 con FreeDos.

Mensajes: 666
Registrado: 28 Ene 2013 21:41

Re: DosBox tips (Consejos y trucos para DosBox)

Notapor berger » 24 Ago 2015 21:32

Hola Tibono,

Gracias por la recomendación sobre el uso del parámetro "[cpu] core". No soy usuario habitual de programas de ajedrez de DOS, pero seguro que muchos compañeros sí lo son. :#27:

Moderador del foro
Avatar de Usuario
Moderador del foro
Moderador del foro
Mensajes: 1175
Registrado: 12 Ene 2013 23:00
Ubicación: Barcelona (CATALUNYA)

Re: DosBox tips (Consejos y trucos para DosBox)

Notapor tibono » 25 Ago 2015 19:56

Setting the memory for hash ...

Basics are: oldest DOS programs do not make use of it; most recent ones manage the memory they need through usual ems/xms drivers (these are active by default in DosBox configuration). Thus you simply need to give the memory you want to your DosBox session (default is 32Mo and max is 64Mo).
The setting for max is: [dosbox] memsize=64
Of course you may need to select the target hash size you want, either through the program's interface (most simple) or by the use of a parameter you can edit in a batch file (such as the famous Rebel W1 to Rebel Wn, see Ed Schroeder's readme.txt in your rebel directory).

There is a more tricky situation with programs relying on their own to make use of the high memory addresses: they require the DOS memory drivers to be disabled.
The DosBox setting is:

Then you need to tell the program it can make use of this free-from-drivers memory with a parameter (batch file); the parameter syntax depends on each program and may (or not) include the target hash size.

These are the DOS programs I use requiring the disabled memory drivers, and the syntax:
Mephisto Genius 2 : MG2 /X
ChessGenius 3 : cg3dos /X
Fritz 1 : fritz /x16384
Fritz 2 & 2.51 : fritz2 /x16384
Fritz 3 : fritz3 /x16384
Hiarcs 3 : HIARCS -x
Hiarcs 6 : HIARCS6 -x

For other versions, you can try the same syntax with the consistent .exe name.
Hiarcs will take full advantage of 64Mo if you give them; the Chess Genius can use up to 32Mo (give more, 48 for instance); and it is no use giving Fritz more than the DosBox default 32 as it can use only 16Mo.

hope this helps,
Avatar de Usuario
Mensajes: 74
Registrado: 20 Ago 2015 22:07

Re: DosBox tips (Consejos y trucos para DosBox)

Notapor tibono » 26 Ago 2015 21:26

Tuning CPU throttle for high speed...

CPU throttling is obviously controled with [cpu] cycles=... statement.
Fixed cycling speed is the best way to roughly emulate low-speed PCs. But for chess programs adepts, getting the best performance can matter; so we may want to get close to the limit.

Cycles count refers to the emulated DOS-program's CPU instructions (per millisecond) performed by DosBox, but the time to perform each instruction is highly variable. Setting a given fixed cycling speed can let the host core a few percent loaded during some loops (such as thinking or pondering) and stuck it to 100% load with a different set of instructions in the loop (such as drawing a piece move and beeping or playing a sound).

The DosBox option offered to manage this issue is to set [cpu] cycles=max (this defaults to 100% target use of the core running the DosBox session).
One can think the story is over ... it is not. DosBox monitors the CPU load and manages the best speed as long as the DosBox session is active in Windows foreground (the focus is on the DosBox window). As soon as you move the focus to another window (or minimize the DosBox window), DosBox will switch back to fixed cycling speed without the speed control monitoring you expected. As the configuration setting (cycles=max) does not define any cycling speed, DosBox gets the current cycling speed at the moment the focus is lost, and fixes half this value. This is not documented (as far as I know) but quite easy to observe with the help of some benchmark tool.

In most cases, the DosBox half-speed is convenient to free CPU bandwidth for the newly focused window. In the context of playing a game between chess programs, such switchs will occur with each move turn. A small drawback is the pondering speed reduction. But there is a real issue faced more or less randomly: at the moment DosBox grasps the reference speed, the program may be in a very high speed loop and the resulting half-speed far too fast. The core CPU load is now 100% and the DosBox program interface suffers lags or hangs over for seconds before you can get its attention back.

The solution I use (and recommend) is to always set a limit: [cpu] cycles=max limit nnnnnn.
For best performance, nnnnnn should be twice the cycles your host CPU can provide. In the focused context, DosBox will manage the best speed (limit is not reachable, so "max" is the automatic limit); in the non-focused context the maximum fixed cycles is nnnnnn/2 = cycles your CPU can provide.

The last step is to evaluate nnnnnn. This is benchmarking, not an easy topic with DosBox. As we target chess computing speed, the most convenient tool is your preferred DOS chess program, assuming it can report the computed nodes (count or speed in nodes/s). Benchmark it with fixed cycles set at a low speed - low enough to be sure it is a piece of cake for your CPU. Setting high cycling speed can lead to incorrect benchmarked data, there is no magic in DosBox: if you raise the cycling speed above the host limit, you can get higher nodes count or nodes/s reported... but check the actual response time with a chronograph, the time has shifted!!
Once you get your low-fixed-cycles result, run your chess benchmark again with DosBox CPU cycling set to max (whitout limit). Apply the performance ratio to the known cycles used during the first run, this will give you the average cycling speed reached under "max" control. nnnnnn is twice this value.

Last hint: if you want to scale DosBox speed to emulate various PC hardwares, you can use fixed cycling whithout any risk up to roughly 1/3 of the max speed. For example, let us assume your host CPU can provide 150000 max DosBox cycles while computing a chess move. You need to emulate hardwares with speeds 5000, 50000, 100000 cycles/ms. You can use fixed speed with cycles=5000 and cycles=50000, then use cycles=max limit 100000 for the last one. The full DosBox speed (if you want it) should be set cycles=max limit 300000

kind regards,
Avatar de Usuario
Mensajes: 74
Registrado: 20 Ago 2015 22:07


¿Quién está conectado?

Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 1 invitado