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)
34 #if defined(_USE_AGAR)
35 #include "agar_main.h"
41 #define CONFIG_NAME "conf"
44 //extern _TCHAR* get_parent_dir(_TCHAR* file);
45 BOOL MyWritePrivateProfileInt(LPCTSTR lpAppName, LPCTSTR lpKeyName, int Value, LPCTSTR lpFileName)
48 return MyWritePrivateProfileString(lpAppName, lpKeyName, create_string(_T("%d"), Value), lpFileName);
51 BOOL MyWritePrivateProfileBool(LPCTSTR lpAppName, LPCTSTR lpKeyName, bool Value, LPCTSTR lpFileName)
53 return MyWritePrivateProfileString(lpAppName, lpKeyName, create_string(_T("%d"), Value ? 1 : 0), lpFileName);
56 bool MyGetPrivateProfileBool(LPCTSTR lpAppName, LPCTSTR lpKeyName, bool bDefault, LPCTSTR lpFileName)
58 return (MyGetPrivateProfileInt(lpAppName, lpKeyName, bDefault ? 1 : 0, lpFileName) != 0);
61 void initialize_config()
65 memset(&config, 0, sizeof(config_t));
66 config.window_mode = 1;
68 #if defined(USE_BOOT_MODE) && defined(BOOT_MODE_DEFAULT)
69 config.boot_mode = BOOT_MODE_DEFAULT;
71 #if defined(USE_CPU_TYPE) && defined(CPU_TYPE_DEFAULT)
72 config.cpu_type = CPU_TYPE_DEFAULT;
74 #if defined(USE_DIPSWITCH) && defined(DIPSWITCH_DEFAULT)
75 config.dipswitch = DIPSWITCH_DEFAULT;
77 #if defined(USE_DEVICE_TYPE) && defined(DEVICE_TYPE_DEFAULT)
78 config.device_type = DEVICE_TYPE_DEFAULT;
80 #if defined(USE_DRIVE_TYPE) && defined(DRIVE_TYPE_DEFAULT)
81 config.drive_type = DRIVE_TYPE_DEFAULT;
84 for(int drv = 0; drv < MAX_FD; drv++) {
85 #if defined(CORRECT_DISK_TIMING_DEFAULT)
86 config.correct_disk_timing[drv] = CORRECT_DISK_TIMING_DEFAULT;
88 config.correct_disk_timing[drv] = true;
90 #if defined(IGNORE_DISK_CRC_DEFAULT)
91 config.ignore_disk_crc[drv] = IGNORE_DISK_CRC_DEFAULT;
94 #elif defined(USE_FD1)
95 for(int drv = 0; drv < MAX_FD; drv++) {
96 config.ignore_disk_crc[drv] = false;
100 config.wave_shaper = true;
101 config.direct_load_mzt = true;
102 config.baud_high = true;
106 config.sound_frequency = 6; // 48KHz
107 config.sound_latency = 1; // 100msec
108 config.general_sound_level = 0;
109 #if defined(USE_SOUND_DEVICE_TYPE) && defined(SOUND_DEVICE_TYPE_DEFAULT)
110 config.sound_device_type = SOUND_DEVICE_TYPE_DEFAULT;
111 #elif defined(USE_SOUND_DEVICE_TYPE)
112 config.sound_device_type = 0;
117 config.use_direct_input = true;
118 config.disable_dwm = false;
120 config.keyboard_type = 0;
121 for(int i = 0; i < 4; i++) {
122 for(int j = 0; j < 16; j++) {
123 config.joy_buttons[i][j] = (i << 4) | j;
128 #if defined(USE_PRINTER) && defined(PRINTER_DEVICE_TYPE_DEFAULT)
129 config.printer_device_type = PRINTER_DEVICE_TYPE_DEFAULT;
130 #elif defined(USE_PRINTER)
131 config.printer_device_type = 0;
135 #ifndef ONE_BOARD_MICRO_COMPUTER
137 config.use_d3d9 = true;
139 config.fullscreen_stretch_type = 1; // Stretch (Aspect)
143 config.use_opengl_scanline = false;
144 config.opengl_scanline_vert = false;
145 config.opengl_scanline_horiz = false;
146 config.use_opengl_filters = false;
147 config.opengl_filter_num = 0;
151 void load_config(const _TCHAR *config_path)
159 config.boot_mode = MyGetPrivateProfileInt(_T("Control"), _T("BootMode"), config.boot_mode, config_path);
162 config.cpu_type = MyGetPrivateProfileInt(_T("Control"), _T("CPUType"), config.cpu_type, config_path);
165 config.dipswitch = MyGetPrivateProfileInt(_T("Control"), _T("DipSwitch"), config.dipswitch, config_path);
167 #ifdef USE_DEVICE_TYPE
168 config.device_type = MyGetPrivateProfileInt(_T("Control"), _T("DeviceType"), config.device_type, config_path);
170 #ifdef USE_DRIVE_TYPE
171 config.drive_type = MyGetPrivateProfileInt(_T("Control"), _T("DriveType"), config.drive_type, config_path);
175 for(drv = 0; drv < MAX_FD; drv++) {
176 config.correct_disk_timing[drv] = MyGetPrivateProfileBool(_T("Control"), create_string(_T("CorrectDiskTiming%d"), drv + 1), config.correct_disk_timing[drv], config_path);
177 config.ignore_disk_crc[drv] = MyGetPrivateProfileBool(_T("Control"), create_string(_T("IgnoreDiskCRC%d"), drv + 1), config.ignore_disk_crc[drv], config_path);
183 config.tape_sound = MyGetPrivateProfileBool(_T("Control"), _T("TapeSound"), config.tape_sound, config_path);
184 config.wave_shaper = MyGetPrivateProfileBool(_T("Control"), _T("WaveShaper"), config.wave_shaper, config_path);
185 config.direct_load_mzt = MyGetPrivateProfileBool(_T("Control"), _T("DirectLoadMZT"), config.direct_load_mzt, config_path);
186 config.baud_high = MyGetPrivateProfileBool(_T("Control"), _T("BaudHigh"), config.baud_high, config_path);
191 MyGetPrivateProfileString(_T("RecentFiles"), _T("InitialCartDir"), _T(""), config.initial_cart_dir, _MAX_PATH, config_path);
192 for(drv = 0; drv < MAX_CART; drv++) {
193 for(i = 0; i < MAX_HISTORY; i++) {
194 MyGetPrivateProfileString(_T("RecentFiles"), create_string(_T("RecentCartPath%d_%d"), drv + 1, i + 1), _T(""), config.recent_cart_path[drv][i], _MAX_PATH, config_path);
199 MyGetPrivateProfileString(_T("RecentFiles"), _T("InitialDiskDir"), _T(""), config.initial_floppy_disk_dir, _MAX_PATH, config_path);
200 // get_parent_dir(config.initial_disk_dir);
201 for(drv = 0; drv < MAX_FD; drv++) {
202 for(i = 0; i < MAX_HISTORY; i++) {
203 MyGetPrivateProfileString(_T("RecentFiles"), create_string(_T("RecentDiskPath%d_%d"), drv + 1, i + 1), _T(""), config.recent_floppy_disk_path[drv][i], _MAX_PATH, config_path);
208 MyGetPrivateProfileString(_T("RecentFiles"), _T("InitialQuickDiskDir"), _T(""), config.initial_quick_disk_dir, _MAX_PATH, config_path);
209 for(drv = 0; drv < MAX_QD; drv++) {
210 for(i = 0; i < MAX_HISTORY; i++) {
211 MyGetPrivateProfileString(_T("RecentFiles"), create_string(_T("RecentQuickDiskPath%d_%d"), drv + 1, i + 1), _T(""), config.recent_quick_disk_path[drv][i], _MAX_PATH, config_path);
217 MyGetPrivateProfileString(_T("RecentFiles"), _T("InitialTapeDir"), _T(""),
218 config.initial_tape_dir, _MAX_PATH, config_path);
219 for(i = 0; i < MAX_HISTORY; i++) {
220 MyGetPrivateProfileString(_T("RecentFiles"), create_string(_T("RecentTapePath1_%d"), i + 1), _T(""), config.recent_tape_path[i], _MAX_PATH, config_path);
224 #ifdef USE_LASER_DISC
225 MyGetPrivateProfileString(_T("RecentFiles"), _T("InitialLaserDiscDir"), _T(""),
226 config.initial_laser_disc_dir, _MAX_PATH, config_path);
227 for(int i = 0; i < MAX_HISTORY; i++) {
228 MyGetPrivateProfileString(_T("RecentFiles"), create_string(_T("RecentLaserDiscPath1_%d"), i + 1), _T(""), config.recent_laser_disc_path[i], _MAX_PATH, config_path);
231 #ifdef USE_BINARY_FILE1
232 MyGetPrivateProfileString(_T("RecentFiles"), _T("InitialBinaryDir"), _T(""),
233 config.initial_binary_dir, _MAX_PATH, config_path);
234 for(drv = 0; drv < MAX_BINARY; drv++) {
235 for(i = 0; i < MAX_HISTORY; i++) {
237 my_stprintf_s(name, 64, _T("RecentBinaryPath%d_%d"), drv + 1, i + 1);
238 MyGetPrivateProfileString(_T("RecentFiles"), (const _TCHAR *)name, _T(""),
239 config.recent_binary_path[drv][i], _MAX_PATH, config_path);
245 #ifndef ONE_BOARD_MICRO_COMPUTER
246 config.window_mode = MyGetPrivateProfileInt(_T("Screen"), _T("WindowMode"), config.window_mode, config_path);
248 config.use_d3d9 = MyGetPrivateProfileBool(_T("Screen"), _T("UseD3D9"), config.use_d3d9, config_path);
249 config.wait_vsync = MyGetPrivateProfileBool(_T("Screen"), _T("WaitVSync"), config.wait_vsync, config_path);
251 //- config.stretch_type = MyGetPrivateProfileInt(_T("Screen"), _T("StretchType"), config.stretch_type, config_path);
252 config.window_stretch_type = MyGetPrivateProfileInt(_T("Screen"), _T("WindowStretchType"), config.window_stretch_type, config_path);
253 config.fullscreen_stretch_type = MyGetPrivateProfileInt(_T("Screen"), _T("FullScreenStretchType"), config.fullscreen_stretch_type, config_path);
256 config.window_mode = MyGetPrivateProfileInt(_T("Screen"), _T("WindowMode"), config.window_mode, config_path);
258 #ifdef USE_MONITOR_TYPE
259 config.monitor_type = MyGetPrivateProfileInt(_T("Screen"), _T("MonitorType"), config.monitor_type, config_path);
261 #ifdef USE_CRT_FILTER
262 config.crt_filter = MyGetPrivateProfileBool(_T("Screen"), _T("CRTFilter"), config.crt_filter, config_path);
265 config.scan_line = MyGetPrivateProfileBool(_T("Screen"), _T("ScanLine"), config.scan_line, config_path);
268 #ifdef USE_SCREEN_ROTATE
269 config.rotate_type = MyGetPrivateProfileInt(_T("Screen"), _T("RotateType"), config.rotate_type, config_path);
272 config.use_opengl_scanline = MyGetPrivateProfileBool(_T("Screen"), _T("UseOpenGLScanLine"),
273 config.use_opengl_scanline, config_path);
274 config.opengl_scanline_vert = MyGetPrivateProfileBool(_T("Screen"), _T("OpenGLScanLineVert"),
275 config.opengl_scanline_vert, config_path);;
276 config.opengl_scanline_horiz = MyGetPrivateProfileBool(_T("Screen"), _T("OpenGLScanLineHoriz"),
277 config.opengl_scanline_horiz, config_path);;
278 config.use_opengl_filters = MyGetPrivateProfileBool(_T("Screen"), _T("UseOpenGLFilters"),
279 config.use_opengl_filters, config_path);
280 config.opengl_filter_num = MyGetPrivateProfileInt(_T("Screen"), _T("OpenGLFilterNum"),
281 config.opengl_filter_num, config_path);
284 config.sound_frequency = MyGetPrivateProfileInt(_T("Sound"), _T("Frequency"), config.sound_frequency, config_path);
285 config.sound_latency = MyGetPrivateProfileInt(_T("Sound"), _T("Latency"), config.sound_latency, config_path);
286 #ifdef USE_SOUND_DEVICE_TYPE
287 config.sound_device_type = MyGetPrivateProfileInt(_T("Sound"), _T("DeviceType"), config.sound_device_type, config_path);
289 #ifdef USE_SOUND_VOLUME
290 for(int i = 0; i < USE_SOUND_VOLUME; i++) {
291 int tmp_l = MyGetPrivateProfileInt(_T("Sound"), create_string(_T("VolumeLeft%d"), i + 1), config.sound_volume_l[i], config_path);
292 int tmp_r = MyGetPrivateProfileInt(_T("Sound"), create_string(_T("VolumeRight%d"), i + 1), config.sound_volume_r[i], config_path);
293 config.sound_volume_l[i] = max(-40, min(0, tmp_l));
294 config.sound_volume_r[i] = max(-40, min(0, tmp_r));
297 #if !defined(_USE_QT)
298 MyGetPrivateProfileString(_T("Sound"), _T("FMGenDll"), _T("mamefm.dll"), config.fmgen_dll_path, _MAX_PATH, config_path);
301 config.general_sound_level = MyGetPrivateProfileInt(_T("Sound"), _T("GeneralSoundLevel"),
302 config.general_sound_level, config_path);
304 config.use_direct_input = MyGetPrivateProfileBool(_T("Input"), _T("UseDirectInput"), config.use_direct_input, config_path);
305 config.disable_dwm = MyGetPrivateProfileBool(_T("Input"), _T("DisableDwm"), config.disable_dwm, config_path);
307 config.keyboard_type = MyGetPrivateProfileInt(_T("Input"), _T("KeyboardType"), config.keyboard_type, config_path);
308 for(int i = 0; i < 4; i++) {
309 for(int j = 0; j < 16; j++) {
310 config.joy_buttons[i][j] = MyGetPrivateProfileInt(_T("Input"), create_string(_T("JoyButtons%d_%d"), i + 1, j + 1), config.joy_buttons[i][j], config_path);
314 for(i = 0; i < 16; i++) {
316 my_stprintf_s(name, 256, _T("AssignedJoystick"), i + 1);
317 MyGetPrivateProfileString(_T("Input"), (const _TCHAR *)name, _T(""),
318 config.assigned_joystick_name[i], 256, config_path);
323 config.printer_device_type = MyGetPrivateProfileInt(_T("Printer"), _T("DeviceType"), config.printer_device_type, config_path);
324 MyGetPrivateProfileString(_T("Printer"), _T("PrinterDll"), _T("printer.dll"), config.printer_dll_path, _MAX_PATH, config_path);
326 #if defined(_USE_QT) && !defined(Q_OS_WIN)
327 AGAR_DebugLog(AGAR_LOG_INFO, "Read Done.");
331 void save_config(const _TCHAR *config_path)
334 #if !defined(_MSC_VER)
336 FILEIO *pt = new FILEIO;
337 if(pt->Fopen(config_path, FILEIO_WRITE_ASCII) != true) {
347 # ifdef USE_BOOT_MODE
348 MyWritePrivateProfileInt(_T("Control"), _T("BootMode"), config.boot_mode, config_path);
351 MyWritePrivateProfileInt(_T("Control"), _T("CPUType"), config.cpu_type, config_path);
354 MyWritePrivateProfileInt(_T("Control"), _T("DipSwitch"), config.dipswitch, config_path);
356 #ifdef USE_DEVICE_TYPE
357 MyWritePrivateProfileInt(_T("Control"), _T("DeviceType"), config.device_type, config_path);
359 #ifdef USE_DRIVE_TYPE
360 MyWritePrivateProfileInt(_T("Control"), _T("DriveType"), config.drive_type, config_path);
364 for(drv = 0; drv < MAX_FD; drv++) {
365 MyWritePrivateProfileBool(_T("Control"), create_string(_T("CorrectDiskTiming%d"), drv + 1), config.correct_disk_timing[drv], config_path);
366 MyWritePrivateProfileBool(_T("Control"), create_string(_T("IgnoreDiskCRC%d"), drv + 1), config.ignore_disk_crc[drv], config_path);
372 MyWritePrivateProfileBool(_T("Control"), _T("TapeSound"), config.tape_sound, config_path);
373 MyWritePrivateProfileBool(_T("Control"), _T("WaveShaper"), config.wave_shaper, config_path);
374 MyWritePrivateProfileBool(_T("Control"), _T("DirectLoadMZT"), config.direct_load_mzt, config_path);
375 MyWritePrivateProfileBool(_T("Control"), _T("BaudHigh"), config.baud_high, config_path);
380 MyWritePrivateProfileString(_T("RecentFiles"), _T("InitialCartDir"), config.initial_cart_dir, config_path);
381 for(drv = 0; drv < MAX_CART; drv++) {
382 for(i = 0; i < MAX_HISTORY; i++) {
383 MyWritePrivateProfileString(_T("RecentFiles"), create_string(_T("RecentCartPath%d_%d"), drv + 1, i + 1), config.recent_cart_path[drv][i], config_path);
388 MyWritePrivateProfileString(_T("RecentFiles"), _T("InitialDiskDir"), config.initial_floppy_disk_dir, config_path);
389 for(drv = 0; drv < MAX_FD; drv++) {
390 for(i = 0; i < MAX_HISTORY; i++) {
391 MyWritePrivateProfileString(_T("RecentFiles"), create_string(_T("RecentDiskPath%d_%d"), drv + 1, i + 1), config.recent_floppy_disk_path[drv][i], config_path);
396 MyWritePrivateProfileString(_T("RecentFiles"), _T("InitialQuickDiskDir"), config.initial_quick_disk_dir, config_path);
397 for(drv = 0; drv < MAX_QD; drv++) {
398 for(i = 0; i < MAX_HISTORY; i++) {
399 MyWritePrivateProfileString(_T("RecentFiles"), create_string(_T("RecentQuickDiskPath%d_%d"), drv + 1, i + 1), config.recent_quick_disk_path[drv][i], config_path);
404 MyWritePrivateProfileString(_T("RecentFiles"), _T("InitialTapeDir"), config.initial_tape_dir, config_path);
405 for(i = 0; i < MAX_HISTORY; i++) {
406 MyWritePrivateProfileString(_T("RecentFiles"), create_string(_T("RecentTapePath1_%d"), i + 1), config.recent_tape_path[i], config_path);
409 #ifdef USE_LASER_DISC
410 MyWritePrivateProfileString(_T("RecentFiles"), _T("InitialLaserDiscDir"), config.initial_laser_disc_dir, config_path);
411 for(int i = 0; i < MAX_HISTORY; i++) {
412 MyWritePrivateProfileString(_T("RecentFiles"), create_string(_T("RecentLaserDiscPath1_%d"), i + 1), config.recent_laser_disc_path[i], config_path);
415 #ifdef USE_BINARY_FILE1
416 MyWritePrivateProfileString(_T("RecentFiles"), _T("InitialBinaryDir"), config.initial_binary_dir, config_path);
417 for(drv = 0; drv < MAX_BINARY; drv++) {
418 for(i = 0; i < MAX_HISTORY; i++) {
419 MyWritePrivateProfileString(_T("RecentFiles"), create_string(_T("RecentBinaryPath%d_%d"), drv + 1, i + 1), config.recent_binary_path[drv][i], config_path);
425 #ifndef ONE_BOARD_MICRO_COMPUTER
426 MyWritePrivateProfileInt(_T("Screen"), _T("WindowMode"), config.window_mode, config_path);
428 MyWritePrivateProfileBool(_T("Screen"), _T("UseD3D9"), config.use_d3d9, config_path);
429 MyWritePrivateProfileBool(_T("Screen"), _T("WaitVSync"), config.wait_vsync, config_path);
431 //MyWritePrivateProfileInt(_T("Screen"), _T("StretchType"), config.stretch_type, config_path);
432 MyWritePrivateProfileInt(_T("Screen"), _T("WindowStretchType"), config.window_stretch_type, config_path);
433 MyWritePrivateProfileInt(_T("Screen"), _T("FullScreenStretchType"), config.fullscreen_stretch_type, config_path);
436 MyWritePrivateProfileInt(_T("Screen"), _T("WindowMode"), config.window_mode, config_path);
438 #ifdef USE_MONITOR_TYPE
439 MyWritePrivateProfileInt(_T("Screen"), _T("MonitorType"), config.monitor_type, config_path);
441 #ifdef USE_CRT_FILTER
442 MyWritePrivateProfileBool(_T("Screen"), _T("CRTFilter"), config.crt_filter, config_path);
445 MyWritePrivateProfileBool(_T("Screen"), _T("ScanLine"), config.scan_line, config_path);
447 #ifdef USE_SCREEN_ROTATE
448 MyWritePrivateProfileInt(_T("Screen"), _T("RotateType"), config.rotate_type, config_path);
451 MyWritePrivateProfileBool(_T("Screen"), _T("UseOpenGLScanLine"),
452 config.use_opengl_scanline, config_path);
453 MyWritePrivateProfileBool(_T("Screen"), _T("OpenGLScanLineVert"),
454 config.opengl_scanline_vert, config_path);;
455 MyWritePrivateProfileBool(_T("Screen"), _T("OpenGLScanLineHoriz"),
456 config.opengl_scanline_horiz, config_path);;
457 MyWritePrivateProfileBool(_T("Screen"), _T("UseOpenGLFilters"),
458 config.use_opengl_filters, config_path);
459 MyWritePrivateProfileInt(_T("Screen"), _T("OpenGLFilterNum"),
460 config.opengl_filter_num, config_path);
464 MyWritePrivateProfileInt(_T("Sound"), _T("Frequency"), config.sound_frequency, config_path);
465 MyWritePrivateProfileInt(_T("Sound"), _T("Latency"), config.sound_latency, config_path);
466 #ifdef USE_SOUND_DEVICE_TYPE
467 MyWritePrivateProfileInt(_T("Sound"), _T("DeviceType"), config.sound_device_type, config_path);
469 #ifdef USE_SOUND_VOLUME
470 for(int i = 0; i < USE_SOUND_VOLUME; i++) {
471 MyWritePrivateProfileInt(_T("Sound"), create_string(_T("VolumeLeft%d"), i + 1), config.sound_volume_l[i], config_path);
472 MyWritePrivateProfileInt(_T("Sound"), create_string(_T("VolumeRight%d"), i + 1), config.sound_volume_r[i], config_path);
475 #if !defined(_USE_QT)
476 MyWritePrivateProfileString(_T("Sound"), _T("FMGenDll"), config.fmgen_dll_path, config_path);
478 MyWritePrivateProfileInt(_T("Sound"), _T("GeneralSoundLevel"),
479 config.general_sound_level, config_path);
482 MyWritePrivateProfileBool(_T("Input"), _T("UseDirectInput"), config.use_direct_input, config_path);
483 MyWritePrivateProfileBool(_T("Input"), _T("DisableDwm"), config.disable_dwm, config_path);
485 MyWritePrivateProfileInt(_T("Input"), _T("KeyboardType"), config.keyboard_type, config_path);
486 for(int i = 0; i < 4; i++) {
487 for(int j = 0; j < 16; j++) {
488 MyWritePrivateProfileInt(_T("Input"), create_string(_T("JoyButtons%d_%d"), i + 1, j + 1), config.joy_buttons[i][j], config_path);
492 for(i = 0; i < 16; i++) {
494 my_stprintf_s(name, 256, _T("AssignedJoystick%d"), i + 1);
495 MyWritePrivateProfileString(_T("Input"), (const _TCHAR *)name,
496 config.assigned_joystick_name[i], config_path);
502 MyWritePrivateProfileInt(_T("Printer"), _T("DeviceType"), config.printer_device_type, config_path);
504 #if defined(_USE_QT) && !defined(Q_OS_WIN)
505 AGAR_DebugLog(AGAR_LOG_INFO, "Write done.");
509 #define STATE_VERSION 5
511 void save_config_state(void *f)
513 FILEIO *state_fio = (FILEIO *)f;
516 state_fio->FputUint32(STATE_VERSION);
519 state_fio->FputInt32(config.boot_mode);
522 state_fio->FputInt32(config.cpu_type);
525 state_fio->FputUint32(config.dipswitch);
527 #ifdef USE_DEVICE_TYPE
528 state_fio->FputInt32(config.device_type);
530 #ifdef USE_DRIVE_TYPE
531 state_fio->FputInt32(config.drive_type);
534 for(int drv = 0; drv < MAX_FD; drv++) {
535 state_fio->FputBool(config.correct_disk_timing[drv]);
536 state_fio->FputBool(config.ignore_disk_crc[drv]);
538 // for(int drv = 0; drv < MAX_FD; drv++) {
539 // state_fio->FputBool(config.fdd_hack_fast_transfer[drv]);
542 #ifdef USE_MONITOR_TYPE
543 state_fio->FputInt32(config.monitor_type);
545 #ifdef USE_SOUND_DEVICE_TYPE
546 state_fio->FputInt32(config.sound_device_type);
549 state_fio->FputInt32(config.printer_device_type);
551 state_fio->FputInt32(config.keyboard_type);
554 bool load_config_state(void *f)
556 FILEIO *state_fio = (FILEIO *)f;
558 if(state_fio->FgetUint32() != STATE_VERSION) {
562 config.boot_mode = state_fio->FgetInt32();
565 config.cpu_type = state_fio->FgetInt32();
568 config.dipswitch = state_fio->FgetUint32();
570 #ifdef USE_DEVICE_TYPE
571 config.device_type = state_fio->FgetInt32();
573 #ifdef USE_DRIVE_TYPE
574 config.drive_type = state_fio->FgetInt32();
577 for(int drv = 0; drv < MAX_FD; drv++) {
578 config.correct_disk_timing[drv] = state_fio->FgetBool();
579 config.ignore_disk_crc[drv] = state_fio->FgetBool();
581 // for(int drv = 0; drv < MAX_FD; drv++) {
582 // config.fdd_hack_fast_transfer[drv] = state_fio->FgetBool();
585 #ifdef USE_MONITOR_TYPE
586 config.monitor_type = state_fio->FgetInt32();
588 #ifdef USE_SOUND_DEVICE_TYPE
589 config.sound_device_type = state_fio->FgetInt32();
592 config.printer_device_type = state_fio->FgetInt32();
594 config.keyboard_type = state_fio->FgetInt32();