1 /*
2   Hatari - options_cpu.h
3 
4   This file is distributed under the GNU General Public License, version 2
5   or at your option any later version. Read the file gpl.txt for details.
6 */
7 
8 #ifndef OPTIONS_CPU_H
9 #define OPTIONS_CPU_H
10 
11 #include "uae/types.h"
12 
13 //#include "traps.h"
14 
15 #ifndef WINUAE_FOR_HATARI
16 
17 
18 
19 #define UAEMAJOR 4
20 #define UAEMINOR 1
21 #define UAESUBREV 0
22 
23 #define MAX_AMIGADISPLAYS 4
24 
25 typedef enum { KBD_LANG_US, KBD_LANG_DK, KBD_LANG_DE, KBD_LANG_SE, KBD_LANG_FR, KBD_LANG_IT, KBD_LANG_ES } KbdLang;
26 
27 extern long int version;
28 
29 #define MAX_PATHS 8
30 
31 struct multipath {
32 	TCHAR path[MAX_PATHS][PATH_MAX];
33 };
34 
35 #define PATH_NONE -1
36 #define PATH_FLOPPY 0
37 #define PATH_CD 1
38 #define PATH_DIR 2
39 #define PATH_HDF 3
40 #define PATH_FS 4
41 #define PATH_TAPE 5
42 #define PATH_GENLOCK_IMAGE 6
43 #define PATH_GENLOCK_VIDEO 7
44 #define PATH_GEO 8
45 #define PATH_ROM 9
46 
47 struct strlist {
48 	struct strlist *next;
49 	TCHAR *option, *value;
50 	int unknown;
51 };
52 
53 #define MAX_TOTAL_SCSI_DEVICES 8
54 
55 /* maximum number native input devices supported (single type) */
56 #define MAX_INPUT_DEVICES 20
57 /* maximum number of native input device's buttons and axles supported */
58 #define MAX_INPUT_DEVICE_EVENTS 256
59 /* 4 different customization settings */
60 #define MAX_INPUT_SETTINGS 4
61 #define GAMEPORT_INPUT_SETTINGS 3 // last slot is for gameport panel mappings
62 
63 #define MAX_INPUT_SUB_EVENT 8
64 #define MAX_INPUT_SUB_EVENT_ALL 9
65 #define SPARE_SUB_EVENT 8
66 
67 #define INTERNALEVENT_COUNT 1
68 
69 #if 0
70 struct uae_input_device_event
71 {
72 	uae_s16 eventid[MAX_INPUT_SUB_EVENT_ALL];
73 	TCHAR *custom[MAX_INPUT_SUB_EVENT_ALL];
74 	uae_u64 flags[MAX_INPUT_SUB_EVENT_ALL];
75 	uae_u8 port[MAX_INPUT_SUB_EVENT_ALL];
76 	uae_s16 extra;
77 };
78 #endif
79 
80 struct uae_input_device {
81 	TCHAR *name;
82 	TCHAR *configname;
83 	uae_s16 eventid[MAX_INPUT_DEVICE_EVENTS][MAX_INPUT_SUB_EVENT_ALL];
84 	TCHAR *custom[MAX_INPUT_DEVICE_EVENTS][MAX_INPUT_SUB_EVENT_ALL];
85 	uae_u64 flags[MAX_INPUT_DEVICE_EVENTS][MAX_INPUT_SUB_EVENT_ALL];
86 	uae_s8 port[MAX_INPUT_DEVICE_EVENTS][MAX_INPUT_SUB_EVENT_ALL];
87 	uae_s16 extra[MAX_INPUT_DEVICE_EVENTS];
88 	uae_s8 enabled;
89 };
90 
91 #define MAX_JPORTS_CUSTOM 6
92 #define MAX_JPORTS 4
93 #define NORMAL_JPORTS 2
94 #define MAX_JPORT_NAME 128
95 #define MAX_JPORT_CONFIG 256
96 struct jport_custom {
97 	TCHAR custom[MAX_DPATH];
98 };
99 struct inputdevconfig {
100 	TCHAR name[MAX_JPORT_NAME];
101 	TCHAR configname[MAX_JPORT_CONFIG];
102 	TCHAR shortid[16];
103 };
104 struct jport {
105 	int id;
106 	int mode; // 0=def,1=mouse,2=joy,3=anajoy,4=lightpen
107 	int autofire;
108 	struct inputdevconfig idc;
109 	bool nokeyboardoverride;
110 	bool changed;
111 };
112 #define JPORT_UNPLUGGED -2
113 #define JPORT_NONE -1
114 
115 #define JPORT_AF_NORMAL 1
116 #define JPORT_AF_TOGGLE 2
117 #define JPORT_AF_ALWAYS 3
118 
119 #define KBTYPE_AMIGA 0
120 #define KBTYPE_PC1 1
121 #define KBTYPE_PC2 2
122 
123 #define MAX_SPARE_DRIVES 20
124 #define MAX_CUSTOM_MEMORY_ADDRS 2
125 
126 #define CONFIG_TYPE_ALL -1
127 #define CONFIG_TYPE_DEFAULT 0
128 #define CONFIG_TYPE_HARDWARE 1
129 #define CONFIG_TYPE_HOST 2
130 #define CONFIG_TYPE_NORESET 4
131 #define CONFIG_BLEN 2560
132 
133 #define MOUSEUNTRAP_NONE 0
134 #define MOUSEUNTRAP_MIDDLEBUTTON 1
135 #define MOUSEUNTRAP_MAGIC 2
136 #define MOUSEUNTRAP_BOTH 3
137 
138 #define TABLET_OFF 0
139 #define TABLET_MOUSEHACK 1
140 #define TABLET_REAL 2
141 
142 #ifdef WITH_SLIRP
143 #define MAX_SLIRP_REDIRS 32
144 struct slirp_redir
145 {
146 	int proto;
147 	int srcport;
148 	int dstport;
149 	unsigned long addr;
150 };
151 #endif
152 
153 struct cdslot
154 {
155 	TCHAR name[MAX_DPATH];
156 	bool inuse;
157 	bool delayed;
158 	bool temporary;
159 	int type;
160 };
161 struct floppyslot
162 {
163 	TCHAR df[MAX_DPATH];
164 	int dfxtype;
165 	int dfxclick;
166 	TCHAR dfxclickexternal[256];
167 	bool forcedwriteprotect;
168 };
169 
170 #define ASPECTMULT 1024
171 #define WH_NATIVE 1
172 struct wh {
173 	int x, y;
174 	int width, height;
175 	int special;
176 };
177 
178 #define MOUNT_CONFIG_SIZE 30
179 #define UAEDEV_DIR 0
180 #define UAEDEV_HDF 1
181 #define UAEDEV_CD 2
182 #define UAEDEV_TAPE 3
183 
184 #define HD_LEVEL_SCSI_1 0
185 #define HD_LEVEL_SCSI_2 1
186 #define HD_LEVEL_SASI 2
187 #define HD_LEVEL_SASI_ENHANCED 2
188 #define HD_LEVEL_SASI_CHS 3
189 
190 #define HD_LEVEL_ATA_1 0
191 #define HD_LEVEL_ATA_2 1
192 #define HD_LEVEL_ATA_2S 2
193 
194 #define BOOTPRI_NOAUTOBOOT -128
195 #define BOOTPRI_NOAUTOMOUNT -129
196 #define ISAUTOBOOT(ci) ((ci)->bootpri > BOOTPRI_NOAUTOBOOT)
197 #define ISAUTOMOUNT(ci) ((ci)->bootpri > BOOTPRI_NOAUTOMOUNT)
198 #define MAX_UAEDEV_BADBLOCKS 8
199 struct uaedev_badblock
200 {
201 	uae_u32 first;
202 	uae_u32 last;
203 };
204 struct uaedev_config_info {
205 	int type;
206 	TCHAR devname[MAX_DPATH];
207 	TCHAR volname[MAX_DPATH];
208 	TCHAR rootdir[MAX_DPATH];
209 	bool readonly;
210 	bool lock;
211 	bool loadidentity;
212 	int bootpri;
213 	TCHAR filesys[MAX_DPATH];
214 	TCHAR geometry[MAX_DPATH];
215 	int lowcyl;
216 	int highcyl; // zero if detected from size
217 	int cyls; // calculated/corrected highcyl
218 	int surfaces;
219 	int sectors;
220 	int reserved;
221 	int blocksize;
222 	bool chs;
223 	uae_u64 max_lba;
224 	int controller_type;
225 	int controller_type_unit;
226 	int controller_unit;
227 	int controller_media_type; // 1 = CF IDE, 0 = normal
228 	int unit_feature_level;
229 	int unit_special_flags;
230 	bool physical_geometry; // if false: use defaults
231 	int pcyls, pheads, psecs;
232 	int flags;
233 	int buffers;
234 	int bufmemtype;
235 	int stacksize;
236 	int priority;
237 	uae_u32 mask;
238 	int maxtransfer;
239 	uae_u32 dostype;
240 	int unit;
241 	int interleave;
242 	int sectorsperblock;
243 	int forceload;
244 	int device_emu_unit;
245 	bool inject_icons;
246 	int badblock_num;
247 	struct uaedev_badblock badblocks[MAX_UAEDEV_BADBLOCKS];
248 	int uae_unitnum; // mountunit nr
249 };
250 
251 struct uaedev_config_data
252 {
253 	struct uaedev_config_info ci;
254 	int configoffset; // HD config entry index
255 	int unitnum; // scsi unit number (if tape currently)
256 };
257 
258 enum { CP_GENERIC = 1, CP_CDTV, CP_CDTVCR, CP_CD32, CP_A500, CP_A500P, CP_A600,
259 	CP_A1000, CP_A1200, CP_A2000, CP_A3000, CP_A3000T, CP_A4000, CP_A4000T,
260 	CP_VELVET, CP_CASABLANCA, CP_DRACO };
261 
262 #define IDE_A600A1200 1
263 #define IDE_A4000 2
264 
265 #define GFX_WINDOW 0
266 #define GFX_FULLSCREEN 1
267 #define GFX_FULLWINDOW 2
268 
269 #define AUTOSCALE_NONE 0
270 #define AUTOSCALE_STATIC_AUTO 1
271 #define AUTOSCALE_STATIC_NOMINAL 2
272 #define AUTOSCALE_STATIC_MAX 3
273 #define AUTOSCALE_NORMAL 4
274 #define AUTOSCALE_RESIZE 5
275 #define AUTOSCALE_CENTER 6
276 #define AUTOSCALE_MANUAL 7 // use gfx_xcenter_pos and gfx_ycenter_pos
277 #define AUTOSCALE_INTEGER 8
278 #define AUTOSCALE_INTEGER_AUTOSCALE 9
279 #define AUTOSCALE_SEPARATOR 10
280 #define AUTOSCALE_OVERSCAN_BLANK 11
281 
282 #define MONITOREMU_NONE 0
283 #define MONITOREMU_AUTO 1
284 #define MONITOREMU_A2024 2
285 #define MONITOREMU_GRAFFITI 3
286 #define MONITOREMU_HAM_E 4
287 #define MONITOREMU_HAM_E_PLUS 5
288 #define MONITOREMU_VIDEODAC18 6
289 #define MONITOREMU_AVIDEO12 7
290 #define MONITOREMU_AVIDEO24 8
291 #define MONITOREMU_FIRECRACKER24 9
292 #define MONITOREMU_DCTV 10
293 #define MONITOREMU_OPALVISION 11
294 #define MONITOREMU_COLORBURST 12
295 
296 #define MAX_FILTERSHADERS 4
297 
298 #define MAX_CHIPSET_REFRESH 10
299 #define MAX_CHIPSET_REFRESH_TOTAL (MAX_CHIPSET_REFRESH + 2)
300 #define CHIPSET_REFRESH_PAL (MAX_CHIPSET_REFRESH + 0)
301 #define CHIPSET_REFRESH_NTSC (MAX_CHIPSET_REFRESH + 1)
302 struct chipset_refresh
303 {
304 	bool inuse;
305 	int index;
306 	bool locked;
307 	bool rtg;
308 	bool exit;
309 	bool defaultdata;
310 	int horiz;
311 	int vert;
312 	int lace;
313 	int resolution;
314 	int resolution_pct;
315 	int ntsc;
316 	int vsync;
317 	int framelength;
318 	double rate;
319 	TCHAR label[16];
320 	TCHAR commands[256];
321 	TCHAR filterprofile[64];
322 };
323 
324 #define APMODE_NATIVE 0
325 #define APMODE_RTG 1
326 
327 struct apmode
328 {
329 	int gfx_fullscreen;
330 	int gfx_display;
331 	int gfx_vsync;
332 	// 0 = immediate flip
333 	// -1 = wait for flip, before frame ends
334 	// 1 = wait for flip, after new frame has started
335 	int gfx_vflip;
336 	// doubleframemode strobo
337 	bool gfx_strobo;
338 	int gfx_vsyncmode;
339 	int gfx_backbuffers;
340 	bool gfx_interlaced;
341 	int gfx_refreshrate;
342 };
343 
344 #define MAX_LUA_STATES 16
345 
346 
347 struct gfx_filterdata
348 {
349 	int gfx_filter;
350 	TCHAR gfx_filtershader[2 * MAX_FILTERSHADERS + 1][MAX_DPATH];
351 	TCHAR gfx_filtermask[2 * MAX_FILTERSHADERS + 1][MAX_DPATH];
352 	TCHAR gfx_filteroverlay[MAX_DPATH];
353 	struct wh gfx_filteroverlay_pos;
354 	int gfx_filteroverlay_overscan;
355 	int gfx_filter_scanlines;
356 	int gfx_filter_scanlineratio;
357 	int gfx_filter_scanlinelevel;
358 	int gfx_filter_scanlineoffset;
359 	float gfx_filter_horiz_zoom, gfx_filter_vert_zoom;
360 	float gfx_filter_horiz_zoom_mult, gfx_filter_vert_zoom_mult;
361 	float gfx_filter_horiz_offset, gfx_filter_vert_offset;
362 	int gfx_filter_left_border, gfx_filter_right_border;
363 	int gfx_filter_top_border, gfx_filter_bottom_border;
364 	int gfx_filter_filtermode;
365 	int gfx_filter_bilinear;
366 	int gfx_filter_noise, gfx_filter_blur;
367 	int gfx_filter_saturation, gfx_filter_luminance, gfx_filter_contrast;
368 	int gfx_filter_gamma, gfx_filter_gamma_ch[3];
369 	int gfx_filter_keep_aspect, gfx_filter_aspect;
370 	int gfx_filter_autoscale;
371 	int gfx_filter_integerscalelimit;
372 	int gfx_filter_keep_autoscale_aspect;
373 };
374 
375 #define MAX_DUPLICATE_EXPANSION_BOARDS 4
376 #define MAX_EXPANSION_BOARDS 20
377 #define ROMCONFIG_CONFIGTEXT_LEN 256
378 struct boardromconfig;
379 struct romconfig
380 {
381 	TCHAR romfile[MAX_DPATH];
382 	TCHAR romident[256];
383 	uae_u32 board_ram_size;
384 	bool autoboot_disabled;
385 	int device_id;
386 	int device_settings;
387 	int subtype;
388 	void *unitdata;
389 	TCHAR configtext[ROMCONFIG_CONFIGTEXT_LEN];
390 	uae_u16 manufacturer;
391 	uae_u8 product;
392 	uae_u8 autoconfig[16];
393 	struct boardromconfig *back;
394 };
395 #define MAX_BOARD_ROMS 2
396 struct boardromconfig
397 {
398 	int device_type;
399 	int device_num;
400 	int device_order;
401 	struct romconfig roms[MAX_BOARD_ROMS];
402 };
403 #define MAX_RTG_BOARDS 4
404 struct rtgboardconfig
405 {
406 	int rtg_index;
407 	int rtgmem_type;
408 	uae_u32 rtgmem_size;
409 	int device_order;
410 	int monitor_id;
411 };
412 #define MAX_RAM_BOARDS 4
413 struct ramboard
414 {
415 	uae_u32 size;
416 	uae_u16 manufacturer;
417 	uae_u8 product;
418 	uae_u8 autoconfig[16];
419 	bool autoconfig_inuse;
420 	bool manual_config;
421 	bool no_reset_unmap;
422 	int device_order;
423 	uae_u32 start_address;
424 	uae_u32 end_address;
425 	uae_u32 write_address;
426 	bool readonly;
427 	uae_u32 loadoffset;
428 	uae_u32 fileoffset, filesize;
429 	TCHAR loadfile[MAX_DPATH];
430 };
431 struct expansion_params
432 {
433 	int device_order;
434 };
435 
436 #define Z3MAPPING_AUTO 0
437 #define Z3MAPPING_UAE 1
438 #define Z3MAPPING_REAL 2
439 
440 struct monconfig
441 {
442 	struct wh gfx_size_win;
443 	struct wh gfx_size_fs;
444 	struct wh gfx_size;
445 	struct wh gfx_size_win_xtra[6];
446 	struct wh gfx_size_fs_xtra[6];
447 };
448 
449 
450 #endif		/* !WINUAE_FOR_HATARI */
451 
452 struct uae_prefs {
453 #ifndef WINUAE_FOR_HATARI
454 	struct strlist *all_lines;
455 
456 	TCHAR description[256];
457 	TCHAR category[256];
458 	TCHAR tags[256];
459 	TCHAR info[256];
460 	int config_version;
461 	TCHAR config_hardware_path[MAX_DPATH];
462 	TCHAR config_host_path[MAX_DPATH];
463 	TCHAR config_all_path[MAX_DPATH];
464 	TCHAR config_path[MAX_DPATH];
465 	TCHAR config_window_title[256];
466 
467 	bool illegal_mem;
468 	bool use_serial;
469 	bool serial_demand;
470 	bool serial_hwctsrts;
471 	bool serial_direct;
472 	int serial_stopbits;
473 	int serial_crlf;
474 	bool parallel_demand;
475 	int parallel_matrix_emulation;
476 	bool parallel_postscript_emulation;
477 	bool parallel_postscript_detection;
478 	int parallel_autoflush_time;
479 	TCHAR ghostscript_parameters[256];
480 	bool use_gfxlib;
481 	bool socket_emu;
482 
483 	bool start_debugger;
484 	int debugging_features;
485 	TCHAR debugging_options[MAX_DPATH];
486 	bool start_gui;
487 
488 	KbdLang keyboard_lang;
489 
490 	int produce_sound;
491 	int sound_stereo;
492 	int sound_stereo_separation;
493 	int sound_mixed_stereo_delay;
494 	int sound_freq;
495 	int sound_maxbsiz;
496 	int sound_interpol;
497 	int sound_filter;
498 	int sound_filter_type;
499 	int sound_volume_master;
500 	int sound_volume_paula;
501 	int sound_volume_cd;
502 	int sound_volume_board;
503 	int sound_volume_midi;
504 	int sound_volume_genlock;
505 	bool sound_stereo_swap_paula;
506 	bool sound_stereo_swap_ahi;
507 	bool sound_auto;
508 	bool sound_cdaudio;
509 
510 	int sampler_freq;
511 	int sampler_buffer;
512 	bool sampler_stereo;
513 #endif
514 
515 	int comptrustbyte;
516 	int comptrustword;
517 	int comptrustlong;
518 	int comptrustnaddr;
519 	bool compnf;
520 	bool compfpu;
521 	bool comp_hardflush;
522 	bool comp_constjump;
523 	bool comp_catchfault;
524 	int cachesize;
525 	bool fpu_strict;
526 	int fpu_mode;
527 
528 #ifndef WINUAE_FOR_HATARI
529 	struct monconfig gfx_monitor[MAX_AMIGADISPLAYS];
530 	int gfx_framerate, gfx_autoframerate;
531 	bool gfx_autoresolution_vga;
532 	int gfx_autoresolution;
533 	int gfx_autoresolution_delay;
534 	int gfx_autoresolution_minv, gfx_autoresolution_minh;
535 	bool gfx_scandoubler;
536 	struct apmode gfx_apmode[2];
537 	int gfx_resolution;
538 	int gfx_vresolution;
539 	int gfx_lores_mode;
540 	int gfx_pscanlines, gfx_iscanlines;
541 	int gfx_xcenter, gfx_ycenter;
542 	int gfx_xcenter_pos, gfx_ycenter_pos;
543 	int gfx_xcenter_size, gfx_ycenter_size;
544 	int gfx_max_horizontal, gfx_max_vertical;
545 	int gfx_saturation, gfx_luminance, gfx_contrast, gfx_gamma, gfx_gamma_ch[3];
546 	bool gfx_blackerthanblack;
547 	int gfx_threebitcolors;
548 	int gfx_api;
549 	int gfx_api_options;
550 	int color_mode;
551 	int gfx_extrawidth;
552 	bool lightboost_strobo;
553 	int lightboost_strobo_ratio;
554 	bool gfx_grayscale;
555 	bool lightpen_crosshair;
556 	int lightpen_offset[2];
557 	int gfx_display_sections;
558 	int gfx_variable_sync;
559 	bool gfx_windowed_resize;
560 
561 	struct gfx_filterdata gf[2];
562 
563 	float rtg_horiz_zoom_mult;
564 	float rtg_vert_zoom_mult;
565 
566 	bool immediate_blits;
567 	int waiting_blits;
568 	double blitter_speed_throttle;
569 	unsigned int chipset_mask;
570 	bool chipset_hr;
571 	bool keyboard_connected;
572 #endif
573 	bool ntscmode;
574 #ifndef WINUAE_FOR_HATARI
575 	bool genlock;
576 	int genlock_image;
577 	int genlock_mix;
578 	int genlock_scale;
579 	int genlock_aspect;
580 	bool genlock_alpha;
581 	TCHAR genlock_image_file[MAX_DPATH];
582 	TCHAR genlock_video_file[MAX_DPATH];
583 	int monitoremu;
584 	int monitoremu_mon;
585 	double chipset_refreshrate;
586 	struct chipset_refresh cr[MAX_CHIPSET_REFRESH + 2];
587 	int cr_selected;
588 	int collision_level;
589 	int leds_on_screen;
590 	int leds_on_screen_mask[2];
591 	int power_led_dim;
592 	struct wh osd_pos;
593 	int keyboard_leds[3];
594 	bool keyboard_leds_in_use;
595 	int scsi;
596 	bool sana2;
597 	bool uaeserial;
598 	int catweasel;
599 #endif
600 	int cpu_idle;
601 	int ppc_cpu_idle;
602 	bool cpu_cycle_exact;
603 	int cpu_clock_multiplier;
604 	int cpu_frequency;
605 	bool blitter_cycle_exact;
606 	bool cpu_memory_cycle_exact;
607 #ifndef WINUAE_FOR_HATARI
608 	int floppy_speed;
609 	int floppy_write_length;
610 	int floppy_random_bits_min;
611 	int floppy_random_bits_max;
612 	int floppy_auto_ext2;
613 	int cd_speed;
614 	bool tod_hack;
615 	uae_u32 maprom;
616 	int boot_rom;
617 	bool rom_readwrite;
618 	int turbo_emulation;
619 	int turbo_emulation_limit;
620 	bool headless;
621 	int filesys_limit;
622 	int filesys_max_name;
623 	int filesys_max_file_size;
624 	bool filesys_inject_icons;
625 	TCHAR filesys_inject_icons_tool[MAX_DPATH];
626 	TCHAR filesys_inject_icons_project[MAX_DPATH];
627 	TCHAR filesys_inject_icons_drawer[MAX_DPATH];
628 	int uaescsidevmode;
629 #endif
630 	bool reset_delay;
631 
632 #ifndef WINUAE_FOR_HATARI
633 	int cs_compatible;
634 	int cs_ciaatod;
635 	int cs_rtc;
636 	int cs_rtc_adjust;
637 	int cs_rtc_adjust_mode;
638 	bool cs_ksmirror_e0;
639 	bool cs_ksmirror_a8;
640 	bool cs_ciaoverlay;
641 	bool cs_cd32cd;
642 	bool cs_cd32c2p;
643 	bool cs_cd32nvram;
644 	bool cs_cd32fmv;
645 	int cs_cd32nvram_size;
646 	bool cs_cdtvcd;
647 	bool cs_cdtvram;
648 	int cs_ide;
649 	bool cs_pcmcia;
650 	bool cs_a1000ram;
651 	int cs_fatgaryrev;
652 	int cs_ramseyrev;
653 	int cs_agnusrev;
654 	int cs_deniserev;
655 	int cs_mbdmac;
656 	bool cs_cdtvcr;
657 	bool cs_df0idhw;
658 	bool cs_slowmemisfast;
659 	bool cs_resetwarning;
660 	bool cs_denisenoehb;
661 	bool cs_dipagnus;
662 	bool cs_agnusbltbusybug;
663 	bool cs_ciatodbug;
664 	bool cs_z3autoconfig;
665 	bool cs_1mchipjumper;
666 	bool cs_cia6526;
667 	bool cs_bytecustomwritebug;
668 	bool cs_color_burst;
669 	bool cs_romisslow;
670 	bool cs_toshibagary;
671 	int cs_unmapped_space;
672 	int cs_hacks;
673 	int cs_ciatype[2];
674 
675 	struct boardromconfig expansionboard[MAX_EXPANSION_BOARDS];
676 
677 	TCHAR romfile[MAX_DPATH];
678 	TCHAR romident[256];
679 	TCHAR romextfile[MAX_DPATH];
680 	uae_u32 romextfile2addr;
681 	TCHAR romextfile2[MAX_DPATH];
682 	TCHAR romextident[256];
683 	TCHAR flashfile[MAX_DPATH];
684 	TCHAR rtcfile[MAX_DPATH];
685 	TCHAR cartfile[MAX_DPATH];
686 	TCHAR cartident[256];
687 	int cart_internal;
688 	TCHAR pci_devices[256];
689 	TCHAR prtname[256];
690 	TCHAR sername[256];
691 	TCHAR a2065name[MAX_DPATH];
692 	TCHAR ne2000pciname[MAX_DPATH];
693 	TCHAR ne2000pcmcianame[MAX_DPATH];
694 	TCHAR picassoivromfile[MAX_DPATH];
695 	struct cdslot cdslots[MAX_TOTAL_SCSI_DEVICES];
696 	TCHAR quitstatefile[MAX_DPATH];
697 	TCHAR statefile[MAX_DPATH];
698 	TCHAR inprecfile[MAX_DPATH];
699 	bool inprec_autoplay;
700 	bool refresh_indicator;
701 
702 	struct multipath path_floppy;
703 	struct multipath path_hardfile;
704 	struct multipath path_rom;
705 	struct multipath path_cd;
706 #endif
707 
708 	int m68k_speed;
709 	double m68k_speed_throttle;
710 	double x86_speed_throttle;
711 	int cpu_level;				/* Hatari */
712 	int cpu_model;
713 	int mmu_model;
714 	bool mmu_ec;
715 	int cpu060_revision;
716 	int fpu_model;
717 	int fpu_revision;
718 	int ppc_mode;
719 	TCHAR ppc_model[32];
720 	bool cpu_compatible;
721 	bool cpu_thread;
722 	bool int_no_unimplemented;
723 	bool fpu_no_unimplemented;
724 	bool address_space_24;
725 	bool cpu_data_cache;
726 	bool picasso96_nocustom;
727 	int picasso96_modeflags;
728 	int cpu_model_fallback;
729 
730 #ifndef WINUAE_FOR_HATARI
731 	uae_u32 z3autoconfig_start;
732 	struct ramboard z3fastmem[MAX_RAM_BOARDS];
733 	struct ramboard fastmem[MAX_RAM_BOARDS];
734 	uae_u32 z3chipmem_size;
735 	uae_u32 z3chipmem_start;
736 	uae_u32 chipmem_size;
737 	uae_u32 bogomem_size;
738 	uae_u32 mbresmem_low_size;
739 	uae_u32 mbresmem_high_size;
740 	uae_u32 mem25bit_size;
741 	uae_u32 debugmem_start;
742 	uae_u32 debugmem_size;
743 	int cpuboard_type;
744 	int cpuboard_subtype;
745 	int cpuboard_settings;
746 	uae_u32 cpuboardmem1_size;
747 	uae_u32 cpuboardmem2_size;
748 	int ppc_implementation;
749 	bool rtg_hardwareinterrupt;
750 	bool rtg_hardwaresprite;
751 	bool rtg_more_compatible;
752 	bool rtg_multithread;
753 	struct rtgboardconfig rtgboards[MAX_RTG_BOARDS];
754 	uae_u32 custom_memory_addrs[MAX_CUSTOM_MEMORY_ADDRS];
755 	uae_u32 custom_memory_sizes[MAX_CUSTOM_MEMORY_ADDRS];
756 	uae_u32 custom_memory_mask[MAX_CUSTOM_MEMORY_ADDRS];
757 	int uaeboard;
758 	bool uaeboard_nodiag;
759 	int uaeboard_order;
760 
761 	bool kickshifter;
762 	bool filesys_no_uaefsdb;
763 	bool filesys_custom_uaefsdb;
764 	bool mmkeyboard;
765 	int uae_hide;
766 	bool clipboard_sharing;
767 	bool native_code;
768 	bool uae_hide_autoconfig;
769 	int z3_mapping_mode;
770 	bool autoconfig_custom_sort;
771 	bool obs_sound_toccata;
772 	bool obs_sound_toccata_mixer;
773 	bool obs_sound_es1370;
774 	bool obs_sound_fm801;
775 
776 	int mountitems;
777 	struct uaedev_config_data mountconfig[MOUNT_CONFIG_SIZE];
778 
779 	int nr_floppies;
780 	struct floppyslot floppyslots[4];
781 	bool floppy_read_only;
782 	bool harddrive_read_only;
783 	TCHAR dfxlist[MAX_SPARE_DRIVES][MAX_DPATH];
784 	int dfxclickvolume_disk[4];
785 	int dfxclickvolume_empty[4];
786 	int dfxclickchannelmask;
787 
788 	TCHAR luafiles[MAX_LUA_STATES][MAX_DPATH];
789 
790 	/* Target specific options */
791 
792 	bool win32_logfile;
793 	bool win32_notaskbarbutton;
794 	bool win32_nonotificationicon;
795 	bool win32_gui_alwaysontop;
796 	bool win32_main_alwaysontop;
797 	bool win32_powersavedisabled;
798 	bool win32_minimize_inactive;
799 	bool win32_capture_always;
800 	int win32_statusbar;
801 	bool win32_start_minimized;
802 	bool win32_start_uncaptured;
803 
804 	int win32_active_capture_priority;
805 	bool win32_active_nocapture_pause;
806 	bool win32_active_nocapture_nosound;
807 	int win32_inactive_priority;
808 	bool win32_inactive_pause;
809 	bool win32_inactive_nosound;
810 	int win32_inactive_input;
811 	int win32_iconified_priority;
812 	bool win32_iconified_pause;
813 	bool win32_iconified_nosound;
814 	int win32_iconified_input;
815 
816 	bool win32_rtgmatchdepth;
817 	bool win32_rtgallowscaling;
818 	int win32_rtgscaleaspectratio;
819 	int win32_rtgvblankrate;
820 	bool win32_borderless;
821 	bool win32_ctrl_F11_is_quit;
822 	bool win32_automount_removable;
823 	bool win32_automount_drives;
824 	bool win32_automount_cddrives;
825 	bool win32_automount_netdrives;
826 	bool win32_automount_removabledrives;
827 	int win32_midioutdev;
828 	int win32_midiindev;
829 	bool win32_midirouter;
830 	int win32_uaescsimode;
831 	int win32_soundcard;
832 	int win32_samplersoundcard;
833 	bool win32_norecyclebin;
834 	int win32_guikey;
835 	int win32_kbledmode;
836 	bool win32_blankmonitors;
837 	TCHAR win32_commandpathstart[MAX_DPATH];
838 	TCHAR win32_commandpathend[MAX_DPATH];
839 	TCHAR win32_parjoyport0[MAX_DPATH];
840 	TCHAR win32_parjoyport1[MAX_DPATH];
841 	TCHAR win32_guipage[32];
842 	TCHAR win32_guiactivepage[32];
843 	bool win32_filesystem_mangle_reserved_names;
844 	bool win32_shutdown_notification;
845 	bool win32_warn_exit;
846 	bool right_control_is_right_win_key;
847 #ifdef WITH_SLIRP
848 	struct slirp_redir slirp_redirs[MAX_SLIRP_REDIRS];
849 #endif
850 	int statecapturerate, statecapturebuffersize;
851 	int aviout_width, aviout_height, aviout_xoffset, aviout_yoffset;
852 	int screenshot_width, screenshot_height, screenshot_xoffset, screenshot_yoffset;
853 	int screenshot_min_width, screenshot_min_height;
854 	int screenshot_max_width, screenshot_max_height;
855 	int screenshot_output_width, screenshot_output_height;
856 	int screenshot_xmult, screenshot_ymult;
857 
858 	/* input */
859 
860 	struct jport jports[MAX_JPORTS];
861 	struct jport_custom jports_custom[MAX_JPORTS_CUSTOM];
862 	int input_selected_setting;
863 	int input_joymouse_multiplier;
864 	int input_joymouse_deadzone;
865 	int input_joystick_deadzone;
866 	int input_joymouse_speed;
867 	int input_analog_joystick_mult;
868 	int input_analog_joystick_offset;
869 	int input_autofire_linecnt;
870 	int input_mouse_speed;
871 	int input_tablet;
872 	bool tablet_library;
873 	int input_mouse_untrap;
874 	int input_magic_mouse_cursor;
875 	int input_keyboard_type;
876 	int input_autoswitch;
877 	struct uae_input_device joystick_settings[MAX_INPUT_SETTINGS][MAX_INPUT_DEVICES];
878 	struct uae_input_device mouse_settings[MAX_INPUT_SETTINGS][MAX_INPUT_DEVICES];
879 	struct uae_input_device keyboard_settings[MAX_INPUT_SETTINGS][MAX_INPUT_DEVICES];
880 	struct uae_input_device internalevent_settings[MAX_INPUT_SETTINGS][INTERNALEVENT_COUNT];
881 	TCHAR input_config_name[GAMEPORT_INPUT_SETTINGS][256];
882 	int dongle;
883 	int input_contact_bounce;
884 	int input_device_match_mask;
885 #endif
886 };
887 
888 #ifndef WINUAE_FOR_HATARI
889 extern int config_changed;
890 extern void config_check_vsync (void);
891 extern void set_config_changed (void);
892 
893 /* Contains the filename of .uaerc */
894 extern TCHAR optionsfile[];
895 extern void save_options (struct zfile *, struct uae_prefs *, int);
896 
897 extern void cfgfile_write (struct zfile *, const TCHAR *option, const TCHAR *format,...);
898 extern void cfgfile_dwrite (struct zfile *, const TCHAR *option, const TCHAR *format,...);
899 extern void cfgfile_target_write (struct zfile *, const TCHAR *option, const TCHAR *format,...);
900 extern void cfgfile_target_dwrite (struct zfile *, const TCHAR *option, const TCHAR *format,...);
901 
902 extern void cfgfile_write_bool (struct zfile *f, const TCHAR *option, bool b);
903 extern void cfgfile_dwrite_bool (struct zfile *f,const  TCHAR *option, bool b);
904 extern void cfgfile_target_write_bool (struct zfile *f, const TCHAR *option, bool b);
905 extern void cfgfile_target_dwrite_bool (struct zfile *f, const TCHAR *option, bool b);
906 
907 extern void cfgfile_write_str (struct zfile *f, const TCHAR *option, const TCHAR *value);
908 extern void cfgfile_dwrite_str (struct zfile *f, const TCHAR *option, const TCHAR *value);
909 extern void cfgfile_target_write_str (struct zfile *f, const TCHAR *option, const TCHAR *value);
910 extern void cfgfile_target_dwrite_str (struct zfile *f, const TCHAR *option, const TCHAR *value);
911 
912 extern void cfgfile_backup (const TCHAR *path);
913 extern struct uaedev_config_data *add_filesys_config (struct uae_prefs *p, int index, struct uaedev_config_info*);
914 extern bool get_hd_geometry (struct uaedev_config_info *);
915 extern void uci_set_defaults (struct uaedev_config_info *uci, bool rdb);
916 
917 extern void error_log (const TCHAR*, ...);
918 extern TCHAR *get_error_log (void);
919 extern bool is_error_log (void);
920 
921 extern void default_prefs (struct uae_prefs *, bool, int);
922 extern void discard_prefs (struct uae_prefs *, int);
923 extern void copy_prefs(struct uae_prefs *src, struct uae_prefs *dst);
924 
925 int parse_cmdline_option (struct uae_prefs *, TCHAR, const TCHAR*);
926 
927 extern int cfgfile_yesno (const TCHAR *option, const TCHAR *value, const TCHAR *name, bool *location);
928 extern int cfgfile_intval (const TCHAR *option, const TCHAR *value, const TCHAR *name, int *location, int scale);
929 extern int cfgfile_strval (const TCHAR *option, const TCHAR *value, const TCHAR *name, int *location, const TCHAR *table[], int more);
930 extern int cfgfile_string (const TCHAR *option, const TCHAR *value, const TCHAR *name, TCHAR *location, int maxsz);
931 extern bool cfgfile_option_find(const TCHAR *s, const TCHAR *option);
932 extern TCHAR *cfgfile_option_get(const TCHAR *s, const TCHAR *option);
933 extern TCHAR *cfgfile_subst_path (const TCHAR *path, const TCHAR *subst, const TCHAR *file);
934 
935 extern TCHAR *target_expand_environment (const TCHAR *path, TCHAR *out, int maxlen);
936 extern int target_parse_option (struct uae_prefs *, const TCHAR *option, const TCHAR *value);
937 extern void target_save_options (struct zfile*, struct uae_prefs *);
938 extern void target_default_options (struct uae_prefs *, int type);
939 extern void target_fixup_options (struct uae_prefs *);
940 extern int target_cfgfile_load (struct uae_prefs *, const TCHAR *filename, int type, int isdefault);
941 extern void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type);
942 extern int target_get_display (const TCHAR*);
943 extern const TCHAR *target_get_display_name (int, bool);
944 extern void target_multipath_modified(struct uae_prefs *);
945 extern void cfgfile_resolve_path_out_load(const TCHAR *path, TCHAR *out, int size, int type);
946 extern void cfgfile_resolve_path_load(TCHAR *path, int size, int type);
947 extern void cfgfile_resolve_path_out_save(const TCHAR *path, TCHAR *out, int size, int type);
948 extern void cfgfile_resolve_path_save(TCHAR *path, int size, int type);
949 
950 extern struct uae_prefs *cfgfile_open(const TCHAR *filename, int *type);
951 extern void cfgfile_close(struct uae_prefs *p);
952 extern int cfgfile_load (struct uae_prefs *p, const TCHAR *filename, int *type, int ignorelink, int userconfig);
953 extern int cfgfile_save (struct uae_prefs *p, const TCHAR *filename, int);
954 extern void cfgfile_parse_line (struct uae_prefs *p, TCHAR *, int);
955 extern void cfgfile_parse_lines (struct uae_prefs *p, const TCHAR *, int);
956 extern int cfgfile_parse_option (struct uae_prefs *p, const TCHAR *option, TCHAR *value, int);
957 extern int cfgfile_get_description (struct uae_prefs *p, const TCHAR *filename, TCHAR *description, TCHAR *category, TCHAR *tags, TCHAR *hostlink, TCHAR *hardwarelink, int *type);
958 extern void cfgfile_show_usage (void);
959 extern int cfgfile_searchconfig(const TCHAR *in, int index, TCHAR *out, int outsize);
960 extern uae_u32 cfgfile_uaelib(TrapContext *ctx, int mode, uae_u32 name, uae_u32 dst, uae_u32 maxlen);
961 extern uae_u32 cfgfile_uaelib_modify(TrapContext *ctx, uae_u32 mode, uae_u32 parms, uae_u32 size, uae_u32 out, uae_u32 outsize);
962 extern uae_u32 cfgfile_modify (uae_u32 index, const TCHAR *parms, uae_u32 size, TCHAR *out, uae_u32 outsize);
963 extern void cfgfile_addcfgparam (TCHAR *);
964 extern int built_in_prefs (struct uae_prefs *p, int model, int config, int compa, int romcheck);
965 extern int built_in_chipset_prefs (struct uae_prefs *p);
966 extern int built_in_cpuboard_prefs(struct uae_prefs *p);
967 extern int cmdlineparser (const TCHAR *s, TCHAR *outp[], int max);
968 extern void fixup_prefs_dimensions (struct uae_prefs *prefs);
969 extern void fixup_prefs (struct uae_prefs *prefs, bool userconfig);
970 extern void fixup_cpu (struct uae_prefs *prefs);
971 extern void cfgfile_compatibility_romtype(struct uae_prefs *p);
972 extern void cfgfile_compatibility_rtg(struct uae_prefs *p);
973 extern bool cfgfile_detect_art(struct uae_prefs *p, TCHAR *path);
974 extern const TCHAR *cfgfile_getconfigdata(int *len);
975 extern bool cfgfile_createconfigstore(struct uae_prefs *p);
976 
977 extern void check_prefs_changed_custom (void);
978 extern void check_prefs_changed_cpu (void);
979 extern void check_prefs_changed_audio (void);
980 extern void check_prefs_changed_cd (void);
981 extern int check_prefs_changed_gfx (void);
982 
983 extern struct uae_prefs currprefs, changed_prefs;
984 
985 extern int machdep_init (void);
986 extern void machdep_free (void);
987 
988 #else		/* !WINUAE_FOR_HATARI */
989 
990 extern struct uae_prefs currprefs, changed_prefs;
991 extern void fixup_cpu (struct uae_prefs *prefs);
992 extern void check_prefs_changed_cpu (void);
993 extern void error_log (const TCHAR*, ...);
994 
995 #endif
996 
997 #endif /* OPTIONS_CPU_H */
998