2 Skelton for retropc emulator
4 Author : Takeda.Toshiya
11 #include <agar/core.h>
15 #include "agar_logger.h"
22 #include "agar_logger.h"
24 # if defined(Q_OS_WIN)
37 #if defined(_USE_AGAR)
38 #include "agar_main.h"
44 #define CONFIG_NAME "conf"
47 //extern _TCHAR* get_parent_dir(_TCHAR* file);
48 BOOL MyWritePrivateProfileInt(LPCTSTR lpAppName, LPCTSTR lpKeyName, int Value, LPCTSTR lpFileName)
51 my_stprintf_s(String, 32, _T("%d"), Value);
52 return MyWritePrivateProfileString(lpAppName, lpKeyName, String, lpFileName);
55 BOOL MyWritePrivateProfileBool(LPCTSTR lpAppName, LPCTSTR lpKeyName, bool Value, LPCTSTR lpFileName)
58 my_stprintf_s(String, 32, _T("%d"), Value ? 1 : 0);
59 return MyWritePrivateProfileString(lpAppName, lpKeyName, String, lpFileName);
62 bool MyGetPrivateProfileBool(LPCTSTR lpAppName, LPCTSTR lpKeyName, bool bDefault, LPCTSTR lpFileName)
64 return (MyGetPrivateProfileInt(lpAppName, lpKeyName, bDefault ? 1 : 0, lpFileName) != 0);
71 memset(&config, 0, sizeof(config_t));
72 config.window_mode = 1;
74 config.use_direct_input = true;
75 config.disable_dwm = false;
77 config.swap_joy_buttons = false;
79 #ifndef ONE_BOARD_MICRO_COMPUTER
81 config.use_d3d9 = true;
83 config.stretch_type = 1; // Stretch (Aspect)
85 config.sound_frequency = 6; // 48KHz
86 config.sound_latency = 1; // 100msec
89 config.wave_shaper = true;
90 config.direct_load_mzt = true;
91 config.baud_high = true;
93 #if defined(USE_BOOT_MODE) && defined(BOOT_MODE_DEFAULT)
94 config.boot_mode = BOOT_MODE_DEFAULT;
96 #if defined(USE_CPU_TYPE) && defined(CPU_TYPE_DEFAULT)
97 config.cpu_type = CPU_TYPE_DEFAULT;
99 #if defined(USE_DIPSWITCH) && defined(DIPSWITCH_DEFAULT)
100 config.dipswitch = DIPSWITCH_DEFAULT;
102 #if defined(USE_DEVICE_TYPE) && defined(DEVICE_TYPE_DEFAULT)
103 config.device_type = DEVICE_TYPE_DEFAULT;
106 for(int drv = 0; drv < MAX_FD; drv++) {
107 #if defined(CORRECT_DISK_TIMING_DEFAULT)
108 config.correct_disk_timing[drv] = CORRECT_DISK_TIMING_DEFAULT;
110 config.correct_disk_timing[drv] = true;
112 #if defined(IGNORE_DISK_CRC_DEFAULT)
113 config.ignore_disk_crc[drv] = IGNORE_DISK_CRC_DEFAULT;
116 #elif defined(USE_FD1)
117 for(int drv = 0; drv < MAX_FD; drv++) {
118 config.ignore_disk_crc[drv] = false;
121 #if defined(USE_SOUND_DEVICE_TYPE) && defined(SOUND_DEVICE_TYPE_DEFAULT)
122 config.sound_device_type = SOUND_DEVICE_TYPE_DEFAULT;
128 // 3 = WHG + OPN (+PSG)
130 // 5 = THG + OPN (+PSG)
131 // 6 = THG + WHG (+PSG)
132 // 7 = THG + WHG + OPN (+PSG)
134 config.sound_device_type = 0; // WITHOUT PSG?
135 #elif defined(_FM7) || defined(_FMNEW7) || defined(_FM77) || defined(_FM77L4) || defined(_FM77L2)
136 config.sound_device_type = 0; // PSG ONLY
137 #elif defined(_FM77AV) || defined(_FM77AV20) || defined(_FM77AV40) || defined(_FM77AV40EX) || defined(_FM77AV40SX)
138 config.sound_device_type = 1; // OPN
140 config.multiple_speakers = false;
141 config.general_sound_level = 0;
144 config.use_opengl_scanline = false;
145 config.opengl_scanline_vert = false;
146 config.opengl_scanline_horiz = false;
147 config.use_opengl_filters = false;
148 config.opengl_filter_num = 0;
150 #ifdef USE_MULTIPLE_SOUNDCARDS
153 for(ii = 0; ii < USE_MULTIPLE_SOUNDCARDS; ii++) {
154 config.sound_device_level[ii] = 0;
160 void load_config(const _TCHAR *config_path)
166 printf("Load Config: %s\n", config_path);
169 config.boot_mode = MyGetPrivateProfileInt(_T("Control"), _T("BootMode"), config.boot_mode, config_path);
172 config.cpu_type = MyGetPrivateProfileInt(_T("Control"), _T("CPUType"), config.cpu_type, config_path);
175 config.dipswitch = MyGetPrivateProfileInt(_T("Control"), _T("DipSwitch"), config.dipswitch, config_path);
177 #ifdef USE_DEVICE_TYPE
178 config.device_type = MyGetPrivateProfileInt(_T("Control"), _T("DeviceType"), config.device_type, config_path);
180 #ifdef USE_DRIVE_TYPE
181 config.drive_type = MyGetPrivateProfileInt(_T("Control"), _T("DriveType"), config.drive_type, config_path);
186 for(drv = 0; drv < MAX_FD; drv++) {
187 memset(name, 0x00, sizeof(name));
188 my_stprintf_s(name, 64, _T("CorrectDiskTiming%d"), drv + 1);
189 config.correct_disk_timing[drv] = MyGetPrivateProfileBool(_T("Control"), (const _TCHAR *)name,
190 config.correct_disk_timing[drv], config_path);
191 my_stprintf_s(name, 64, _T("IgnoreDiskCRC%d"), drv + 1);
192 config.ignore_disk_crc[drv] = MyGetPrivateProfileBool(_T("Control"), (const _TCHAR *)name,
193 config.ignore_disk_crc[drv], config_path);
199 config.tape_sound = MyGetPrivateProfileBool(_T("Control"), _T("TapeSound"), config.tape_sound, config_path);
200 config.wave_shaper = MyGetPrivateProfileBool(_T("Control"), _T("WaveShaper"), config.wave_shaper, config_path);
201 config.direct_load_mzt = MyGetPrivateProfileBool(_T("Control"), _T("DirectLoadMZT"), config.direct_load_mzt, config_path);
202 config.baud_high = MyGetPrivateProfileBool(_T("Control"), _T("BaudHigh"), config.baud_high, config_path);
207 MyGetPrivateProfileString(_T("RecentFiles"), _T("InitialCartDir"), _T(""), config.initial_cart_dir, _MAX_PATH, config_path);
208 for(drv = 0; drv < MAX_CART; drv++) {
209 for(i = 0; i < MAX_HISTORY; i++) {
211 my_stprintf_s(name, 64, _T("RecentCartPath%d_%d"), drv + 1, i + 1);
212 MyGetPrivateProfileString(_T("RecentFiles"), name, _T(""),
213 config.recent_cart_path[drv][i], _MAX_PATH, config_path);
218 MyGetPrivateProfileString(_T("RecentFiles"), _T("InitialDiskDir"), _T(""),
219 config.initial_disk_dir, _MAX_PATH, config_path);
220 // get_parent_dir(config.initial_disk_dir);
221 for(drv = 0; drv < MAX_FD; drv++) {
222 for(i = 0; i < MAX_HISTORY; i++) {
224 my_stprintf_s(name, 64, _T("RecentDiskPath%d_%d"), drv + 1, i + 1);
225 MyGetPrivateProfileString(_T("RecentFiles"), (const _TCHAR *)name,
226 _T(""), config.recent_disk_path[drv][i], _MAX_PATH, config_path);
231 MyGetPrivateProfileString(_T("RecentFiles"), _T("InitialQuickDiskDir"),
232 _T(""), config.initial_quickdisk_dir, _MAX_PATH, config_path);
233 for(drv = 0; drv < MAX_QD; drv++) {
234 for(i = 0; i < MAX_HISTORY; i++) {
236 my_stprintf_s(name, 64, _T("RecentQuickDiskPath%d_%d"), drv + 1, i + 1);
237 MyGetPrivateProfileString(_T("RecentFiles"), name, _T(""),
238 config.recent_quickdisk_path[drv][i], _MAX_PATH, config_path);
244 MyGetPrivateProfileString(_T("RecentFiles"), _T("InitialTapeDir"), _T(""),
245 config.initial_tape_dir, _MAX_PATH, config_path);
246 for(i = 0; i < MAX_HISTORY; i++) {
248 my_stprintf_s(name, 64, _T("RecentTapePath1_%d"), i + 1);
249 MyGetPrivateProfileString(_T("RecentFiles"), (const _TCHAR *)name, _T(""),
250 config.recent_tape_path[i], _MAX_PATH, config_path);
254 #ifdef USE_LASER_DISC
255 MyGetPrivateProfileString(_T("RecentFiles"), _T("InitialLaserDiscDir"), _T(""),
256 config.initial_laser_disc_dir, _MAX_PATH, config_path);
257 for(int i = 0; i < MAX_HISTORY; i++) {
259 my_stprintf_s(name, 64, _T("RecentLaserDiscPath1_%d"), i + 1);
260 MyGetPrivateProfileString(_T("RecentFiles"), (const _TCHAR *)name, _T(""),
261 config.recent_laser_disc_path[i], _MAX_PATH, config_path);
264 #ifdef USE_BINARY_FILE1
265 MyGetPrivateProfileString(_T("RecentFiles"), _T("InitialBinaryDir"), _T(""),
266 config.initial_binary_dir, _MAX_PATH, config_path);
267 for(drv = 0; drv < MAX_BINARY; drv++) {
268 for(i = 0; i < MAX_HISTORY; i++) {
270 my_stprintf_s(name, 64, _T("RecentBinaryPath%d_%d"), drv + 1, i + 1);
271 MyGetPrivateProfileString(_T("RecentFiles"), (const _TCHAR *)name, _T(""),
272 config.recent_binary_path[drv][i], _MAX_PATH, config_path);
278 #ifndef ONE_BOARD_MICRO_COMPUTER
279 config.window_mode = MyGetPrivateProfileInt(_T("Screen"), _T("WindowMode"), config.window_mode, config_path);
281 config.use_d3d9 = MyGetPrivateProfileBool(_T("Screen"), _T("UseD3D9"), config.use_d3d9, config_path);
282 config.wait_vsync = MyGetPrivateProfileBool(_T("Screen"), _T("WaitVSync"), config.wait_vsync, config_path);
284 config.stretch_type = MyGetPrivateProfileInt(_T("Screen"), _T("StretchType"), config.stretch_type, config_path);
286 config.window_mode = MyGetPrivateProfileInt(_T("Screen"), _T("WindowMode"), config.window_mode, config_path);
288 #ifdef USE_MONITOR_TYPE
289 config.monitor_type = MyGetPrivateProfileInt(_T("Screen"), _T("MonitorType"), config.monitor_type, config_path);
291 #ifdef USE_CRT_FILTER
292 config.crt_filter = MyGetPrivateProfileBool(_T("Screen"), _T("CRTFilter"), config.crt_filter, config_path);
295 config.scan_line = MyGetPrivateProfileBool(_T("Screen"), _T("ScanLine"), config.scan_line, config_path);
298 #ifdef USE_SCREEN_ROTATE
299 config.rotate_type = MyGetPrivateProfileInt(_T("Screen"), _T("RotateType"), config.rotate_type, config_path);
302 config.use_opengl_scanline = MyGetPrivateProfileBool(_T("Screen"), _T("UseOpenGLScanLine"),
303 config.use_opengl_scanline, config_path);
304 config.opengl_scanline_vert = MyGetPrivateProfileBool(_T("Screen"), _T("OpenGLScanLineVert"),
305 config.opengl_scanline_vert, config_path);;
306 config.opengl_scanline_horiz = MyGetPrivateProfileBool(_T("Screen"), _T("OpenGLScanLineHoriz"),
307 config.opengl_scanline_horiz, config_path);;
308 config.use_opengl_filters = MyGetPrivateProfileBool(_T("Screen"), _T("UseOpenGLFilters"),
309 config.use_opengl_filters, config_path);
310 config.opengl_filter_num = MyGetPrivateProfileInt(_T("Screen"), _T("OpenGLFilterNum"),
311 config.opengl_filter_num, config_path);
314 config.sound_frequency = MyGetPrivateProfileInt(_T("Sound"), _T("Frequency"), config.sound_frequency, config_path);
315 config.sound_latency = MyGetPrivateProfileInt(_T("Sound"), _T("Latency"), config.sound_latency, config_path);
316 #ifdef USE_SOUND_DEVICE_TYPE
317 config.sound_device_type = MyGetPrivateProfileInt(_T("Sound"), _T("DeviceType"), config.sound_device_type, config_path);
319 #if !defined(_USE_QT)
320 MyGetPrivateProfileString(_T("Sound"), _T("FMGenDll"), _T("mamefm.dll"), config.fmgen_dll_path, _MAX_PATH, config_path);
323 config.multiple_speakers = MyGetPrivateProfileBool(_T("Sound"), _T("MultipleSpeakers"),
324 config.multiple_speakers, config_path);
325 config.general_sound_level = MyGetPrivateProfileInt(_T("Sound"), _T("GeneralSoundLevel"),
326 config.general_sound_level, config_path);
327 #ifdef USE_MULTIPLE_SOUNDCARDS
331 for(ii = 0; ii < USE_MULTIPLE_SOUNDCARDS; ii++) {
332 memset(_tag, 0x00, sizeof(_tag));
333 my_stprintf_s(_tag, 64, _T("DeviceVolumeLevel_%d"), ii + 1);
334 config.sound_device_level[ii] = MyGetPrivateProfileInt(_T("Sound"), (const _TCHAR *)_tag, config.sound_device_level[ii], config_path);
339 config.use_direct_input = MyGetPrivateProfileBool(_T("Input"), _T("UseDirectInput"), config.use_direct_input, config_path);
340 config.disable_dwm = MyGetPrivateProfileBool(_T("Input"), _T("DisableDwm"), config.disable_dwm, config_path);
342 config.swap_joy_buttons = MyGetPrivateProfileBool(_T("Input"), _T("SwapJoyButtons"), config.swap_joy_buttons, config_path);
343 #if defined(_USE_QT) && !defined(Q_OS_WIN)
344 AGAR_DebugLog(AGAR_LOG_INFO, "Read Done.");
348 void save_config(const _TCHAR *config_path)
351 #if !defined(_MSC_VER)
353 FILEIO *pt = new FILEIO;
354 if(pt->Fopen(config_path, FILEIO_WRITE_ASCII) != true) {
364 # ifdef USE_BOOT_MODE
365 MyWritePrivateProfileInt(_T("Control"), _T("BootMode"), config.boot_mode, config_path);
368 MyWritePrivateProfileInt(_T("Control"), _T("CPUType"), config.cpu_type, config_path);
371 MyWritePrivateProfileInt(_T("Control"), _T("DipSwitch"), config.dipswitch, config_path);
373 #ifdef USE_DEVICE_TYPE
374 MyWritePrivateProfileInt(_T("Control"), _T("DeviceType"), config.device_type, config_path);
376 #ifdef USE_DRIVE_TYPE
377 MyWritePrivateProfileInt(_T("Control"), _T("DriveType"), config.drive_type, config_path);
382 for(drv = 0; drv < MAX_FD; drv++) {
383 memset(name, 0x00, sizeof(name));
384 my_stprintf_s(name, 64, _T("CorrectDiskTiming%d"), drv + 1);
385 MyWritePrivateProfileBool(_T("Control"), (const _TCHAR *)name, config.correct_disk_timing[drv], config_path);
386 my_stprintf_s(name, 64, _T("IgnoreDiskCRC%d"), drv + 1);
387 MyWritePrivateProfileBool(_T("Control"), (const _TCHAR *)name, config.ignore_disk_crc[drv], config_path);
393 MyWritePrivateProfileBool(_T("Control"), _T("TapeSound"), config.tape_sound, config_path);
394 MyWritePrivateProfileBool(_T("Control"), _T("WaveShaper"), config.wave_shaper, config_path);
395 MyWritePrivateProfileBool(_T("Control"), _T("DirectLoadMZT"), config.direct_load_mzt, config_path);
396 MyWritePrivateProfileBool(_T("Control"), _T("BaudHigh"), config.baud_high, config_path);
401 MyWritePrivateProfileString(_T("RecentFiles"), _T("InitialCartDir"), config.initial_cart_dir, config_path);
402 for(drv = 0; drv < MAX_CART; drv++) {
403 for(i = 0; i < MAX_HISTORY; i++) {
405 my_stprintf_s(name, 64, _T("RecentCartPath%d_%d"), drv + 1, i + 1);
406 MyWritePrivateProfileString(_T("RecentFiles"), (const _TCHAR *)name, config.recent_cart_path[drv][i], config_path);
411 MyWritePrivateProfileString(_T("RecentFiles"), _T("InitialDiskDir"), config.initial_disk_dir, config_path);
412 for(drv = 0; drv < MAX_FD; drv++) {
413 for(i = 0; i < MAX_HISTORY; i++) {
415 my_stprintf_s(name, 64, _T("RecentDiskPath%d_%d"), drv + 1, i + 1);
416 MyWritePrivateProfileString(_T("RecentFiles"), (const _TCHAR *)name,
417 config.recent_disk_path[drv][i], config_path);
422 MyWritePrivateProfileString(_T("RecentFiles"), _T("InitialQuickDiskDir"),
423 config.initial_quickdisk_dir, config_path);
424 for(drv = 0; drv < MAX_QD; drv++) {
425 for(i = 0; i < MAX_HISTORY; i++) {
427 my_stprintf_s(name, 64, _T("RecentQuickDiskPath%d_%d"), drv + 1, i + 1);
428 MyWritePrivateProfileString(_T("RecentFiles"), (const _TCHAR *)name,
429 config.recent_quickdisk_path[drv][i], config_path);
434 MyWritePrivateProfileString(_T("RecentFiles"), _T("InitialTapeDir"), config.initial_tape_dir, config_path);
435 for(i = 0; i < MAX_HISTORY; i++) {
437 my_stprintf_s(name, 64, _T("RecentTapePath1_%d"), i + 1);
438 MyWritePrivateProfileString(_T("RecentFiles"), (const _TCHAR *)name,
439 config.recent_tape_path[i], config_path);
442 #ifdef USE_LASER_DISC
443 MyWritePrivateProfileString(_T("RecentFiles"), _T("InitialLaserDiscDir"), config.initial_laser_disc_dir, config_path);
444 for(int i = 0; i < MAX_HISTORY; i++) {
446 my_stprintf_s(name, 64, _T("RecentLaserDiscPath1_%d"), i + 1);
447 MyWritePrivateProfileString(_T("RecentFiles"), (const _TCHAR *)name,
448 config.recent_laser_disc_path[i], config_path);
451 #ifdef USE_BINARY_FILE1
452 MyWritePrivateProfileString(_T("RecentFiles"), _T("InitialBinaryDir"), config.initial_binary_dir, config_path);
453 for(drv = 0; drv < MAX_BINARY; drv++) {
454 for(i = 0; i < MAX_HISTORY; i++) {
456 my_stprintf_s(name, 64, _T("RecentBinaryPath%d_%d"), drv + 1, i + 1);
457 MyWritePrivateProfileString(_T("RecentFiles"), (const _TCHAR *)name,
458 config.recent_binary_path[drv][i], config_path);
464 #ifndef ONE_BOARD_MICRO_COMPUTER
465 MyWritePrivateProfileInt(_T("Screen"), _T("WindowMode"), config.window_mode, config_path);
467 MyWritePrivateProfileBool(_T("Screen"), _T("UseD3D9"), config.use_d3d9, config_path);
468 MyWritePrivateProfileBool(_T("Screen"), _T("WaitVSync"), config.wait_vsync, config_path);
470 MyWritePrivateProfileInt(_T("Screen"), _T("StretchType"), config.stretch_type, config_path);
472 MyWritePrivateProfileInt(_T("Screen"), _T("WindowMode"), config.window_mode, config_path);
474 #ifdef USE_MONITOR_TYPE
475 MyWritePrivateProfileInt(_T("Screen"), _T("MonitorType"), config.monitor_type, config_path);
477 #ifdef USE_CRT_FILTER
478 MyWritePrivateProfileBool(_T("Screen"), _T("CRTFilter"), config.crt_filter, config_path);
481 MyWritePrivateProfileBool(_T("Screen"), _T("ScanLine"), config.scan_line, config_path);
483 #ifdef USE_SCREEN_ROTATE
484 MyWritePrivateProfileInt(_T("Screen"), _T("RotateType"), config.rotate_type, config_path);
487 MyWritePrivateProfileBool(_T("Screen"), _T("UseOpenGLScanLine"),
488 config.use_opengl_scanline, config_path);
489 MyWritePrivateProfileBool(_T("Screen"), _T("OpenGLScanLineVert"),
490 config.opengl_scanline_vert, config_path);;
491 MyWritePrivateProfileBool(_T("Screen"), _T("OpenGLScanLineHoriz"),
492 config.opengl_scanline_horiz, config_path);;
493 MyWritePrivateProfileBool(_T("Screen"), _T("UseOpenGLFilters"),
494 config.use_opengl_filters, config_path);
495 MyWritePrivateProfileInt(_T("Screen"), _T("OpenGLFilterNum"),
496 config.opengl_filter_num, config_path);
500 MyWritePrivateProfileInt(_T("Sound"), _T("Frequency"), config.sound_frequency, config_path);
501 MyWritePrivateProfileInt(_T("Sound"), _T("Latency"), config.sound_latency, config_path);
502 #ifdef USE_SOUND_DEVICE_TYPE
503 MyWritePrivateProfileInt(_T("Sound"), _T("DeviceType"), config.sound_device_type, config_path);
505 #if !defined(_USE_QT)
506 MyWritePrivateProfileString(_T("Sound"), _T("FMGenDll"), config.fmgen_dll_path, config_path);
508 MyWritePrivateProfileBool(_T("Sound"), _T("MultipleSpeakers"),
509 config.multiple_speakers, config_path);
510 MyWritePrivateProfileInt(_T("Sound"), _T("GeneralSoundLevel"),
511 config.general_sound_level, config_path);
512 #ifdef USE_MULTIPLE_SOUNDCARDS
516 for(ii = 0; ii < USE_MULTIPLE_SOUNDCARDS; ii++) {
517 memset(_tag, 0x00, sizeof(_tag));
518 my_stprintf_s(_tag, 64, _T("DeviceVolumeLevel_%d"), ii + 1);
519 MyWritePrivateProfileInt(_T("Sound"), (const _TCHAR *)_tag, config.sound_device_level[ii], config_path);
525 MyWritePrivateProfileBool(_T("Input"), _T("UseDirectInput"), config.use_direct_input, config_path);
526 MyWritePrivateProfileBool(_T("Input"), _T("DisableDwm"), config.disable_dwm, config_path);
528 MyWritePrivateProfileBool(_T("Input"), _T("SwapJoyButtons"), config.swap_joy_buttons, config_path);
529 #if defined(_USE_QT) && !defined(Q_OS_WIN)
530 AGAR_DebugLog(AGAR_LOG_INFO, "Write done.");
534 #define STATE_VERSION 3
536 void save_config_state(void *f)
538 FILEIO *state_fio = (FILEIO *)f;
541 state_fio->FputUint32(STATE_VERSION);
544 state_fio->FputInt32(config.boot_mode);
547 state_fio->FputInt32(config.cpu_type);
550 state_fio->FputUint32(config.dipswitch);
552 #ifdef USE_DEVICE_TYPE
553 state_fio->FputInt32(config.device_type);
555 #ifdef USE_DRIVE_TYPE
556 state_fio->FputInt32(config.drive_type);
559 for(int drv = 0; drv < MAX_FD; drv++) {
560 state_fio->FputBool(config.correct_disk_timing[drv]);
561 state_fio->FputBool(config.ignore_disk_crc[drv]);
563 // for(int drv = 0; drv < MAX_FD; drv++) {
564 // state_fio->FputBool(config.fdd_hack_fast_transfer[drv]);
567 #ifdef USE_MONITOR_TYPE
568 state_fio->FputInt32(config.monitor_type);
570 #ifdef USE_SOUND_DEVICE_TYPE
571 state_fio->FputInt32(config.sound_device_type);
576 bool load_config_state(void *f)
578 FILEIO *state_fio = (FILEIO *)f;
580 if(state_fio->FgetUint32() != STATE_VERSION) {
584 config.boot_mode = state_fio->FgetInt32();
587 config.cpu_type = state_fio->FgetInt32();
590 config.dipswitch = state_fio->FgetUint32();
592 #ifdef USE_DEVICE_TYPE
593 config.device_type = state_fio->FgetInt32();
595 #ifdef USE_DRIVE_TYPE
596 config.drive_type = state_fio->FgetInt32();
599 for(int drv = 0; drv < MAX_FD; drv++) {
600 config.correct_disk_timing[drv] = state_fio->FgetBool();
601 config.ignore_disk_crc[drv] = state_fio->FgetBool();
603 // for(int drv = 0; drv < MAX_FD; drv++) {
604 // config.fdd_hack_fast_transfer[drv] = state_fio->FgetBool();
607 #ifdef USE_MONITOR_TYPE
608 config.monitor_type = state_fio->FgetInt32();
610 #ifdef USE_SOUND_DEVICE_TYPE
611 config.sound_device_type = state_fio->FgetInt32();