OSDN Git Service

7a10e8acffcafc0fbbd20fe668c30e90efa4efe3
[csp-qt/common_source_project-fm7.git] / source / src / config.h
1 /*
2         Skelton for retropc emulator
3
4         Author : Takeda.Toshiya
5         Date   : 2006.08.18 -
6
7         [ config ]
8 */
9
10 #ifndef _CONFIG_H_
11 #define _CONFIG_H_
12
13 #include "vm/vm.h"
14 #include "fileio.h"
15 #if defined(_USE_QT)
16 #include "qt/gui/csp_logger.h"
17 #endif
18
19 #define MAX_HISTORY     8
20
21 #if defined(USE_CART2)
22 #define MAX_CART        2
23 #elif defined(USE_CART1)
24 #define MAX_CART        1
25 #endif
26
27 #if defined(USE_FD8)
28 #define MAX_FD          8
29 #elif defined(USE_FD7)
30 #define MAX_FD          7
31 #elif defined(USE_FD6)
32 #define MAX_FD          6
33 #elif defined(USE_FD5)
34 #define MAX_FD          5
35 #elif defined(USE_FD4)
36 #define MAX_FD          4
37 #elif defined(USE_FD3)
38 #define MAX_FD          3
39 #elif defined(USE_FD2)
40 #define MAX_FD          2
41 #elif defined(USE_FD1)
42 #define MAX_FD          1
43 #endif
44
45 #if defined(USE_QD2)
46 #define MAX_QD          2
47 #elif defined(USE_QD1)
48 #define MAX_QD          1
49 #endif
50
51 #if defined(USE_BINARY_FILE2)
52 #define MAX_BINARY      2
53 #elif defined(USE_BINARY_FILE1)
54 #define MAX_BINARY      1
55 #endif
56
57 void DLL_PREFIX initialize_config();
58 void DLL_PREFIX load_config(const _TCHAR* config_path);
59 void DLL_PREFIX save_config(const _TCHAR* config_path);
60 void DLL_PREFIX save_config_state(void *f);
61 bool DLL_PREFIX load_config_state(void *f);
62
63
64 /*
65  * 20160407 Ohta:
66  * Qt:
67  *  To reduce time to build, compiling common blocks of GUI at once.
68  *  So, you should not separate items with #ifdef.
69  */ 
70 typedef struct {
71         // control
72         int boot_mode;
73         int cpu_type;
74         int cpu_power;
75         uint32_t dipswitch;
76         int device_type;
77         int drive_type;
78         bool correct_disk_timing[16];
79         bool ignore_disk_crc[16];
80         bool tape_sound;
81         bool wave_shaper;
82         bool direct_load_mzt;
83         bool baud_high;
84         // recent files
85         _TCHAR initial_cart_dir[_MAX_PATH];
86         _TCHAR recent_cart_path[8][MAX_HISTORY][_MAX_PATH];
87         _TCHAR initial_floppy_disk_dir[_MAX_PATH];
88         _TCHAR recent_floppy_disk_path[16][MAX_HISTORY][_MAX_PATH];
89         _TCHAR initial_quick_disk_dir[_MAX_PATH];
90         _TCHAR recent_quick_disk_path[8][MAX_HISTORY][_MAX_PATH];
91         _TCHAR initial_tape_dir[_MAX_PATH];
92         _TCHAR recent_tape_path[MAX_HISTORY][_MAX_PATH];
93         _TCHAR initial_compact_disc_dir[_MAX_PATH];
94         _TCHAR recent_compact_disc_path[MAX_HISTORY][_MAX_PATH];
95         _TCHAR initial_laser_disc_dir[_MAX_PATH];
96         _TCHAR recent_laser_disc_path[MAX_HISTORY][_MAX_PATH];
97         _TCHAR initial_binary_dir[_MAX_PATH];
98         _TCHAR recent_binary_path[8][MAX_HISTORY][_MAX_PATH];
99         _TCHAR initial_bubble_casette_dir[_MAX_PATH];
100         _TCHAR recent_bubble_casette_path[16][MAX_HISTORY][_MAX_PATH];
101         // screen
102         int window_mode;
103 #ifdef _WIN32
104         bool use_d3d9;
105         bool wait_vsync;
106 #endif
107         int window_stretch_type;
108         int fullscreen_stretch_type;
109         int monitor_type;
110         bool crt_filter;
111         bool scan_line;
112         int rotate_type;
113 #ifdef _USE_QT
114         bool use_opengl_scanline;
115         bool opengl_scanline_vert;
116         bool opengl_scanline_horiz;
117         bool use_opengl_filters;
118         int opengl_filter_num;
119
120         bool swap_kanji_pause;
121 #endif  
122         
123         // sound
124         int sound_frequency;
125         int sound_latency;
126         
127         int general_sound_level;
128         int sound_device_type;
129         int sound_volume_l[32];
130         int sound_volume_r[32];
131         _TCHAR fmgen_dll_path[_MAX_PATH];
132         
133         // input
134 #ifdef _WIN32
135         bool use_direct_input;
136         bool disable_dwm;
137 #endif
138         int keyboard_type;
139         int joy_buttons[4][16];
140 #ifdef _USE_QT
141         _TCHAR assigned_joystick_name[16][256];
142
143         int video_width;
144         int video_height;
145         int video_codec_type;
146         int audio_codec_type;
147         
148         int video_h264_bitrate;
149         int video_h264_bframes;
150         int video_h264_b_adapt;
151         int video_h264_minq;
152         int video_h264_maxq;
153         int video_h264_subme;
154
155         int video_mpeg4_bitrate;
156         int video_mpeg4_bframes;
157         int video_mpeg4_minq;
158         int video_mpeg4_maxq;
159         
160         int video_threads;
161         int audio_bitrate;
162         int video_frame_rate; // FPS * 1000.0
163 #endif  
164         // printer
165         int printer_device_type;
166         _TCHAR printer_dll_path[_MAX_PATH];
167
168         // General
169 #ifdef _USE_QT
170         bool log_to_syslog;
171         bool log_to_console;
172         bool dev_log_to_syslog[CSP_LOG_TYPE_VM_DEVICE_END - CSP_LOG_TYPE_VM_DEVICE_0 + 1][8];
173         bool dev_log_to_console[CSP_LOG_TYPE_VM_DEVICE_END - CSP_LOG_TYPE_VM_DEVICE_0 + 1][8];
174         bool dev_log_recording[CSP_LOG_TYPE_VM_DEVICE_END - CSP_LOG_TYPE_VM_DEVICE_0 + 1][8];
175
176         int sound_fdd;
177         int sound_relay;
178         int sound_buttons;
179 #endif
180 } config_t;
181
182 extern config_t config;
183
184 #if defined(_USE_AGAR) || defined(_USE_QT)
185 # include <string>
186 #endif
187
188 #endif
189