OSDN Git Service

[General][Qt] Fix FTBFSs.
[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 enum {
20         CONFIG_RENDER_TYPE_STD = 0,
21         CONFIG_RENDER_TYPE_TV,
22         CONFIG_RENDER_TYPE_END
23 };
24 enum {
25         CONFIG_RENDER_PLATFORM_OPENGL_MAIN = 0,
26         CONFIG_RENDER_PLATFORM_OPENGL_CORE = 1,
27         CONFIG_RENDER_PLATFORM_OPENGL_ES   = 2,
28         CONFIG_RENDER_PLATFORM_QT3D        = 8,
29         CONFIG_RENDER_PLATFORM_VULKAN      = 16,
30         CONFIG_RENDER_PLATFORM_DIRECTDRAW  = 24,
31         CONFIG_RENDER_PLATFORM_SDLFB       = 25,
32         CONFIG_RENDER_PLATFORM_DIRECTX     = 32,
33 };
34
35 #define MAX_HISTORY     8
36
37 #ifdef USE_SHARED_DLL
38         #define MAX_CART_TMP    8
39         #define MAX_FD_TMP      16
40         #define MAX_QD_TMP      8
41         #define MAX_TAPE_TMP    8
42         #define MAX_BINARY_TMP  8
43         #define MAX_BUBBLE_TMP  16
44         #define MAX_VOLUME_TMP  32
45 #else
46         #define MAX_CART_TMP    MAX_CART
47         #define MAX_FD_TMP      MAX_FD
48         #define MAX_QD_TMP      MAX_QD
49         #define MAX_TAPE_TMP    MAX_TAPE
50         #define MAX_BINARY_TMP  MAX_BINARY
51         #define MAX_BUBBLE_TMP  MAX_BUBBLE
52         #ifdef USE_SOUND_VOLUME
53                 #define MAX_VOLUME_TMP  USE_SOUND_VOLUME
54         #endif
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  * 20160407 Ohta:
65  * Qt:
66  *  To reduce time to build, compiling common blocks of GUI at once.
67  *  So, you should not separate items with #ifdef.
68  */ 
69 typedef struct {
70         // control
71         #if defined(USE_SHARED_DLL) || defined(USE_BOOT_MODE)
72                 int boot_mode;
73         #endif
74         #if defined(USE_SHARED_DLL) || defined(USE_CPU_TYPE)
75                 int cpu_type;
76         #endif
77         #if defined(USE_SHARED_DLL) || defined(USE_DIPSWITCH)
78                 uint32_t dipswitch;
79         #endif
80         #if defined(USE_SHARED_DLL) || defined(USE_DEVICE_TYPE)
81                 int device_type;
82         #endif
83         #if defined(USE_SHARED_DLL) || defined(USE_DRIVE_TYPE)
84                 int drive_type;
85         #endif
86         #if defined(USE_SHARED_DLL) || defined(USE_KEYBOARD_TYPE)
87                 int keyboard_type;
88         #endif
89         #if defined(USE_SHARED_DLL) || defined(USE_MOUSE_TYPE)
90                 int mouse_type;
91         #endif
92         #if defined(USE_SHARED_DLL) || defined(USE_JOYSTICK_TYPE)
93                 int joystick_type;
94         #endif
95         #if defined(USE_SHARED_DLL) || defined(USE_SOUND_TYPE)
96                 int sound_type;
97         #endif
98         #if defined(USE_SHARED_DLL) || defined(USE_MONITOR_TYPE)
99                 int monitor_type;
100         #endif
101         #if defined(USE_SHARED_DLL) || defined(USE_SCANLINE)
102                 bool scan_line;
103         #endif
104         #if defined(USE_SHARED_DLL) || defined(USE_PRINTER_TYPE)
105                 int printer_type;
106         #endif
107         #if defined(USE_SHARED_DLL) || defined(USE_FD1)
108                 bool correct_disk_timing[/*MAX_FD_TMP*/16];
109                 bool ignore_disk_crc[/*MAX_FD_TMP*/16];
110         #endif
111         #if defined(USE_SHARED_DLL) || defined(USE_TAPE1)
112                 bool wave_shaper[MAX_TAPE_TMP];
113                 bool direct_load_mzt[MAX_TAPE_TMP];
114                 bool baud_high[MAX_TAPE_TMP];
115         #endif
116         
117         int cpu_power;
118         
119         // recent files
120         #if defined(USE_SHARED_DLL) || defined(USE_CART1)
121                 _TCHAR initial_cart_dir[_MAX_PATH];
122                 _TCHAR recent_cart_path[MAX_CART_TMP][MAX_HISTORY][_MAX_PATH];
123         #endif
124         #if defined(USE_SHARED_DLL) || defined(USE_FD1)
125                 _TCHAR initial_floppy_disk_dir[_MAX_PATH];
126                 _TCHAR recent_floppy_disk_path[MAX_FD_TMP][MAX_HISTORY][_MAX_PATH];
127         #endif
128         #if defined(USE_SHARED_DLL) || defined(USE_QD1)
129                 _TCHAR initial_quick_disk_dir[_MAX_PATH];
130                 _TCHAR recent_quick_disk_path[MAX_QD_TMP][MAX_HISTORY][_MAX_PATH];
131         #endif
132         #if defined(USE_SHARED_DLL) || defined(USE_TAPE1)
133                 _TCHAR initial_tape_dir[_MAX_PATH];
134                 _TCHAR recent_tape_path[MAX_TAPE_TMP][MAX_HISTORY][_MAX_PATH];
135         #endif
136         #if defined(USE_SHARED_DLL) || defined(USE_COMPACT_DISC)
137                 _TCHAR initial_compact_disc_dir[_MAX_PATH];
138                 _TCHAR recent_compact_disc_path[MAX_HISTORY][_MAX_PATH];
139         #endif
140         #if defined(USE_SHARED_DLL) || defined(USE_LASER_DISC)
141                 _TCHAR initial_laser_disc_dir[_MAX_PATH];
142                 _TCHAR recent_laser_disc_path[MAX_HISTORY][_MAX_PATH];
143         #endif
144         #if defined(USE_SHARED_DLL) || defined(USE_BINARY_FILE1)
145                 _TCHAR initial_binary_dir[_MAX_PATH];
146                 _TCHAR recent_binary_path[MAX_BINARY_TMP][MAX_HISTORY][_MAX_PATH];
147         #endif
148         #if defined(USE_SHARED_DLL) || defined(USE_BUBBLE1)
149                 _TCHAR initial_bubble_casette_dir[_MAX_PATH];
150                 _TCHAR recent_bubble_casette_path[MAX_BUBBLE_TMP][MAX_HISTORY][_MAX_PATH];
151         #endif
152
153         // screen
154         int window_mode;
155         int window_stretch_type;
156         int fullscreen_stretch_type;
157         //      #if defined(USE_SHARED_DLL) || defined(USE_SCREEN_ROTATE)
158                 int rotate_type;
159         //      #endif
160         
161         // filter
162         #if defined(USE_SHARED_DLL) || defined(USE_SCREEN_FILTER)
163                 int filter_type;
164         #endif
165
166 #if defined(_USE_QT)
167         bool use_opengl_scanline;
168         bool opengl_scanline_vert;
169         bool opengl_scanline_horiz;
170         bool use_opengl_filters;
171         int opengl_filter_num;
172
173         bool swap_kanji_pause;
174         /*
175          * TYPE : 
176          *    0 : OpenGL/Main Profile
177          *    1 : OpenGL/Core Profile
178          *    2 : OpenGL ES
179          *    8 : Qt3D(Will not implement)
180          *   16 : Vulkan (Will not implement)
181          *   24 : DirectDraw (Will not implement)
182          *   25 : SDLFB(Will not implement)
183      *   32 : DirectX(Will not implement)
184          */ 
185         int render_platform;
186         int render_major_version;
187         int render_minor_version;
188 #endif  
189         
190         // sound
191         int sound_frequency;
192         int sound_latency;
193         bool sound_strict_rendering;
194 #if defined(_USE_QT)    
195         int general_sound_level;
196 #endif
197 #if defined(USE_SHARED_DLL) || defined(USE_FD1)
198         bool sound_noise_fdd;
199 #endif
200 #if defined(USE_SHARED_DLL) || defined(USE_TAPE1)
201         bool sound_noise_cmt;
202         bool sound_play_tape;
203 #endif
204 #if defined(USE_SHARED_DLL) || defined(USE_SOUND_VOLUME)
205         int sound_volume_l[MAX_VOLUME_TMP];
206         int sound_volume_r[MAX_VOLUME_TMP];
207 #endif
208         // input
209 #if defined(_WIN32) && !defined(_USE_QT)
210         _TCHAR fmgen_dll_path[_MAX_PATH];
211         bool use_direct_input;
212         bool disable_dwm;
213
214         bool use_d3d9;
215         bool wait_vsync;
216         bool use_dinput;
217         bool show_status_bar;
218 #endif
219 #if defined(USE_SHARED_DLL) || defined(USE_JOYSTICK)
220         int joy_buttons[4][16];
221 #endif
222
223 #ifdef _USE_QT
224         _TCHAR assigned_joystick_name[16][256];
225
226         int video_width;
227         int video_height;
228         int video_codec_type;
229         int audio_codec_type;
230         
231         int video_h264_bitrate;
232         int video_h264_bframes;
233         int video_h264_b_adapt;
234         int video_h264_minq;
235         int video_h264_maxq;
236         int video_h264_subme;
237
238         int video_mpeg4_bitrate;
239         int video_mpeg4_bframes;
240         int video_mpeg4_minq;
241         int video_mpeg4_maxq;
242         
243         int video_threads;
244         int audio_bitrate;
245         int video_frame_rate; // FPS * 1000.0
246 #endif
247         
248         // printer
249 #if defined(USE_SHARED_DLL) || defined(USE_PRINTER)
250         _TCHAR printer_dll_path[_MAX_PATH];
251 #endif
252
253         // General
254 #ifdef _USE_QT
255         bool log_to_syslog;
256         bool log_to_console;
257         bool dev_log_to_syslog[CSP_LOG_TYPE_VM_DEVICE_END - CSP_LOG_TYPE_VM_DEVICE_0 + 1][8];
258         bool dev_log_to_console[CSP_LOG_TYPE_VM_DEVICE_END - CSP_LOG_TYPE_VM_DEVICE_0 + 1][8];
259         bool dev_log_recording[CSP_LOG_TYPE_VM_DEVICE_END - CSP_LOG_TYPE_VM_DEVICE_0 + 1][8];
260
261         bool roma_kana_conversion;
262         int rendering_type;
263 #endif
264 } config_t;
265
266 extern DLL_PREFIX config_t config;
267
268 #if defined(_USE_QT)
269 # include <string>
270 #endif
271
272 #endif
273