7 Welcome to gnuboy, one of the few pieces of Free Software to emulate
8 the Game Boy handheld game console. Written in ANSI C with a few
9 optional assembler optimizations for particular cpus, gnuboy supports
10 a wide range of host systems, and has been tested successfully on:
16 Linux/390 (IBM S/390 Mainframe)
26 Additionally, gnuboy should run on any other *nix variants that have
27 ANSI C compilers and that are remotely POSIX compliant. As gnuboy is
28 Free Software, you're welcome to fix any problems you encounter
29 building it for a particular system, or to port it to entirely new
32 For build instructions, see the file INSTALL. For information on the
33 structure of the source tree, program flow, design decisions and
34 guidelines, porting, and so on, read HACKING.
39 Just pass the name of the rom to load on the command line. Default
40 keybindings are as follows:
48 0-9 - select savestate slot
49 ins - save current state
50 del - return to saved state
58 (Note: joystick is not available on all platforms at this time.)
60 If you want to change these or other options, you should create a
61 gnuboy.rc file. See the system-specific info below for where to put
64 The rc subsystem is very similar to Quake's console in many
65 respects. You have commands and variables. First, the commands:
67 quit - exit gnuboy (saving sram)
68 reset - reset to powerup state
69 source - process another rc file
70 set - set a variable's value
72 unbind - remove a keybinding
73 unbindall - remove all keybindings
74 savestate - save current state
75 loadstate - return to saved state
77 Additionally, each gameboy pad button has two commands, one to press
78 it, and another to release it -- for example, +start and -start. When
79 a key is bound to one of these commands that starts with a +, it will
80 perform the corresponding - command when it's released, as expected.
82 Here's a list of the + commands, though they should be obvious:
84 +start +select +a +b +up +down +left +right
86 Now for the variables. To set any of the rc variables, just put the
87 command of the form "set variable value" in your gnuboy.rc or other rc
88 file. Some of the more interesting variables are:
90 rcpath - search path for loading extra rc files
91 savedir - the directory where save files will be stored
92 savename - base of filename to use for sram and savestates
93 forcedmg - set to 1/true/yes to force color roms to play mono
94 framelen - delay in microseconds between frames
95 framecount - run only the given number of frames, then exit
97 dmg_bgp - specify 4 custom colors to be used for mono background
98 dmg_wndp - same thing, but for the window layer
99 dmg_obp0 - and for sprite palette 0
100 dmg_obp1 - and sprite palette 1
102 scale - factor for screen scaling; currently only 1 and 2 work
103 density - density level for screen scaling; see description below
105 sprsort - x-sort sprites for correctness on dmg roms
107 syncrtc - fake elapsed time on rtc since last session at startup
109 trace - output a complete cpu trace to stdout
110 sprdebug - display bars indicating sprite count per line
112 There are a few others which may or not be useful. Also, certain
113 system and display targets have their own variables, which will be
114 described in the relevant sections below. For more info on how the
115 variables work, read the source.
117 For sample rc files, look in the etc/ directory.
119 Finally, to display help, version, or copying information, use the
120 --help, --version, or --copying options respectively on the gnuboy
126 The file gnuboy.rc should be placed in ~/.gnuboy/. If it is not found
127 in this location, the current working directory will be
128 searched. The following defaults will be used:
131 savedir - ~/.gnuboy/saves
133 If you don't like these, override them with gnuboy.rc.
135 There are presently four *nix targets supported: X11, SDL, and Linux
136 fbcon and svgalib. In the future other fb devices (such as the Sun
137 console) should be supported as well.
139 If you have problems with gnuboy running too slowly on svgalib, turn
140 off the vsync option, i.e. set vsync 0. Putting --no-vsync on the
141 command line works as well. At this point svgalib is the only one that
142 supports vsync, so it's a non-issue on the others.
145 USAGE - DOS and Windows
147 Place your gnuboy.rc in the same directory as gnuboy.exe. You need to
148 specify a save directory in it; otherwise the working directory will
149 be used, which is probably not what you want. For example, if you've
150 installed gnuboy.exe in c:/gnuboy, and you want your saves to be
151 stored in c:/gnuboy/saves, place the following in a plain text file
152 called gnuboy.rc in c:/gnuboy.
154 set savedir c:/gnuboy/saves
156 By default stereo sound is disabled on DOS since it doesn't work right
157 on some of the systems we've tested; to enable it, add the following
158 line to your gnuboy.rc:
165 Now all the display targets except Linux fbcon support the uniform
166 "vmode" rcvar to set the video mode. From the rc file, you can specify
167 a video mode like this (for 640x480, 16bpp):
171 Or you can specify the mode on the command line, as
175 If the requested video mode is not available, gnuboy may either give
176 an error message or use a similar available mode.
181 Scaling by integral factors 1-4 is now supported. Just set the rcvar
182 "scale" to the desired scaling factor. Most of the display targets
183 will automatically choose a video mode appropriate to the chosen
184 scale, but DOS and Linux fbcon users should be aware they they need to
185 set the mode manually, as described above. Of course, if you prefer,
186 you can always set it manually.
188 By default, for performance reasons, vertical scaling will not be
189 fully dense but will leave some blank scanlines. This behavior can be
190 adjusted by means of the "density" rcvar. Density 0, the default,
191 skips every other line. Nonzero values N fill in the first N copies of
192 the scanline, and leave the remaining scale-N scanlines blank. So, if
193 you want a fully filled in display (and the worst performance), you
194 should set density to the same value as scale.
196 Please be aware that this code is still slightly experimental, and the
197 ways of configuring scaling may change considerably in the next few
201 HARDWARE ACCELERATED YUV-SPACE SCREEN SCALING
203 If you're using the SDL display target and your video card/driver
204 supports it, hardware screen scaling is available. This feature
205 provides scaling to any size with almost no cpu usage! It's enabled by
206 default if the screen resolution is set to 320x288 or higher; manually
207 set the "yuv" rcvar to 0 or 1 to force it off or on, respectively.
209 Scaling will be performed to fill the entire requested video mode.
210 For example, to scale to 640x480, either add the following line to
215 or put --vmode=640,480 on the command line. A better alternative is to
216 just request a particular scale, for example with:
220 or --scale=4 on the command line; this way the gameboy's near 1:1
221 aspect ratio won't become distorted.
226 At this point all features are implemented and everything should be
227 right, so any incorrect sound output should be treated as a bug, which
228 we'll try to fix as soon as possible.
231 JOYSTICK AND GAMEPAD SUPPORT
233 At this time, the Linux and SDL joystick devices are the only ones
234 supported. We hope to have DOS joystick support soon.
236 Binding joystick controls works the same way as for the keyboard. Just
237 use the key names joyup, joydown, joyright, joyleft, joy0, joy1, joy2,
238 etc. Default bindings should probably be ok for most users, except
239 that A/B might be backwards on some gamepads.
244 Here are some performance estimates i've gathered (given in percent
245 cpu utilization, running at full 60 fps)...
249 Pentium/75 (too slow) 70%
251 SGI Indy 70% (no asm)
252 Sun Ultra60 3-20% (no asm)
253 IBM S/390 about 0.3% (no asm)
255 Note that these figures were computed before sound was implemented.
256 Until the sound code is further optimized, gnuboy may run somewhat
257 slower than these numbers suggest.
260 SUPPORTED MEMORY BANK CONTROLLERS (MBCS)
262 At this time, gnuboy supports MBC1, MBC2, MBC3 (including realtime
263 clock), and MBC5 (including the version with rumble support, although
264 that functionality is omitted).
269 Color Gameboy roms are supported completely, including so-called
270 "highcolor" tricks. Yes, even in 256-color mode, although in games
271 that use too many colors on one screen, the later ones will only be
272 approximated. Use a 16 bpp (or higher) display mode if this is a
275 Alternatively, for games that look bad in 256 color mode, you can
276 run in simulated 3/3/2 bits per channel truecolor. Just set the
277 variable rgb332 to something nonzero (or just putting --rgb332 on the
278 command line will work). Color precision is lost somewhat, especially
279 in smooth gradients, but for the most part it looks very good.
281 Much care has been put into ensuring that the lcd timings and
282 interrupts behave as closely to the real hardware as possible. A few
283 features remain unimplemented, such as reduced length HBLANK depending
284 on the number of sprites visible on the scanline, but the vast
285 majority of display tricks used in current roms work fine.
287 We do, however, lack information on proper GDMA timings, which could
288 theoretically cause problems for some roms. If you can provide us with
289 accurate information, please do!
294 Eventually I'll put detailed information here. For now, just see known
295 bugs for the few cases where roms fails.
300 The portal between the temple and the Talon in FFL3 is glitched and
301 the game freezes for a second or two building the incorrect animation
302 when entering those screens.
304 GDMA finishes instantly, whereas it should take time. Making it take
305 time breaks Wacky Races, last I checked, so apparently the documents I
306 have on GDMA timing are incorrect. Same goes for HDMA. Good
307 information would be much appreciated.
309 The main loop in emu_run is very sloppy and not quite right, but it
312 Sound mixing is taking way too much cpu time. I have some ideas for
313 fixing this, and I plan to write optimized assembly code for sound
314 eventually. If it's a problem try turning down the sample rate.
316 YUV-space hardware scaling only supports the common "YUY2" mode so
317 far. More modes will be added in the future.
320 REPORTING OR FIXING BUGS
322 Found a bug not mentioned above, or better yet, fixed one? Send bug
323 reports or patches to gnuboy@starfox.org. Please be aware that
324 distribution of any code based on gnuboy must follow the provisions of
325 the GPL, so if you don't agree to this, don't send code to us or
326 anyone else. Let us know if you wish to be included in the credits.
328 For guidelines regarding code contributions, see the file HACKING.
330 Please be aware that evaluating contributed code and figuring out if
331 or how to work it in can take time. If we haven't done anything with
332 your code yet, please be patient.
337 Thanks goes out to everyone who's expressed interest in gnuboy by
338 writing -- users, porters, authors of other emulators, and so forth.
339 Apologies if we don't get a personal response out to everyone, but
340 either way, consider your feedback well appreciated.
345 OK, that looks like about it. More to come, stick around...