Skip to content

Commit 34dfa9c

Browse files
Something to study
1 parent 19ca5c1 commit 34dfa9c

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

optimization-1/DosBox.txt

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
* DosBox 0.74
2+
3+
I applied the patches that I developped for previous DosBox versions.
4+
Then I tried to get more performance and it was hard. Currently, the normal
5+
core seems to run 10 or 12 % faster that the original code.
6+
The consuming part is the decoding of x86 instructions. I thought a small gain
7+
will have a big effect but sometimes logical improvements caused regressions.
8+
9+
The archive contains the diff of the changes I made.
10+
11+
Please use the provided file "dosbox.conf" that works. Else, a default file
12+
will be created but you will have to change the usescancodes value, setting it
13+
to false instead of true (what leads to problems typing characters).
14+
15+
Thanks to David Braconnier for the icons !
16+
17+
Unsupported features :
18+
- only use the normal core (that is the default one)
19+
- launch editor and launch captures (that require execlp)
20+
21+
22+
* How to use DosBox
23+
24+
The config file "dosbox.conf" is the place you will try some parameters
25+
to make it running well on your Amiga.
26+
27+
If you want to avoid entering the mount command each time you run DosBox,
28+
just have a look at the last lines of the file "dosbox.conf" and add the
29+
commands you want to run at startup.
30+
31+
32+
* What I changed in the sources
33+
34+
The core of the emulator is version hard to optimize and to read. It is very
35+
difficult to change some things in that part due to the mess of the x86
36+
instruction set and some stange coding rules (C++ code that is not always
37+
object oriented, many macros and inline functions, ...). So I used the
38+
wonderful tool Zoom (look at http://www.rotateright.com) on my MacMini running
39+
Linux to find the other parts that could be optimized.
40+
41+
So the changes I applied are :
42+
- src/cpu/core_normal.cpp : Activated C_CORE_INLINE, what increases the required
43+
memory to compile, it only worked with 512 MB and the OS 4.1 paging system !
44+
- include/paging.h : Used instructions to read half-words and words with
45+
reversed bytes (PPC rulez !). Also changed a structure reorganizing TLB fields
46+
in order to decrease the pressure on the cache.
47+
- include/paging.h (again !) : Tried to improve the memory access through TLB.
48+
- src/cpu/modrm.cpp and other files : I reduced the size of arrays to decrease
49+
the pressure on the cache.
50+
- include/render.h : Grouped some structure fields to improve alignment and
51+
cache efficiency.
52+
53+
The archive contains a diff compared to the original sources (thanks to svn).
54+
Use the diff file to patch the original sources if you want to build DosBox
55+
yourself.
56+
57+
Then, under sh :
58+
CFLAGS="-O2" CXXFLAGS="-O2" ./configure --disable-dynamic-core --disable-opengl
59+
--disable-dynrec --disable-dependency-tracking
60+
61+
And then :
62+
- make
63+
- Run "src/dosbox"
64+
65+
66+
* Ideas for the future / to do
67+
68+
- Improve access to the x86 registers
69+
- Activate OpenGL
70+
- Check CDROM access
71+
- Compare options -O2 and -O3
72+
- Profile DosBox on Linux PPC (cache issues)
73+
- Fix install of Win 3.1
74+
- Fix color problems (x-ray, hugi)
75+
- Fix MIDI : does not work even setting it in dosbox.conf with a directory
76+
that contains instruments
77+
- Fix FullScreen that send a 59 Hz signal and some screens does not go below 60
78+
- Check usage of gamepads

optimization-1/dosbox.lha

1020 KB
Binary file not shown.

0 commit comments

Comments
 (0)