1--------------------------------------------------------------------------------
2WHAT IS THIS?
3--------------------------------------------------------------------------------
4This is DGen/SDL, a semi-fantastic emulator for Unix-esque operating systems
5supported by the Simple DirectMedia Layer (SDL) library. It produces a virtual
6environment in which Sega Genesis (MegaDrive outside the US) games may run
7with fairly accurate audio and video.
8
9--------------------------------------------------------------------------------
10HOW DO I INSTALL IT?
11--------------------------------------------------------------------------------
12You'll need SDL version 1.0 or greater. Fetch it from
13http://www.libsdl.org/, and install it. Make sure, if you're
14using prepackaged rpm's or deb's, to get both the SDL and SDL-devel packages.
15
16For Intel/AMD/Cyrix CPUs, you'll also need NASM, which can be found at
17http://www.web-sites.co.uk/nasm/, in order to utilize the assembler
18optimizations. *WARNING*: The NASM that comes prepackaged with RedHat 7.x is
19broken! Install the rpm from RedHat 6.x, and it should work. One such rpm can
20be found at http://pknet.com/~joe/nasm-0.98-2.i386.rpm.
21
22Now you should be able to build and install DGen like any other
23autoconf-using package:
24
25  sh ./configure && make && make install
26
27If you have egcs or GCC >= 2.95, you can give configure the '--with-extra-opt'
28switch, which will add some insane optimization to the CFLAGS used to compile
29the program, giving the binary a very decent speed boost.
30
31The control configuration and other options available in DGen/SDL are set
32through a file dgenrc, which should be in the location $HOME/.dgen/dgenrc.
33The sample.dgenrc file in this archive documents all the fields, and so does the
34dgenrc(5) manpage. If it doesn't exist, an empty one will be created when
35dgen is run.
36
37Now that it's been installed, running 'dgen ROMFILE' should run the Genesis
38program contained in ROMFILE. For a list of all the fancy options supported,
39run either 'dgen' with no options, or see the dgen(1) manpage for more detail.
40
41--------------------------------------------------------------------------------
42IT'S TOO SLOW!
43--------------------------------------------------------------------------------
44Well, sorry. Here are some ideas to help accelerate it:
45
46 - Lower the value of "int_nice" in your dgenrc. 0 is good for short tempers :-)
47 - Turn off sound.
48 - Run fullscreen, if possible.
49 - Increase int_soundsegs to 16 or (if you're desperate) 32.
50 - Buy a faster computer. (sorry, had to say it ;)
51
52--------------------------------------------------------------------------------
53IT'S TOO FAST!
54--------------------------------------------------------------------------------
55I couldn't believe it either, but someone asked me this. If you happen to find
56yourself in this unfortunate predicament, here's how to slow it down:
57
58 - Raise the sound rate to 44100Hz. It sounds a LOT better, and is a LOT slower.
59 - Increase the value of int_nice in your dgenrc. This is the best way to slow
60   things down, since it makes dgen much more CPU friendly.
61 - In the game, press the key set to 'dgen_cpu_toggle' (which defaults to F11),
62   to use the Musashi CPU core, which is slower and more accurate than
63   StarScream.
64
65--------------------------------------------------------------------------------
66FREQUENTLY ASKED QUESTIONS
67--------------------------------------------------------------------------------
68Q: DGen segfaults on startup!
69A: The two most common causes of this are a broken NASM, or an absent NASM.
70   RedHat 7.x distributions ship with a prepackaged NASM which doesn't work.
71   You'll need to use an RPM from a different distribution, or RedHat 6.x.
72
73Q: How do I set up OpenGL mode?
74A: OpenGL mode can be activated either from the commandline, or from the dgenrc
75   file. Using the '-G XxY' switch will activate OpenGL mode. The switch takes
76   the desired resolution as an argument. For example:
77	$ dgen -G 640x480 sonic.bin
78   will run with a 640x480 screen resolution.
79
80   So that you do not have to type this switch every time you use dgen, you
81   can add the following lines to ~/.dgen/dgenrc so that dgen will start in
82   OpenGL mode every time:
83   	bool_opengl = yes
84	int_opengl_width = 640
85	int_opengl_height = 480
86   int_opengl_width and int_opengl_height can be changed to suit your own
87   preferences.
88
89Q: I make dgen setuid-root, and try to run it fullscreen, and all I get is
90   a black screen with the game running in the middle of it.
91A: You need to have your X server set up with a 320x240 video mode. For XFree86,
92   if you have XF86Setup installed (which is more than likely):
93   - Close all X sessions you have running.
94   - From a console, as root, run "XF86Setup". When asked "Would you like to use
95     the existing XF86Config file for defaults?" say Yes.
96   - After 30 seconds or so the X server should start in VGA mode, and put you
97     in the setup program. Everything else is set up, just click on the
98     "Modeselection" button in the top right-hand corner.
99   - From the list of possible modes, choose 1024x768 (or whatever mode you use
100     regularly), and 320x240 (which is the mode DGen wants). Choose a bits-per-
101     pixel from the list on the bottom (DGen works best in 15- or 16-bpp).
102   - Press "Done", then "Okay".
103   - It should restart the X server. When you see the message
104     "Congratulations!...", try pressing CTRL-ALT-KEYPAD+ to switch to your new
105     320x240 mode, just to make sure it works. Press CTRL-ALT-KEYPAD- to switch
106     back, and press "Save the configuration and exit".
107   - Restart your X session. If you use xdm, press CTRL-ALT-BACKSPACE to kill
108     the X server and restart it. Fullscreen should work now.
109
110Q: DGen's colors are messed up!
111A: Some video cards, such as most Riva cards, use different pixel formats
112   for true-color modes. If you use 16-bpp bit depth, try 15- or 32-bpp bit
113   depth.
114
115Q: I try compiling, but when I run ./configure, it tells me it can't find
116   sdl-config. I installed SDL from the rpm's.
117A: You need to install the SDL-devel rpm as well:
118   http://www.devolution.com/~slouken/SDL/release/SDL-devel-<version>-1.i386.rpm
119
120Q: Sonic 2 freezes right before the title screen!
121A: There is a bug in the StarScream CPU core which causes Sonic 2 to freeze
122   at this point. Press F11 to switch to the Musashi core, until you get to
123   the title sequence, then press it again to switch back to StarScream. Save
124   a snapshot here, so you don't have to go through it again. :)
125
126--------------------------------------------------------------------------------
127BUGS
128--------------------------------------------------------------------------------
129Of course the chances of finding a bug are unlikely, but if you do, tell me
130about it. Send me a patch too, if possible :-) Also, check the FAQ above before
131reporting bugs, to see if your question's already been answered.
132
133Enjoy DGen!
134