VOGONS


First post, by RobinSword

User metadata
Rank Newbie
Rank
Newbie

Hi there!

I wonder if it is possible to tell DOSBox to behave like a specific system.
For example, I want DOSBox to simulate my old 8086 with 8 MHz and Hercules graphics.
I can adapt the config file so that DOSBox emulates Hercules graphics and the speaker sound but what about the performance?
Is it possible to tell DOSBox to emulate exactly an 8086 @ 8 MHz? Or let's say a 386DX @ 33 MHz?

When I start DOXBox, I don't know how fast it actually is and what it's capable of.
Is it a 286, a 386, a 486 or even a Pentium?
Of course I can increase/decrease the performance with Ctrl+F11/F12,
but I never know how fast it really is.

Reply 1 of 7, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

that is not possible with dosbox.
adding that functionality would slow dosbox down

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

Reply 2 of 7, by RobinSword

User metadata
Rank Newbie
Rank
Newbie

Ok, thanks for the answer!

But is it possible to say how fast DOSBox runs in standard configuration (e.g. "it's simiar to a 486DX2 66MHz)?
Or does this also depend on the machine, DOSBox runs on?

Reply 3 of 7, by Kippesoep

User metadata
Rank Oldbie
Rank
Oldbie

The full truth is a little more complicated, but let's explain it like this:

Some instructions are more complex than others and take longer to execute on the CPU. A division instruction will take more time to do than comparing 2 numbers, for instance. This changes with each CPU (a 8086 took about 140 cycles to multiply two 16 bit numbers, a 486 did the same in about 20 cycles, a Core2Duo does it in 1 -- now remember that the 8086 ran at 4.77MHz and the average C2D runs at well over 2000MHz, we're talking roughly a 6,000,000% speedup here! -- and all that's before taking into account that some instructions can "pair" and execute at the same time even without a multi-core CPU, so an instruction may take 3 cycles on a 486 in one case yet 0.5 cycles in another case [yes, that's half a cycle]).

On DOSBox' virtual CPU, all instructions take 1 simulated cycle (although of course it can [and does] take longer to execute on the host CPU). It would be possible to simulate the "proper" cycle timing for each CPU type, but it's a tremendous undertaking that would require enormous amounts of bookkeeping and thus indeed slow DOSBox down.

What you can do, however, is see how many instructions a 4.77MHz 8086 could execute on average in a millisecond. Not just how many multiplications it can do in a millisecond, but more realistic scenarios where different kinds of instructions are used. The number you get should be your cycles count for DOSBox. So, that XT machine running at 4.77MHz has 4770000 cycles per second, that's 4770 per millisecond. By my guestimate, instructions take (on average) some 10 cycles to execute. That would mean my guess for getting DOSBox to run at a speed resembling that of an XT is a cycles setting of 477. And indeed, for pretty much all the games I run where I need XT speeds, 500 seems to be a very good value.

To get your 12 MHz 286, that's 12000 cycles per millisecond, instructions might execute in 8 cycles on average, so try 1500 for a rough ballpark figure. A 33 MHz 386? 33000 cycles per millisecond, 5 cycle average, try 7000. Those are just guesses, but start working from such values.

My site: Ramblings on mostly tech stuff.

Reply 4 of 7, by gulikoza

User metadata
Rank Oldbie
Rank
Oldbie

Perhaps someone more knowledgeable could figure out rough averages of CPI values for different platforms and dosbox would include that 😁 Set 386@33 Mhz? No problem, lookup CPI for 386 and set the cycle count at 33*1000/CPI

http://www.si-gamer.net/gulikoza

Reply 5 of 7, by RobinSword

User metadata
Rank Newbie
Rank
Newbie

Kippesoep: Thanks for your detailed answer!!
Now I have a better understanding of the materia.

You are right - 500 cycles is a good value to simulate my old 8086 (who's HDD stopped working recently 🙁).
I currently play "Castle Adventure" (an ASCII adventure I played in my youth) and judging from how fast the scenes are drawn and the ASCII-player-character is moving at 500 cycles, that really seems to resemble my 8086!

Reply 6 of 7, by Kippesoep

User metadata
Rank Oldbie
Rank
Oldbie
gulikoza wrote:

Perhaps someone more knowledgeable could figure out rough averages of CPI values for different platforms and dosbox would include that 😁 Set 386@33 Mhz? No problem, lookup CPI for 386 and set the cycle count at 33*1000/CPI

Such a thing exists, in a way: http://en.wikipedia.org/wiki/Million_instruct … ions_per_second

It'd be easy to convert that into the format you specify. In fact, I think I'll contribute such a thing to the Wiki when I get home 😁