1 /*
2 * UAE - The Un*x Amiga Emulator
3 *
4 * Stuff
5 *
6 * Copyright 1995, 1996 Ed Hanway
7 * Copyright 1995-2001 Bernd Schmidt
8 */
9 
10 #ifndef UAE_OPTIONS_H
11 #define UAE_OPTIONS_H
12 
13 #ifdef FSUAE
14 #include "uae/limits.h"
15 #endif
16 #include "uae/types.h"
17 
18 #define UAEMAJOR 3
19 #define UAEMINOR 3
20 #define UAESUBREV 0
21 
22 typedef enum { KBD_LANG_US, KBD_LANG_DK, KBD_LANG_DE, KBD_LANG_SE, KBD_LANG_FR, KBD_LANG_IT, KBD_LANG_ES } KbdLang;
23 
24 extern long int version;
25 
26 #define MAX_PATHS 8
27 
28 struct multipath {
29 	TCHAR path[MAX_PATHS][PATH_MAX];
30 };
31 
32 struct strlist {
33 	struct strlist *next;
34 	TCHAR *option, *value;
35 	int unknown;
36 };
37 
38 #define MAX_TOTAL_SCSI_DEVICES 8
39 
40 /* maximum number native input devices supported (single type) */
41 #define MAX_INPUT_DEVICES 20
42 /* maximum number of native input device's buttons and axles supported */
43 #define MAX_INPUT_DEVICE_EVENTS 256
44 /* 4 different customization settings */
45 #define MAX_INPUT_SETTINGS 4
46 #define GAMEPORT_INPUT_SETTINGS 3 // last slot is for gameport panel mappings
47 
48 #define MAX_INPUT_SUB_EVENT 8
49 #define MAX_INPUT_SUB_EVENT_ALL 9
50 #define SPARE_SUB_EVENT 8
51 
52 #define INTERNALEVENT_COUNT 1
53 
54 struct uae_input_device {
55 	TCHAR *name;
56 	TCHAR *configname;
57 	uae_s16 eventid[MAX_INPUT_DEVICE_EVENTS][MAX_INPUT_SUB_EVENT_ALL];
58 	TCHAR *custom[MAX_INPUT_DEVICE_EVENTS][MAX_INPUT_SUB_EVENT_ALL];
59 	uae_u64 flags[MAX_INPUT_DEVICE_EVENTS][MAX_INPUT_SUB_EVENT_ALL];
60 	uae_s8 port[MAX_INPUT_DEVICE_EVENTS][MAX_INPUT_SUB_EVENT_ALL];
61 	uae_s16 extra[MAX_INPUT_DEVICE_EVENTS];
62 	uae_s8 enabled;
63 };
64 
65 #define MAX_JPORTS_CUSTOM 6
66 #define MAX_JPORTS 4
67 #define NORMAL_JPORTS 2
68 #define MAX_JPORTNAME 128
69 struct jport_custom {
70 	TCHAR custom[MAX_DPATH];
71 };
72 struct jport {
73 	int id;
74 	int mode; // 0=def,1=mouse,2=joy,3=anajoy,4=lightpen
75 	int autofire;
76 	TCHAR name[MAX_JPORTNAME];
77 	TCHAR configname[MAX_JPORTNAME];
78 	bool nokeyboardoverride;
79 };
80 #define JPORT_NONE -1
81 
82 #define JPORT_AF_NORMAL 1
83 #define JPORT_AF_TOGGLE 2
84 #define JPORT_AF_ALWAYS 3
85 
86 #define KBTYPE_AMIGA 0
87 #define KBTYPE_PC1 1
88 #define KBTYPE_PC2 2
89 
90 #define MAX_SPARE_DRIVES 20
91 #define MAX_CUSTOM_MEMORY_ADDRS 2
92 
93 #define CONFIG_TYPE_ALL -1
94 #define CONFIG_TYPE_DEFAULT 0
95 #define CONFIG_TYPE_HARDWARE 1
96 #define CONFIG_TYPE_HOST 2
97 #define CONFIG_TYPE_NORESET 4
98 #define CONFIG_BLEN 2560
99 
100 #define TABLET_OFF 0
101 #define TABLET_MOUSEHACK 1
102 #define TABLET_REAL 2
103 
104 #ifdef WITH_SLIRP
105 #define MAX_SLIRP_REDIRS 32
106 struct slirp_redir
107 {
108 	int proto;
109 	int srcport;
110 	int dstport;
111 	unsigned long addr;
112 };
113 #endif
114 
115 struct cdslot
116 {
117 	TCHAR name[MAX_DPATH];
118 	bool inuse;
119 	bool delayed;
120 	bool temporary;
121 	int type;
122 };
123 struct floppyslot
124 {
125 	TCHAR df[MAX_DPATH];
126 	int dfxtype;
127 	int dfxclick;
128 	TCHAR dfxclickexternal[256];
129 	bool forcedwriteprotect;
130 };
131 
132 #define ASPECTMULT 1024
133 #define WH_NATIVE 1
134 struct wh {
135 	int x, y;
136 	int width, height;
137 	int special;
138 };
139 
140 #define MOUNT_CONFIG_SIZE 30
141 #define UAEDEV_DIR 0
142 #define UAEDEV_HDF 1
143 #define UAEDEV_CD 2
144 #define UAEDEV_TAPE 3
145 
146 #define HD_LEVEL_SCSI_1 0
147 #define HD_LEVEL_SCSI_2 1
148 #define HD_LEVEL_SASI 2
149 #define HD_LEVEL_SASI_ENHANCED 2
150 #define HD_LEVEL_SASI_CHS 3
151 
152 #define HD_LEVEL_ATA_1 0
153 #define HD_LEVEL_ATA_2 1
154 #define HD_LEVEL_ATA_2S 2
155 
156 #define BOOTPRI_NOAUTOBOOT -128
157 #define BOOTPRI_NOAUTOMOUNT -129
158 #define ISAUTOBOOT(ci) ((ci)->bootpri > BOOTPRI_NOAUTOBOOT)
159 #define ISAUTOMOUNT(ci) ((ci)->bootpri > BOOTPRI_NOAUTOMOUNT)
160 struct uaedev_config_info {
161 	int type;
162 	TCHAR devname[MAX_DPATH];
163 	TCHAR volname[MAX_DPATH];
164 	TCHAR rootdir[MAX_DPATH];
165 	bool readonly;
166 	int bootpri;
167 	TCHAR filesys[MAX_DPATH];
168 	int lowcyl;
169 	int highcyl; // zero if detected from size
170 	int cyls; // calculated/corrected highcyl
171 	int surfaces;
172 	int sectors;
173 	int reserved;
174 	int blocksize;
175 	int controller_type;
176 	int controller_type_unit;
177 	int controller_unit;
178 	int controller_media_type; // 1 = CF IDE, 0 = normal
179 	int unit_feature_level;
180 	int unit_special_flags;
181 	bool physical_geometry; // if false: use defaults
182 	int pcyls, pheads, psecs;
183 	int flags;
184 	int buffers;
185 	int bufmemtype;
186 	int stacksize;
187 	int priority;
188 	uae_u32 mask;
189 	int maxtransfer;
190 	uae_u32 dostype;
191 	int unit;
192 	int interleave;
193 	int sectorsperblock;
194 	int forceload;
195 	int device_emu_unit;
196 	bool inject_icons;
197 };
198 
199 struct uaedev_config_data
200 {
201 	struct uaedev_config_info ci;
202 	int configoffset; // HD config entry index
203 	int unitnum; // scsi unit number (if tape currently)
204 };
205 
206 enum { CP_GENERIC = 1, CP_CDTV, CP_CDTVCR, CP_CD32, CP_A500, CP_A500P, CP_A600, CP_A1000,
207 	CP_A1200, CP_A2000, CP_A3000, CP_A3000T, CP_A4000, CP_A4000T, CP_VELVET };
208 
209 #define IDE_A600A1200 1
210 #define IDE_A4000 2
211 
212 #define GFX_WINDOW 0
213 #define GFX_FULLSCREEN 1
214 #define GFX_FULLWINDOW 2
215 
216 #define AUTOSCALE_NONE 0
217 #define AUTOSCALE_STATIC_AUTO 1
218 #define AUTOSCALE_STATIC_NOMINAL 2
219 #define AUTOSCALE_STATIC_MAX 3
220 #define AUTOSCALE_NORMAL 4
221 #define AUTOSCALE_RESIZE 5
222 #define AUTOSCALE_CENTER 6
223 #define AUTOSCALE_MANUAL 7 // use gfx_xcenter_pos and gfx_ycenter_pos
224 #define AUTOSCALE_INTEGER 8
225 #define AUTOSCALE_INTEGER_AUTOSCALE 9
226 #define AUTOSCALE_SEPARATOR 10
227 #define AUTOSCALE_OVERSCAN_BLANK 11
228 
229 #define MONITOREMU_NONE 0
230 #define MONITOREMU_AUTO 1
231 #define MONITOREMU_A2024 2
232 #define MONITOREMU_GRAFFITI 3
233 #define MONITOREMU_HAM_E 4
234 #define MONITOREMU_HAM_E_PLUS 5
235 #define MONITOREMU_VIDEODAC18 6
236 #define MONITOREMU_AVIDEO12 7
237 #define MONITOREMU_AVIDEO24 8
238 #define MONITOREMU_FIRECRACKER24 9
239 #define MONITOREMU_DCTV 10
240 
241 #define MAX_FILTERSHADERS 4
242 
243 #define MAX_CHIPSET_REFRESH 10
244 #define MAX_CHIPSET_REFRESH_TOTAL (MAX_CHIPSET_REFRESH + 2)
245 #define CHIPSET_REFRESH_PAL (MAX_CHIPSET_REFRESH + 0)
246 #define CHIPSET_REFRESH_NTSC (MAX_CHIPSET_REFRESH + 1)
247 struct chipset_refresh
248 {
249 	int index;
250 	bool locked;
251 	bool rtg;
252 	int horiz;
253 	int vert;
254 	int lace;
255 	int ntsc;
256 	int vsync;
257 	int framelength;
258 	double rate;
259 	TCHAR label[16];
260 	TCHAR commands[256];
261 };
262 
263 #define APMODE_NATIVE 0
264 #define APMODE_RTG 1
265 
266 struct apmode
267 {
268 	int gfx_fullscreen;
269 	int gfx_display;
270 	int gfx_vsync;
271 	// 0 = immediate flip
272 	// -1 = wait for flip, before frame ends
273 	// 1 = wait for flip, after new frame has started
274 	int gfx_vflip;
275 	// doubleframemode strobo
276 	bool gfx_strobo;
277 	int gfx_vsyncmode;
278 	int gfx_backbuffers;
279 	bool gfx_interlaced;
280 	int gfx_refreshrate;
281 };
282 
283 #define MAX_LUA_STATES 16
284 
285 
286 struct gfx_filterdata
287 {
288 	int gfx_filter;
289 	TCHAR gfx_filtershader[2 * MAX_FILTERSHADERS + 1][MAX_DPATH];
290 	TCHAR gfx_filtermask[2 * MAX_FILTERSHADERS + 1][MAX_DPATH];
291 	TCHAR gfx_filteroverlay[MAX_DPATH];
292 	struct wh gfx_filteroverlay_pos;
293 	int gfx_filteroverlay_overscan;
294 	int gfx_filter_scanlines;
295 	int gfx_filter_scanlineratio;
296 	int gfx_filter_scanlinelevel;
297 	float gfx_filter_horiz_zoom, gfx_filter_vert_zoom;
298 	float gfx_filter_horiz_zoom_mult, gfx_filter_vert_zoom_mult;
299 	float gfx_filter_horiz_offset, gfx_filter_vert_offset;
300 	int gfx_filter_left_border, gfx_filter_right_border;
301 	int gfx_filter_top_border, gfx_filter_bottom_border;
302 	int gfx_filter_filtermode;
303 	int gfx_filter_bilinear;
304 	int gfx_filter_noise, gfx_filter_blur;
305 	int gfx_filter_saturation, gfx_filter_luminance, gfx_filter_contrast;
306 	int gfx_filter_gamma, gfx_filter_gamma_ch[3];
307 	int gfx_filter_keep_aspect, gfx_filter_aspect;
308 	int gfx_filter_autoscale;
309 	int gfx_filter_integerscalelimit;
310 	int gfx_filter_keep_autoscale_aspect;
311 };
312 
313 #define MAX_DUPLICATE_EXPANSION_BOARDS 4
314 #define MAX_EXPANSION_BOARDS 4
315 struct romconfig
316 {
317 	TCHAR romfile[MAX_DPATH];
318 	TCHAR romident[256];
319 	uae_u32 board_ram_size;
320 	bool autoboot_disabled;
321 	int device_id;
322 	int device_settings;
323 	int subtype;
324 	void *unitdata;
325 };
326 #define MAX_BOARD_ROMS 2
327 struct boardromconfig
328 {
329 	int device_type;
330 	int device_num;
331 	struct romconfig roms[MAX_BOARD_ROMS];
332 };
333 
334 #define Z3MAPPING_AUTO 0
335 #define Z3MAPPING_UAE 1
336 #define Z3MAPPING_REAL 2
337 
338 struct uae_prefs {
339 
340 	struct strlist *all_lines;
341 
342 	TCHAR description[256];
343 	TCHAR info[256];
344 	int config_version;
345 	TCHAR config_hardware_path[MAX_DPATH];
346 	TCHAR config_host_path[MAX_DPATH];
347 	TCHAR config_all_path[MAX_DPATH];
348 	TCHAR config_window_title[256];
349 
350 	bool illegal_mem;
351 	bool use_serial;
352 	bool serial_demand;
353 	bool serial_hwctsrts;
354 	bool serial_direct;
355 	int serial_stopbits;
356 	int serial_crlf;
357 	bool parallel_demand;
358 	int parallel_matrix_emulation;
359 	bool parallel_postscript_emulation;
360 	bool parallel_postscript_detection;
361 	int parallel_autoflush_time;
362 	TCHAR ghostscript_parameters[256];
363 	bool use_gfxlib;
364 	bool socket_emu;
365 
366 	bool start_debugger;
367 	bool start_gui;
368 
369 	KbdLang keyboard_lang;
370 
371 	int produce_sound;
372 	int sound_stereo;
373 	int sound_stereo_separation;
374 	int sound_mixed_stereo_delay;
375 	int sound_freq;
376 	int sound_maxbsiz;
377 	int sound_interpol;
378 	int sound_filter;
379 	int sound_filter_type;
380 	int sound_volume_master;
381 	int sound_volume_paula;
382 	int sound_volume_cd;
383 	int sound_volume_board;
384 	bool sound_stereo_swap_paula;
385 	bool sound_stereo_swap_ahi;
386 	bool sound_auto;
387 	bool sound_cdaudio;
388 
389 	int sampler_freq;
390 	int sampler_buffer;
391 	bool sampler_stereo;
392 
393 	int comptrustbyte;
394 	int comptrustword;
395 	int comptrustlong;
396 	int comptrustnaddr;
397 	bool compnf;
398 	bool compfpu;
399 	bool comp_hardflush;
400 	bool comp_constjump;
401 	int cachesize;
402 	bool fpu_strict;
403 
404 	bool fpu_softfloat;
405 
406 	int gfx_framerate, gfx_autoframerate;
407 	struct wh gfx_size_win;
408 	struct wh gfx_size_fs;
409 	struct wh gfx_size;
410 	struct wh gfx_size_win_xtra[6];
411 	struct wh gfx_size_fs_xtra[6];
412 	bool gfx_autoresolution_vga;
413 	int gfx_autoresolution;
414 	int gfx_autoresolution_delay;
415 	int gfx_autoresolution_minv, gfx_autoresolution_minh;
416 	bool gfx_scandoubler;
417 	struct apmode gfx_apmode[2];
418 	int gfx_resolution;
419 	int gfx_vresolution;
420 	int gfx_lores_mode;
421 	int gfx_pscanlines, gfx_iscanlines;
422 	int gfx_xcenter, gfx_ycenter;
423 	int gfx_xcenter_pos, gfx_ycenter_pos;
424 	int gfx_xcenter_size, gfx_ycenter_size;
425 	int gfx_max_horizontal, gfx_max_vertical;
426 	int gfx_saturation, gfx_luminance, gfx_contrast, gfx_gamma, gfx_gamma_ch[3];
427 	bool gfx_blackerthanblack;
428 	int gfx_api;
429 	int color_mode;
430 	int gfx_extrawidth;
431 	bool lightboost_strobo;
432 
433 	struct gfx_filterdata gf[2];
434 
435 	float rtg_horiz_zoom_mult;
436 	float rtg_vert_zoom_mult;
437 
438 	bool immediate_blits;
439 	int waiting_blits;
440 	unsigned int chipset_mask;
441 	bool ntscmode;
442 	bool genlock;
443 	int genlock_image;
444 	int genlock_mix;
445 	TCHAR genlock_image_file[MAX_DPATH];
446 	int monitoremu;
447 	double chipset_refreshrate;
448 	struct chipset_refresh cr[MAX_CHIPSET_REFRESH + 2];
449 	int cr_selected;
450 	int collision_level;
451 	int leds_on_screen;
452 	int leds_on_screen_mask[2];
453 	struct wh osd_pos;
454 	int keyboard_leds[3];
455 	bool keyboard_leds_in_use;
456 	int scsi;
457 	bool sana2;
458 	bool uaeserial;
459 	int catweasel;
460 	int cpu_idle;
461 	int ppc_cpu_idle;
462 	bool cpu_cycle_exact;
463 	int cpu_clock_multiplier;
464 	int cpu_frequency;
465 	bool blitter_cycle_exact;
466 	bool cpu_memory_cycle_exact;
467 	int floppy_speed;
468 	int floppy_write_length;
469 	int floppy_random_bits_min;
470 	int floppy_random_bits_max;
471 	int floppy_auto_ext2;
472 	int cd_speed;
473 	bool tod_hack;
474 	uae_u32 maprom;
475 	int boot_rom;
476 	bool rom_readwrite;
477 	int turbo_emulation;
478 	int turbo_emulation_limit;
479 	bool headless;
480 	int filesys_limit;
481 	int filesys_max_name;
482 	int filesys_max_file_size;
483 	bool filesys_inject_icons;
484 	TCHAR filesys_inject_icons_tool[MAX_DPATH];
485 	TCHAR filesys_inject_icons_project[MAX_DPATH];
486 	TCHAR filesys_inject_icons_drawer[MAX_DPATH];
487 	int uaescsidevmode;
488 	bool reset_delay;
489 
490 	int cs_compatible;
491 	int cs_ciaatod;
492 	int cs_rtc;
493 	int cs_rtc_adjust;
494 	int cs_rtc_adjust_mode;
495 	bool cs_ksmirror_e0;
496 	bool cs_ksmirror_a8;
497 	bool cs_ciaoverlay;
498 	bool cs_cd32cd;
499 	bool cs_cd32c2p;
500 	bool cs_cd32nvram;
501 	bool cs_cd32fmv;
502 	int cs_cd32nvram_size;
503 	bool cs_cdtvcd;
504 	bool cs_cdtvram;
505 	int cs_cdtvcard;
506 	int cs_ide;
507 	bool cs_pcmcia;
508 	bool cs_a1000ram;
509 	int cs_fatgaryrev;
510 	int cs_ramseyrev;
511 	int cs_agnusrev;
512 	int cs_deniserev;
513 	int cs_mbdmac;
514 	bool cs_cdtvscsi;
515 	bool cs_cdtvcr;
516 	bool cs_df0idhw;
517 	bool cs_slowmemisfast;
518 	bool cs_resetwarning;
519 	bool cs_denisenoehb;
520 	bool cs_dipagnus;
521 	bool cs_agnusbltbusybug;
522 	bool cs_ciatodbug;
523 	bool cs_z3autoconfig;
524 	bool cs_1mchipjumper;
525 	bool cs_cia6526;
526 	bool cs_bytecustomwritebug;
527 	int cs_hacks;
528 
529 	struct boardromconfig expansionboard[MAX_EXPANSION_BOARDS];
530 
531 	TCHAR romfile[MAX_DPATH];
532 	TCHAR romident[256];
533 	TCHAR romextfile[MAX_DPATH];
534 	uae_u32 romextfile2addr;
535 	TCHAR romextfile2[MAX_DPATH];
536 	TCHAR romextident[256];
537 	TCHAR flashfile[MAX_DPATH];
538 	TCHAR rtcfile[MAX_DPATH];
539 	TCHAR cartfile[MAX_DPATH];
540 	TCHAR cartident[256];
541 	int cart_internal;
542 	TCHAR pci_devices[256];
543 	TCHAR prtname[256];
544 	TCHAR sername[256];
545 	TCHAR a2065name[MAX_DPATH];
546 	TCHAR ne2000pciname[MAX_DPATH];
547 	TCHAR picassoivromfile[MAX_DPATH];
548 	struct cdslot cdslots[MAX_TOTAL_SCSI_DEVICES];
549 	TCHAR quitstatefile[MAX_DPATH];
550 	TCHAR statefile[MAX_DPATH];
551 	TCHAR inprecfile[MAX_DPATH];
552 	bool inprec_autoplay;
553 	bool refresh_indicator;
554 
555 	struct multipath path_floppy;
556 	struct multipath path_hardfile;
557 	struct multipath path_rom;
558 	struct multipath path_cd;
559 
560 	int m68k_speed;
561 	double m68k_speed_throttle;
562 	double x86_speed_throttle;
563 	int cpu_model;
564 	int mmu_model;
565 	int cpu060_revision;
566 	int fpu_model;
567 	int fpu_revision;
568 	int ppc_mode;
569 	TCHAR ppc_model[32];
570 	bool cpu_compatible;
571 	bool cpu_thread;
572 	bool int_no_unimplemented;
573 	bool fpu_no_unimplemented;
574 	bool address_space_24;
575 	bool picasso96_nocustom;
576 	int picasso96_modeflags;
577 
578 	uae_u32 z3autoconfig_start;
579 	uae_u32 z3fastmem_size, z3fastmem2_size;
580 	uae_u32 z3chipmem_size;
581 	uae_u32 z3chipmem_start;
582 	uae_u32 fastmem_size, fastmem2_size;
583 	bool fastmem_autoconfig;
584 	uae_u32 chipmem_size;
585 	uae_u32 bogomem_size;
586 	uae_u32 mbresmem_low_size;
587 	uae_u32 mbresmem_high_size;
588 	uae_u32 mem25bit_size;
589 	uae_u32 rtgmem_size;
590 	int cpuboard_type;
591 	int cpuboard_subtype;
592 	int cpuboard_settings;
593 	uae_u32 cpuboardmem1_size;
594 	uae_u32 cpuboardmem2_size;
595 	int ppc_implementation;
596 	bool rtg_hardwareinterrupt;
597 	bool rtg_hardwaresprite;
598 	int rtgmem_type;
599 	bool rtg_more_compatible;
600 	uae_u32 custom_memory_addrs[MAX_CUSTOM_MEMORY_ADDRS];
601 	uae_u32 custom_memory_sizes[MAX_CUSTOM_MEMORY_ADDRS];
602 	uae_u32 custom_memory_mask[MAX_CUSTOM_MEMORY_ADDRS];
603 	int uaeboard;
604 
605 	bool kickshifter;
606 	bool filesys_no_uaefsdb;
607 	bool filesys_custom_uaefsdb;
608 	bool mmkeyboard;
609 	int uae_hide;
610 	bool clipboard_sharing;
611 	bool native_code;
612 	bool uae_hide_autoconfig;
613 	int z3_mapping_mode;
614 	bool sound_toccata;
615 	bool sound_toccata_mixer;
616 	bool sound_es1370;
617 	bool sound_fm801;
618 
619 	int mountitems;
620 	struct uaedev_config_data mountconfig[MOUNT_CONFIG_SIZE];
621 
622 	int nr_floppies;
623 	struct floppyslot floppyslots[4];
624 	bool floppy_read_only;
625 	TCHAR dfxlist[MAX_SPARE_DRIVES][MAX_DPATH];
626 	int dfxclickvolume_disk[4];
627 	int dfxclickvolume_empty[4];
628 	int dfxclickchannelmask;
629 
630 	TCHAR luafiles[MAX_LUA_STATES][MAX_DPATH];
631 
632 	/* Target specific options */
633 
634 	bool win32_middle_mouse;
635 	bool win32_logfile;
636 	bool win32_notaskbarbutton;
637 	bool win32_nonotificationicon;
638 	bool win32_alwaysontop;
639 	bool win32_powersavedisabled;
640 	bool win32_minimize_inactive;
641 	int win32_statusbar;
642 	bool win32_start_minimized;
643 	bool win32_start_uncaptured;
644 
645 	int win32_active_capture_priority;
646 	bool win32_active_nocapture_pause;
647 	bool win32_active_nocapture_nosound;
648 	int win32_inactive_priority;
649 	bool win32_inactive_pause;
650 	bool win32_inactive_nosound;
651 	int win32_inactive_input;
652 	int win32_iconified_priority;
653 	bool win32_iconified_pause;
654 	bool win32_iconified_nosound;
655 	int win32_iconified_input;
656 
657 	bool win32_rtgmatchdepth;
658 	bool win32_rtgallowscaling;
659 	int win32_rtgscaleaspectratio;
660 	int win32_rtgvblankrate;
661 	bool win32_borderless;
662 	bool win32_ctrl_F11_is_quit;
663 	bool win32_automount_removable;
664 	bool win32_automount_drives;
665 	bool win32_automount_cddrives;
666 	bool win32_automount_netdrives;
667 	bool win32_automount_removabledrives;
668 	int win32_midioutdev;
669 	int win32_midiindev;
670 	bool win32_midirouter;
671 	int win32_uaescsimode;
672 	int win32_soundcard;
673 	int win32_samplersoundcard;
674 	bool win32_norecyclebin;
675 	int win32_guikey;
676 	int win32_kbledmode;
677 	bool win32_blankmonitors;
678 	TCHAR win32_commandpathstart[MAX_DPATH];
679 	TCHAR win32_commandpathend[MAX_DPATH];
680 	TCHAR win32_parjoyport0[MAX_DPATH];
681 	TCHAR win32_parjoyport1[MAX_DPATH];
682 	TCHAR win32_guipage[32];
683 	TCHAR win32_guiactivepage[32];
684 	bool win32_filesystem_mangle_reserved_names;
685 	bool right_control_is_right_win_key;
686 #ifdef WITH_SLIRP
687 #ifdef FSUAE
688 	int slirp_implementation;
689 #endif
690 	struct slirp_redir slirp_redirs[MAX_SLIRP_REDIRS];
691 #endif
692 	int statecapturerate, statecapturebuffersize;
693 	int aviout_width, aviout_height, aviout_xoffset, aviout_yoffset;
694 
695 	/* input */
696 
697 	struct jport jports[MAX_JPORTS];
698 	struct jport_custom jports_custom[MAX_JPORTS_CUSTOM];
699 	int input_selected_setting;
700 	int input_joymouse_multiplier;
701 	int input_joymouse_deadzone;
702 	int input_joystick_deadzone;
703 	int input_joymouse_speed;
704 	int input_analog_joystick_mult;
705 	int input_analog_joystick_offset;
706 	int input_autofire_linecnt;
707 	int input_mouse_speed;
708 	int input_tablet;
709 	bool tablet_library;
710 	bool input_magic_mouse;
711 	int input_magic_mouse_cursor;
712 	int input_keyboard_type;
713 	int input_autoswitch;
714 	struct uae_input_device joystick_settings[MAX_INPUT_SETTINGS][MAX_INPUT_DEVICES];
715 	struct uae_input_device mouse_settings[MAX_INPUT_SETTINGS][MAX_INPUT_DEVICES];
716 	struct uae_input_device keyboard_settings[MAX_INPUT_SETTINGS][MAX_INPUT_DEVICES];
717 	struct uae_input_device internalevent_settings[MAX_INPUT_SETTINGS][INTERNALEVENT_COUNT];
718 	TCHAR input_config_name[GAMEPORT_INPUT_SETTINGS][256];
719 	int dongle;
720 	int input_contact_bounce;
721 };
722 
723 extern int config_changed;
724 extern void config_check_vsync (void);
725 extern void set_config_changed (void);
726 
727 /* Contains the filename of .uaerc */
728 extern TCHAR optionsfile[];
729 extern void save_options (struct zfile *, struct uae_prefs *, int);
730 
731 extern void cfgfile_write (struct zfile *, const TCHAR *option, const TCHAR *format,...);
732 extern void cfgfile_dwrite (struct zfile *, const TCHAR *option, const TCHAR *format,...);
733 extern void cfgfile_target_write (struct zfile *, const TCHAR *option, const TCHAR *format,...);
734 extern void cfgfile_target_dwrite (struct zfile *, const TCHAR *option, const TCHAR *format,...);
735 
736 extern void cfgfile_write_bool (struct zfile *f, const TCHAR *option, bool b);
737 extern void cfgfile_dwrite_bool (struct zfile *f,const  TCHAR *option, bool b);
738 extern void cfgfile_target_write_bool (struct zfile *f, const TCHAR *option, bool b);
739 extern void cfgfile_target_dwrite_bool (struct zfile *f, const TCHAR *option, bool b);
740 
741 extern void cfgfile_write_str (struct zfile *f, const TCHAR *option, const TCHAR *value);
742 extern void cfgfile_dwrite_str (struct zfile *f, const TCHAR *option, const TCHAR *value);
743 extern void cfgfile_target_write_str (struct zfile *f, const TCHAR *option, const TCHAR *value);
744 extern void cfgfile_target_dwrite_str (struct zfile *f, const TCHAR *option, const TCHAR *value);
745 
746 extern void cfgfile_backup (const TCHAR *path);
747 extern struct uaedev_config_data *add_filesys_config (struct uae_prefs *p, int index, struct uaedev_config_info*);
748 extern bool get_hd_geometry (struct uaedev_config_info *);
749 extern void uci_set_defaults (struct uaedev_config_info *uci, bool rdb);
750 
751 extern void error_log (const TCHAR*, ...);
752 extern TCHAR *get_error_log (void);
753 extern bool is_error_log (void);
754 
755 extern void default_prefs (struct uae_prefs *, int);
756 extern void discard_prefs (struct uae_prefs *, int);
757 
758 int parse_cmdline_option (struct uae_prefs *, TCHAR, const TCHAR*);
759 
760 extern int cfgfile_yesno (const TCHAR *option, const TCHAR *value, const TCHAR *name, bool *location);
761 extern int cfgfile_intval (const TCHAR *option, const TCHAR *value, const TCHAR *name, int *location, int scale);
762 extern int cfgfile_strval (const TCHAR *option, const TCHAR *value, const TCHAR *name, int *location, const TCHAR *table[], int more);
763 extern int cfgfile_string (const TCHAR *option, const TCHAR *value, const TCHAR *name, TCHAR *location, int maxsz);
764 extern TCHAR *cfgfile_subst_path (const TCHAR *path, const TCHAR *subst, const TCHAR *file);
765 
766 extern TCHAR *target_expand_environment (const TCHAR *path);
767 extern int target_parse_option (struct uae_prefs *, const TCHAR *option, const TCHAR *value);
768 extern void target_save_options (struct zfile*, struct uae_prefs *);
769 extern void target_default_options (struct uae_prefs *, int type);
770 extern void target_fixup_options (struct uae_prefs *);
771 extern int target_cfgfile_load (struct uae_prefs *, const TCHAR *filename, int type, int isdefault);
772 extern void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type);
773 extern int target_get_display (const TCHAR*);
774 extern const TCHAR *target_get_display_name (int, bool);
775 
776 extern int cfgfile_load (struct uae_prefs *p, const TCHAR *filename, int *type, int ignorelink, int userconfig);
777 extern int cfgfile_save (struct uae_prefs *p, const TCHAR *filename, int);
778 extern void cfgfile_parse_line (struct uae_prefs *p, TCHAR *, int);
779 extern void cfgfile_parse_lines (struct uae_prefs *p, const TCHAR *, int);
780 extern int cfgfile_parse_option (struct uae_prefs *p, const TCHAR *option, TCHAR *value, int);
781 extern int cfgfile_get_description (const TCHAR *filename, TCHAR *description, TCHAR *hostlink, TCHAR *hardwarelink, int *type);
782 extern void cfgfile_show_usage (void);
783 extern int cfgfile_searchconfig(const TCHAR *in, int index, TCHAR *out, int outsize);
784 extern uae_u32 cfgfile_uaelib (int mode, uae_u32 name, uae_u32 dst, uae_u32 maxlen);
785 extern uae_u32 cfgfile_uaelib_modify (uae_u32 mode, uae_u32 parms, uae_u32 size, uae_u32 out, uae_u32 outsize);
786 extern uae_u32 cfgfile_modify (uae_u32 index, const TCHAR *parms, uae_u32 size, TCHAR *out, uae_u32 outsize);
787 extern void cfgfile_addcfgparam (TCHAR *);
788 extern int built_in_prefs (struct uae_prefs *p, int model, int config, int compa, int romcheck);
789 extern int built_in_chipset_prefs (struct uae_prefs *p);
790 extern int built_in_cpuboard_prefs(struct uae_prefs *p);
791 extern int cmdlineparser (const TCHAR *s, TCHAR *outp[], int max);
792 extern int cfgfile_configuration_change (int);
793 extern void fixup_prefs_dimensions (struct uae_prefs *prefs);
794 extern void fixup_prefs (struct uae_prefs *prefs);
795 extern void fixup_cpu (struct uae_prefs *prefs);
796 bool cfgfile_board_enabled(struct uae_prefs *p, int romtype, int devnum);
797 
798 extern void check_prefs_changed_custom (void);
799 extern void check_prefs_changed_cpu (void);
800 extern void check_prefs_changed_audio (void);
801 extern void check_prefs_changed_cd (void);
802 extern int check_prefs_changed_gfx (void);
803 
804 extern struct uae_prefs currprefs, changed_prefs;
805 
806 extern int machdep_init (void);
807 extern void machdep_free (void);
808 
809 #endif /* UAE_OPTIONS_H */
810