OSDN Git Service

[VM][General][WIP] Apply new (Upstream 2016-02-21) APIs to VMs.
[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
16 #define MAX_HISTORY     8
17
18 #if defined(USE_CART2)
19 #define MAX_CART        2
20 #elif defined(USE_CART1)
21 #define MAX_CART        1
22 #endif
23
24 #if defined(USE_FD8)
25 #define MAX_FD          8
26 #elif defined(USE_FD7)
27 #define MAX_FD          7
28 #elif defined(USE_FD6)
29 #define MAX_FD          6
30 #elif defined(USE_FD5)
31 #define MAX_FD          5
32 #elif defined(USE_FD4)
33 #define MAX_FD          4
34 #elif defined(USE_FD3)
35 #define MAX_FD          3
36 #elif defined(USE_FD2)
37 #define MAX_FD          2
38 #elif defined(USE_FD1)
39 #define MAX_FD          1
40 #endif
41
42 #if defined(USE_QD2)
43 #define MAX_QD          2
44 #elif defined(USE_QD1)
45 #define MAX_QD          1
46 #endif
47
48 #if defined(USE_BINARY_FILE2)
49 #define MAX_BINARY      2
50 #elif defined(USE_BINARY_FILE1)
51 #define MAX_BINARY      1
52 #endif
53
54 void initialize_config();
55 void load_config(const _TCHAR* config_path);
56 void save_config(const _TCHAR* config_path);
57 void save_config_state(void *f);
58 bool load_config_state(void *f);
59
60 typedef struct {
61         // control
62 #ifdef USE_BOOT_MODE
63         int boot_mode;
64 #endif
65 #ifdef USE_CPU_TYPE
66         int cpu_type;
67 #endif
68         int cpu_power;
69 #ifdef USE_DIPSWITCH
70         uint32 dipswitch;
71 #endif
72 #ifdef USE_DEVICE_TYPE
73         int device_type;
74 #endif
75 #ifdef USE_DRIVE_TYPE
76         int drive_type;
77 #endif
78 #ifdef USE_FD1
79         bool correct_disk_timing[16];
80         bool ignore_disk_crc[16];
81 #endif
82 #ifdef USE_TAPE
83         bool tape_sound;
84         bool wave_shaper;
85         bool direct_load_mzt;
86         bool baud_high;
87 #endif
88         
89         // recent files
90 #ifdef USE_CART1
91         _TCHAR initial_cart_dir[_MAX_PATH];
92         _TCHAR recent_cart_path[MAX_CART][MAX_HISTORY][_MAX_PATH];
93 #endif
94 #ifdef USE_FD1
95         _TCHAR initial_floppy_disk_dir[_MAX_PATH];
96         _TCHAR recent_floppy_disk_path[MAX_FD][MAX_HISTORY][_MAX_PATH];
97 #endif
98 #ifdef USE_QD1
99         _TCHAR initial_quick_disk_dir[_MAX_PATH];
100         _TCHAR recent_quick_disk_path[MAX_QD][MAX_HISTORY][_MAX_PATH];
101 #endif
102 #ifdef USE_TAPE
103         _TCHAR initial_tape_dir[_MAX_PATH];
104         _TCHAR recent_tape_path[MAX_HISTORY][_MAX_PATH];
105 #endif
106 #ifdef USE_LASER_DISC
107         _TCHAR initial_laser_disc_dir[_MAX_PATH];
108         _TCHAR recent_laser_disc_path[MAX_HISTORY][_MAX_PATH];
109 #endif
110 #ifdef USE_BINARY_FILE1
111         _TCHAR initial_binary_dir[_MAX_PATH];
112         _TCHAR recent_binary_path[MAX_BINARY][MAX_HISTORY][_MAX_PATH];
113 #endif
114         
115         // screen
116         int window_mode;
117 #ifdef _WIN32
118         bool use_d3d9;
119         bool wait_vsync;
120 #endif
121         int window_stretch_type;
122         int fullscreen_stretch_type;
123 #ifdef USE_MONITOR_TYPE
124         int monitor_type;
125 #endif
126 #ifdef USE_CRT_FILTER
127         bool crt_filter;
128 #endif
129 #ifdef USE_SCANLINE
130         bool scan_line;
131 #endif
132 #ifdef USE_SCREEN_ROTATE
133         int rotate_type;
134 #endif
135         
136         // sound
137         int sound_frequency;
138         int sound_latency;
139         
140         int general_sound_level;
141 #if defined(USE_QT)
142         bool use_opengl_scanline;
143         bool opengl_scanline_vert;
144         bool opengl_scanline_horiz;
145         
146         bool use_opengl_filters;
147         int opengl_filter_num;
148 #endif  
149 #ifdef USE_SOUND_DEVICE_TYPE
150         int sound_device_type;
151 #endif
152 #ifdef USE_SOUND_VOLUME
153         int sound_volume_l[USE_SOUND_VOLUME];
154         int sound_volume_r[USE_SOUND_VOLUME];
155 #endif
156         _TCHAR fmgen_dll_path[_MAX_PATH];
157         
158         // input
159 #ifdef _WIN32
160         bool use_direct_input;
161         bool disable_dwm;
162 #endif
163         int keyboard_type;
164         int joy_buttons[4][16];
165 #ifdef _USE_QT
166         _TCHAR assigned_joystick_name[16][256];
167 #endif  
168         // printer
169 #ifdef USE_PRINTER
170         int printer_device_type;
171         _TCHAR printer_dll_path[_MAX_PATH];
172 #endif
173 } config_t;
174
175 extern config_t config;
176
177 #if defined(_USE_AGAR) || defined(_USE_QT)
178 # include <string>
179 #endif
180
181 #endif
182