1.Dd July 26, 2014
2.Dt DGENRC 5
3.Os
4.Sh NAME
5.Nm dgenrc
6.Nd file containing settings for
7.Xr dgen 1
8.Sh SYNOPSIS
9$HOME/.dgen/dgenrc
10.Sh DESCRIPTION
11The file
12.Pa $HOME/.dgen/dgenrc
13is parsed by
14.Xr dgen 1
15when the emuator is started. It is used to set controller keys, as well as other
16characteristics of the emulation. The contents of this file may be overriden
17with the contents of another similarly-formatted file, via the
18.Fl r
19commandline switch.
20.Sh FILE FORMAT
21Each rc file consists of an unlimited number of lines, which each have the
22format 'fieldname = value'. A line may also be a comment, if it begins with the
23hash mark (#) character.
24.Pp
25Each
26.Ar fieldname
27is prepended by a name, which identifies the type of this field:
28.Bl -tag -width bool_*
29.It Ar key_*
30A key value. May be set to a key identifier listed in the
31.Sx KEY IDENTIFIERS
32section below.
33.It Ar joy_*
34A joystick/joypad value. May be set to a joystick identifier listed in the
35.Sx JOYSTICK IDENTIFIERS
36section below.
37.It Ar mou_*
38A mouse action. May be set to a mouse identifier listed in the
39.Sx MOUSE IDENTIFIERS
40section below.
41.It Ar bool_*
42A boolean value. "false", "no", and "0" values are taken as false, while
43"true", "yes", and any number except 0 are taken as true.
44.It Ar int_*
45An integer value, greater than or equal to 0.
46.It Ar str_*
47A string value, can be empty.
48.El
49.Pp
50Some fields take special value sets, which are addressed in their respective
51sections. None of the field names or values are case-sensitive.
52.Pp
53The fields fall under a few basic groups. They are listed below, with their
54default values in brackets ([]):
55.Pp
56All of them can be modified interactively from the prompt, as described in
57.Xr dgen 1 .
58.Sh CONTROLLERS
59.Bl -tag -width xxxx
60.It key_pad1_up [up]
61.It key_pad1_down [down]
62.It key_pad1_left [left]
63.It key_pad1_right [right]
64.It key_pad1_a [a]
65.It key_pad1_b [s]
66.It key_pad1_c [d]
67.It key_pad1_x [q]
68.It key_pad1_y [w]
69.It key_pad1_z [e]
70.It key_pad1_mode [backspace]
71.It key_pad1_start [return]
72Map keys to the first Genesis controller. Each of these fields has a
73corresponding "key_pad2" field, to map to the second controller.
74.It joy_pad1_up [joystick0-axis1-min]
75.It joy_pad1_down [joystick0-axis1-max]
76.It joy_pad1_left [joystick0-axis0-min]
77.It joy_pad1_right [joystick0-axis0-max]
78.It joy_pad1_a [joystick0-button0]
79.It joy_pad1_b [joystick0-button3]
80.It joy_pad1_c [joystick0-button1]
81.It joy_pad1_x [joystick0-button6]
82.It joy_pad1_y [joystick0-button4]
83.It joy_pad1_z [joystick0-button5]
84.It joy_pad1_mode [joystick0-button9]
85.It joy_pad1_start [joystick0-button8]
86Map joystick/joypad buttons to the first Genesis controller. Each of these
87fields has a corresponding "joy_pad2" field, to map to the second controller.
88.It bool_joystick [true]
89Use joysticks to emulate the controllers. Note that the keyboard keys will
90still work if this value is set. This field is only available if you have
91joystick support enabled.
92.It int_mouse_delay [50]
93Number of milliseconds to wait after the last mouse motion event to release
94buttons bound to such events.
95.El
96.Sh USER-DEFINED BINDINGS
97.Bl -tag -width xxxx
98.It bind_{keysym} Ar action
99.It bind_{joypad} Ar action
100.It bind_{mouse} Ar action
101Defines a new keyboard, joystick/joypad or mouse binding to an arbitrary
102action. These variables use the
103.Ar keysym
104format as defined in
105.Sx KEY IDENTIFIERS ,
106the
107.Ar joypad
108format as defined in
109.Sx JOYSTICK IDENTIFIERS ,
110or the
111.Ar mouse
112format as defined in
113.Sx MOUSE IDENTIFIERS .
114When
115.Ar action
116is prefixed with "key_", "joy_" or "mou_", it becomes an alias to the
117corresponding variable in
118.Sx CONTROLLERS .
119Otherwise, it is interpreted as if entered at the prompt, and can be used to
120modify variables or execute commands (see
121.Xr dgenrc 5
122for more information).
123No bindings are defined by default.
124.It bind_"{keysym|joypad|mouse} [{keysym|joypad|mouse} [...]]" Ar action
125Alternate syntax that supports combining several identifiers to perform
126.Ar action .
127Controller types can be mixed. Identifiers are separated by spaces. To avoid
128syntax errors, spaces must be properly escaped or quoted.
129.El
130.Sh AUDIO
131.Bl -tag -width xxxx
132.It bool_sound [true]
133Enable the sound subsystem.
134.It int_soundrate [44100]
135Sound frequency to play at, in hertz (Hz).
136.It int_soundsegs [8]
137Number of sound segments to use for sound buffering. Lower values guarantee
138low latency. Increment this only if the sound becomes choppy.
139.It int_soundsamples [0]
140Size of the system sound buffer, in samples (samples are the sound unit, sound
141rate is how many of them are played every second). Specifying 0 automatically
142choses the safest value. If you experience sound issues int_soundsegs is
143unable to solve, try to change this. Increasing it will cause noticeable audio
144lag (it is unfortunately often required on slower machines).
145.It int_volume [100]
146Volume level, in percent. Values above 100 cause distorsion.
147.It key_volume_inc [=]
148.It key_volume_dec [-]
149.It joy_volume_inc []
150.It joy_volume_dec []
151.It mou_volume_inc []
152.It mou_volume_dec []
153Bindings for volume control.
154.It bool_mjazz [false]
155MJazz option - puts 2 more FM chips in the Megadrive for a sort of 22 channel
156sound boost. Can sound good. Slows things down a lot.
157.El
158.Sh VIDEO
159.Bl -tag -width xxxx
160.It int_depth [0]
161Color depth (bits per pixel). Allowed values are 0 (automatic), 8, 15, 16, 24
162and 32. Ignored in OpenGL mode.
163.It int_width [-1]
164.It int_height [-1]
165Desired window width and height.
166.It bool_opengl [true]
167Use the OpenGL renderer, if it is available.
168.It bool_opengl_stretch [true]
169Let OpenGL stretch the screen.
170.It bool_opengl_linear [true]
171Use GL_LINEAR for textures filtering instead of GL_NEAREST.
172.It bool_opengl_32bit [true]
173Use 32 bit textures. They require more memory but are usually faster than 16
174bit textures.
175.It bool_opengl_square [false]
176Use square textures. Wastes a lot of memory but may solve OpenGL
177initialization failures.
178.It bool_fullscreen [false]
179Try to run fullscreen, if possible.
180.It int_scale [-1]
181.It int_scale_x [-1]
182.It int_scale_y [-1]
183Amount by which to scale the rendered screen from the default resolution. See
184scaling filters.
185.It bool_aspect [true]
186Retain original aspect ratio when resizing window.
187.It key_fullscreen_toggle [alt-enter]
188.It joy_fullscreen_toggle []
189.It mou_fullscreen_toggle []
190Button to toggle fullscreen mode (this may do nothing if SDL doesn't support
191fullscreen toggling on your platform.)
192.It int_info_height [-1]
193Height of the text area at the bottom of the screen, in pixels. This also
194affects the font size. Values smaller than the minimum font size make DGen
195redirect text to stdout instead. The default value of -1 makes DGen choose the
196proper height.
197.It bool_fps [false]
198Display the current number of frames per second.
199.It bool_buttons [false]
200Display pressed buttons. Can be used to help configuring them.
201.It bool_swab [false]
202Swap bytes in the video output. Sometimes useful when video output is located
203on a different system. This is implemented as a CTV filter which must be
204compiled-in to work.
205.It bool_doublebuffer [true]
206Toggle double buffering. Enabling this should prevent screen tearing from
207happening. Disabling this may improve the number of displayed frames per
208second on some systems.
209.It bool_screen_thread [false]
210When enabled, a separate thread is created to offload the displaying of
211frames. This is only useful on slower machines where flipping video buffers
212takes time, especially when V-sync is enabled and doing so blocks until the
213next frame without consuming CPU time (sometimes the case when
214bool_doublebuffer is enabled). This currently has no effect when OpenGL is
215enabled and only works if multi-threading support is compiled-in.
216.El
217.Sh SAVE STATES
218.Bl -tag -width xxxx
219.It key_slot_X [X]
220.It joy_slot_X []
221.It mou_slot_X []
222Sets the current save-state slot to number X.
223.It key_slot_next [f8]
224.It joy_slot_next []
225.It mou_slot_next []
226Switch to the next save-slot.
227.It key_slot_prev [f7]
228.It joy_slot_prev []
229.It mou_slot_prev []
230Switch to the previous save-slot.
231.It key_save [f2]
232.It joy_save []
233.It mou_save []
234Saves state to the current slot.
235.It key_load [f3]
236.It joy_load []
237.It mou_load []
238Loads state from the current slot.
239.El
240.Sh MISCELLANEOUS KEYS
241.Bl -tag -width xxxx
242.It key_fix_checksum [f1]
243.It joy_fix_checksum []
244.It mou_fix_checksum []
245Fixes the checksum value. Some older games will freeze with a red screen if
246the ROM has been hacked or modified with Game Genie codes. If it does, pressing
247this, and resetting should fix the problem.
248.It key_quit [escape]
249.It joy_quit []
250.It mou_quit []
251Exit DGen or switch to the next ROM on the command-line.
252.It key_craptv_toggle [f5]
253.It joy_craptv_toggle []
254.It mou_craptv_toggle []
255Toggles Crap-TV image filters. These filters aren't available in 8 bpp mode.
256.It key_scaling_toggle [f6]
257.It joy_scaling_toggle []
258.It mou_scaling_toggle []
259Toggles scaling algorithms. See scaling_startup below.
260.It key_reset [tab]
261.It joy_reset []
262.It mou_reset []
263Restart the Genesis emulation.
264.It key_cpu_toggle [f11]
265.It joy_cpu_toggle []
266.It mou_cpu_toggle []
267Switch CPU emulators. The x86 assembly CPU emulator StarScream is fast, but
268has glitches which affect a few games. Switching to the slower Musashi core
269will fix these problems, at a speed penalty.
270.It key_z80_toggle [f10]
271.It joy_z80_toggle []
272.It mou_z80_toggle []
273Switch Z80 emulators. MZ80 is a bit faster than CZ80, particularly in its
274assembly version (only available for x86), but CZ80 works with more
275games. This key can also disable Z80 emulation.
276.It key_stop [z]
277.It joy_stop []
278.It mou_stop []
279Pause emulation, so you can concentrate on real life for a few seconds. :)
280.It key_game_genie [f9]
281.It joy_game_genie []
282.It mou_game_genie []
283Enter a Game Genie or Hex code. This key also works in stopped mode.
284.It key_screenshot [f12]
285.It joy_screenshot []
286.It mou_screenshot []
287Take a screenshot. Not available in 8 bpp mode.
288.It key_prompt [:]
289.It joy_prompt []
290.It mou_prompt []
291Pause emulation and display interactive prompt. Also works in stopped mode.
292.It key_debug_enter [`]
293.It joy_debug_enter []
294.It mou_debug_enter []
295Break into the debugger. Only meaningful if debugger support is compiled-in.
296.El
297.Sh PREFERENCES
298.Bl -tag -width xxxx
299.It int_hz [60]
300Video refresh rate. The default is 60 as in NTSC consoles.
301.It bool_pal [false]
302When true, a PAL console is emulated. This should be used in combination with
303int_hz above for 50Hz emulation.
304.It region [' ']
305U for America (NTSC), E for Europe (PAL), J for Japan (NTSC), X for Japan
306(PAL), or empty space for autodetection (the default).
307Overrides bool_pal and int_hz.
308.It str_region_order [JUEX]
309Regions DGen is allowed to emulate when autodetection is enabled, ordered by
310preference.
311.It emu_m68k_startup [musa]
312Useful when both Musashi and StarScream are compiled-in. This option selects
313the default emulator to use ("musa" for Musashi, "star" for StarScream, "none"
314for neither). See key_cpu_toggle.
315.It emu_z80_startup [cz80]
316Useful when both CZ80 and MZ80 are compiled-in. This option selects the
317default emulator to use ("cz80", "mz80" or "none", if you want to disable it
318altogether). See key_z80_toggle.
319.It bool_autoload [false]
320Automatically load the saved state from slot 0 when DGen starts.
321.It bool_autosave [false]
322Automatically save the saved state to slot 0 upon exit. Setting both of these
323fields true, you can exit DGen, and automatically start a game where you left
324off when you start it again.
325.It bool_autoconf [true]
326Automatically dump the current configuration to dgenrc.auto before
327exiting. This file is always loaded before dgenrc at startup.
328.It bool_frameskip [true]
329Automatically skip frames, when it is necessary to maintain proper emulation
330speed. You may want to disable sound or set int_nice to a nonzero
331value when setting this to false.
332.It int_nice [0]
333If set to a non-zero value, DGen will call
334.Xr usleep 3
335with the specified parameter
336after rendering each frame. This will slow the program down (if it is running
337too fast on your computer), and allow the operating system to reclaim some
338CPU time.
339.It ctv_craptv_startup [off]
340CTV filter to use by default. Available filters are "blur", "scanline",
341"interlace" and "swab".
342.It scaling_startup [stretch]
343Scaler to use when display resolution is larger than original screen.
344Available filters are "stretch", "scale", "hqx", "hqx stretch", "scale2x",
345"scale2x stretch" and "none".
346.It bool_show_carthead [false]
347Show cartridge header info at startup.
348.It bool_raw_screenshots [false]
349Generate unfiltered screenshots.
350.It str_rom_path ["roms"]
351Directory where DGen should look for ROMs by default. It's relative to DGen's
352home directory, unless an absolute path is provided.
353.El
354.Sh DEBUGGING
355.Bl -tag -width xxxx
356.It bool_vdp_hide_plane_a [false]
357.It bool_vdp_hide_plane_b [false]
358.It bool_vdp_hide_plane_w [false]
359.It bool_vdp_hide_sprites [false]
360Hide various planes during frame rendering. Require VDP debugging to be
361compiled-in.
362.It bool_vdp_sprites_boxing [false]
363.It int_vdp_sprites_boxing_fg [0xffff00] (yellow)
364.It int_vdp_sprites_boxing_bg [0x00ff00] (green)
365Toggle sprites boxing and configure its colors. Require VDP debugging to be
366compiled-in. "fg" is for sprites with the high priority bit set, "bg" is for
367the others. Color format is 0xRRGGBB.
368.El
369.Sh EXAMPLES
370See the file "sample.dgenrc" in the DGen/SDL distribution.
371.Sh KEY IDENTIFIERS
372A key identifier can have the prefixes "shift-", "ctrl-", "alt-" and "meta-",
373or any combination thereof, to require that the specified modifier be pressed
374in combination with the key. For example, the identifier "alt-enter" would
375correspond to holding down the Alt key while pressing Enter.
376.Pp
377The "shift-" modifier only works with keys that don't generate symbols (such
378as arrow keys). Otherwise their UTF-8 representation must be used directly.
379.Pp
380The numbers "0" through "9" ("kp_0" through "kp_9" for the numeric keypad),
381letters "A" through "Z", and function keys "F1" through "F12" map to their key
382equivalents.
383In addition, the following identifiers map to their similarly-labeled key
384counterparts. Identifiers on the same line map to the same key:
385.Bd -literal -offset indent
386escape
387backspace
388tab
389capslock	caps_lock
390lshift		shift_l
391rshift		shift_r
392lctrl		ctrl_l
393lmeta		meta_l
394lalt		alt_l
395ralt		alt_r
396rmeta		meta_r
397rctrl		ctrl_r
398return		enter
399space
400
401scrollock	scroll_lock
402numlock		num_lock
403
404insert
405home
406page_up		pageup
407delete
408end
409page_down	pagedown
410left
411right
412up
413down
414
415kp_home
416kp_up
417kp_pageup	kp_page_up
418kp_left
419kp_right
420kp_end
421kp_down
422kp_pagedown	kp_page_down
423kp_insert
424kp_delete	kp_period
425
426kp_enter
427kp_divide
428kp_minus
429kp_multiply
430kp_plus
431.Ed
432.Sh JOYSTICK IDENTIFIERS
433Like key identifiers, joystick (or joypad) identifiers describe a joystick
434event. Each detected joystick is numbered starting from 0. Three different
435event types are supported.
436.Bl -tag -width xxxx
437.It Buttons: joystickX-buttonY
438For joystick/joypad number X, button number Y. "button" can be abbreviated
439as "b".
440.It Axes: joystickX-axisY-min, joystickX-axisY-max
441For joystick/joypad number X, axis number Y, and its position, which is either
442"min" (also "n", "negative") or "max" (also "p", "positive"). "axis" can be
443abbreviated as "a".
444.It Hats: joystickX-hatY-{direction}
445For joystick/joypad number X, hat number Y and direction. "hat" can be
446abbreviated as "h". Possible directions are "up", "right", "down", "left".
447.El
448.Sh MOUSE IDENTIFIERS
449These identifiers describe a mouse event. Each detected mouse is numbered
450starting from 0. Two different event types are supported.
451.Bl -tag -width xxxx
452.It Buttons: mouseX-buttonY
453For mouse number X, button number Y. "button" can be abbreviated as "b".
454.It Motions: mouseX-{direction}
455For mouse number X and direction. Possible directions are "up", "right",
456"down", "left".
457.El
458.Sh SEE ALSO
459.Xr dgen 1
460.Sh AUTHORS
461This manual page was written by
462.An Joe Groff Aq joe@pknet.com .
463.An Updated by zamaz Aq zamaz@users.sourceforge.net .
464