OSDN Git Service

[General][WIP] Merge upstream 2017-03-20.Still not implement UIs.
[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         int cpu_power;
78 #if defined(USE_SHARED_DLL) || defined(USE_DIPSWITCH)
79         uint32_t dipswitch;
80 #endif
81 #if defined(USE_SHARED_DLL) || defined(USE_DEVICE_TYPE)
82         int device_type;
83 #endif
84 #if defined(USE_SHARED_DLL) || defined(USE_DRIVE_TYPE)
85         int drive_type;
86 #endif
87         
88 #if defined(USE_SHARED_DLL) || defined(USE_FD1)
89         bool correct_disk_timing[/*MAX_FD_TMP*/ 16];
90         bool ignore_disk_crc[/*MAX_FD_TMP*/ 16];
91 #endif
92 #if defined(USE_SHARED_DLL) || defined(USE_TAPE)
93         bool wave_shaper[MAX_TAPE_TMP];
94         bool direct_load_mzt[MAX_TAPE_TMP];
95         bool baud_high[MAX_TAPE_TMP];
96 #endif
97         // recent files
98 #if defined(USE_SHARED_DLL) || defined(USE_CART1)
99         _TCHAR initial_cart_dir[_MAX_PATH];
100         _TCHAR recent_cart_path[MAX_CART_TMP][MAX_HISTORY][_MAX_PATH];
101 #endif
102 #if defined(USE_SHARED_DLL) || defined(USE_FD1)
103         _TCHAR initial_floppy_disk_dir[_MAX_PATH];
104         _TCHAR recent_floppy_disk_path[MAX_FD_TMP][MAX_HISTORY][_MAX_PATH];
105 #endif
106 #if defined(USE_SHARED_DLL) || defined(USE_QD1)
107         _TCHAR initial_quick_disk_dir[_MAX_PATH];
108         _TCHAR recent_quick_disk_path[MAX_QD_TMP][MAX_HISTORY][_MAX_PATH];
109 #endif
110 #if defined(USE_SHARED_DLL) || defined(USE_TAPE1)
111         _TCHAR initial_tape_dir[_MAX_PATH];
112         _TCHAR recent_tape_path[MAX_TAPE_TMP][MAX_HISTORY][_MAX_PATH];
113 #endif
114 #if defined(USE_SHARED_DLL) || defined(USE_COMPACT_DISC)
115         _TCHAR initial_compact_disc_dir[_MAX_PATH];
116         _TCHAR recent_compact_disc_path[MAX_HISTORY][_MAX_PATH];
117 #endif
118 #if defined(USE_SHARED_DLL) || defined(USE_LASER_DISC)
119         _TCHAR initial_laser_disc_dir[_MAX_PATH];
120         _TCHAR recent_laser_disc_path[MAX_HISTORY][_MAX_PATH];
121 #endif
122 #if defined(USE_SHARED_DLL) || defined(USE_BINARY_FILE1)
123         _TCHAR initial_binary_dir[_MAX_PATH];
124         _TCHAR recent_binary_path[MAX_BINARY_TMP][MAX_HISTORY][_MAX_PATH];
125 #endif
126 #if defined(USE_SHARED_DLL) || defined(USE_BUBBLE1)
127         _TCHAR initial_bubble_casette_dir[_MAX_PATH];
128         _TCHAR recent_bubble_casette_path[MAX_BUBBLE_TMP][MAX_HISTORY][_MAX_PATH];
129 #endif
130         // screen
131         int window_mode;
132 #ifdef _WIN32
133         bool use_d3d9;
134         bool wait_vsync;
135 #endif
136         int window_stretch_type;
137         int fullscreen_stretch_type;
138 #if defined(USE_SHARED_DLL) || defined(USE_MONITOR_TYPE)
139         int monitor_type;
140 #endif
141 #if defined(USE_SHARED_DLL) || defined(USE_CRT_FILTER)
142         bool crt_filter;
143 #endif
144 #if defined(USE_SHARED_DLL) || defined(USE_SCANLINE)
145         bool scan_line;
146 #endif
147 #if defined(USE_SHARED_DLL) || defined(USE_SCREEN_ROTATE)
148         int rotate_type;
149 #endif
150 #if defined(_USE_QT)
151         bool use_opengl_scanline;
152         bool opengl_scanline_vert;
153         bool opengl_scanline_horiz;
154         bool use_opengl_filters;
155         int opengl_filter_num;
156
157         bool swap_kanji_pause;
158         /*
159          * TYPE : 
160          *    0 : OpenGL/Main Profile
161          *    1 : OpenGL/Core Profile
162          *    2 : OpenGL ES
163          *    8 : Qt3D(Will not implement)
164          *   16 : Vulkan (Will not implement)
165          *   24 : DirectDraw (Will not implement)
166          *   25 : SDLFB(Will not implement)
167      *   32 : DirectX(Will not implement)
168          */ 
169         int render_platform;
170         int render_major_version;
171         int render_minor_version;
172 #endif  
173         
174         // sound
175         int sound_frequency;
176         int sound_latency;
177         bool sound_strict_rendering;
178 #if defined(_USE_QT)    
179         int general_sound_level;
180 #endif
181 #if defined(USE_SHARED_DLL) || defined(USE_SOUND_DEVICE_TYPE)
182         int sound_device_type;
183 #endif
184 #if defined(USE_SHARED_DLL) || defined(USE_FD1)
185         bool sound_noise_fdd;
186 #endif
187 #if defined(USE_SHARED_DLL) || defined(USE_TAPE1)
188         bool sound_noise_cmt;
189         bool sound_play_tape;
190 #endif
191 #if defined(USE_SHARED_DLL) || defined(USE_SOUND_VOLUME)
192         int sound_volume_l[MAX_VOLUME_TMP];
193         int sound_volume_r[MAX_VOLUME_TMP];
194 #endif
195         // input
196 #ifdef _WIN32
197         _TCHAR fmgen_dll_path[_MAX_PATH];
198         bool use_direct_input;
199         bool disable_dwm;
200 #endif
201 #if defined(USE_SHARED_DLL) || defined(USE_KEYBOARD_TYPE)
202         int keyboard_type;
203 #endif
204 #if defined(USE_SHARED_DLL) || defined(USE_JOYSTICK)
205         int joy_buttons[4][16];
206 #endif
207
208 #ifdef _USE_QT
209         _TCHAR assigned_joystick_name[16][256];
210
211         int video_width;
212         int video_height;
213         int video_codec_type;
214         int audio_codec_type;
215         
216         int video_h264_bitrate;
217         int video_h264_bframes;
218         int video_h264_b_adapt;
219         int video_h264_minq;
220         int video_h264_maxq;
221         int video_h264_subme;
222
223         int video_mpeg4_bitrate;
224         int video_mpeg4_bframes;
225         int video_mpeg4_minq;
226         int video_mpeg4_maxq;
227         
228         int video_threads;
229         int audio_bitrate;
230         int video_frame_rate; // FPS * 1000.0
231 #endif
232         
233         // printer
234 #if defined(USE_SHARED_DLL) || defined(USE_PRINTER)
235         int printer_device_type;
236         _TCHAR printer_dll_path[_MAX_PATH];
237 #endif
238
239         // General
240 #ifdef _USE_QT
241         bool log_to_syslog;
242         bool log_to_console;
243         bool dev_log_to_syslog[CSP_LOG_TYPE_VM_DEVICE_END - CSP_LOG_TYPE_VM_DEVICE_0 + 1][8];
244         bool dev_log_to_console[CSP_LOG_TYPE_VM_DEVICE_END - CSP_LOG_TYPE_VM_DEVICE_0 + 1][8];
245         bool dev_log_recording[CSP_LOG_TYPE_VM_DEVICE_END - CSP_LOG_TYPE_VM_DEVICE_0 + 1][8];
246
247         bool roma_kana_conversion;
248         int rendering_type;
249 #endif
250 } config_t;
251
252 extern DLL_PREFIX config_t config;
253
254 #if defined(_USE_QT)
255 # include <string>
256 #endif
257
258 #endif
259