-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathEmulatorSettings.cpp
799 lines (671 loc) · 18.6 KB
/
EmulatorSettings.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
#include "EmulatorSettings.h"
using namespace Windows::Foundation;
#define DEFAULT_SHOW_FPS_VALUE true
#define DEFAULT_SOUND_ENABLED_VALUE true
#define DEFAULT_TOUCH_ENABLED_VALUE true
#define DEFAULT_TOUCH_ON_TOP false
#define DEFAULT_CONTROL_ASSIGNED_TO_P2 false
#define DEFAULT_TOUCH_BUTTONS_INTERSECTING false
#define DEFAULT_AUTOSAVING_ENABLED true
#define DEFAULT_GRAY_BUTTONS false
#define DEFAULT_CONTROLLER_SCALE 100
#define DEFAULT_CONTROLLER_OPACITY 50
#define DEFAULT_ASPECT AspectRatioMode::Original
#define DEFAULT_IMAGE_SCALE 100
#define DEFAULT_SYNC_AUDIO false
#define DEFAULT_DPAD_STYLE 1
#define DEFAULT_DEADZONE_VALUE 10.0f
#define DEFAULT_MONITOR_TYPE MONITOR_60HZ
#define DEFAULT_SAVE_CONFIRM true
#define DEFAULT_LOAD_CONFIRM false
#define DEFAULT_LINEAR_FILTER true
#define DEFAULT_LEFT_KEY 65
#define DEFAULT_RIGHT_KEY 68
#define DEFAULT_UP_KEY 87
#define DEFAULT_DOWN_KEY 83
#define DEFAULT_START_KEY 32
#define DEFAULT_SELECT_KEY 16
#define DEFAULT_A_KEY 75
#define DEFAULT_B_KEY 74
#define DEFAULT_X_KEY 38
#define DEFAULT_Y_KEY 37
#define DEFAULT_L_KEY 81
#define DEFAULT_R_KEY 69
#define DEFAULT_TURBO_KEY 84
extern bool soundInit(void);
extern bool synchronize;
namespace VBA10
{
EmulatorSettings ^EmulatorSettings::instance;
EmulatorSettings::EmulatorSettings()
{
localSettings = ApplicationData::Current->LocalSettings;
}
void EmulatorSettings::AddOrUpdateValue( Platform::String^ key, Platform::Object^ value)
{
localSettings->Values->Insert(key, value);
}
//bool timeMeasured = false;
bool showFPS = false;
bool soundEnabled = true;
bool touchEnabled = true;
//bool lowFrequencyMode = false;
bool touchControllerOnTop = true;
bool autosavingEnabled = true;
int controllerOpacity = 50;
AspectRatioMode aspect = AspectRatioMode::Original;
int imageScale = 100;
float deadzone = 10.0f;
int monitorType = 1;
bool saveConfirmDisabled = false;
bool loadConfirmDisabled = false;
bool linearFilterEnabled = true;
VirtualKey leftKey;
VirtualKey upKey;
VirtualKey rightKey;
VirtualKey downKey;
VirtualKey bKey;
VirtualKey aKey;
VirtualKey startKey;
VirtualKey selectKey;
VirtualKey lKey;
VirtualKey rKey;
VirtualKey turboKey;
void setLeftKeyBinding(VirtualKey key);
void setRightKeyBinding(VirtualKey key);
void setUpKeyBinding(VirtualKey key);
void setDownKeyBinding(VirtualKey key);
void setStartKeyBinding(VirtualKey key);
void setSelectKeyBinding(VirtualKey key);
void setAKeyBinding(VirtualKey key);
void setBKeyBinding(VirtualKey key);
void setLKeyBinding(VirtualKey key);
void setRKeyBinding(VirtualKey key);
void setTurboKeyBinding(VirtualKey key);
void setSynchronizeAudio(bool sync);
void setMonitorType(int type);
//void enableLowDisplayRefreshMode(bool enable);
void enableTouchControls(bool enable);
void enableSound(bool enable);
void setTouchControllerOnTop(bool onTop);
void enableShowFPS(bool show);
void enableAutosaving(bool enable);
void setControllerOpacity(int opacity);
void setAspectRatio(AspectRatioMode aspect);
void setImageScale(int scale);
void disableSaveConfirmation(bool disable);
void disableLoadConfirmation(bool disable);
void enableLinearFilter(bool enable);
void setMonitorType(int type)
{
monitorType = type;
}
int GetMonitorType(void)
{
return monitorType;
}
void SetMonitorType(int type)
{
setMonitorType(type);
StoreSettings();
}
void setSynchronizeAudio(bool sync)
{
synchronize = sync;
}
bool SynchronizeAudio(void)
{
return synchronize;
}
void SetSynchronizeAudio(bool sync)
{
setSynchronizeAudio(sync);
StoreSettings();
}
void setTurboKeyBinding(VirtualKey key)
{
turboKey = key;
}
VirtualKey GetTurboKeyBinding(void)
{
return turboKey;
}
void SetTurboKeyBinding(VirtualKey key)
{
setTurboKeyBinding(key);
StoreSettings();
}
VirtualKey GetLeftKeyBinding(void)
{
return leftKey;
}
void setLeftKeyBinding(VirtualKey key)
{
leftKey = key;
}
void SetLeftKeyBinding(VirtualKey key)
{
setLeftKeyBinding(key);
StoreSettings();
}
VirtualKey GetRightKeyBinding(void)
{
return rightKey;
}
void setRightKeyBinding(VirtualKey key)
{
rightKey = key;
}
void SetRightKeyBinding(VirtualKey key)
{
setRightKeyBinding(key);
StoreSettings();
}
VirtualKey GetUpKeyBinding(void)
{
return upKey;
}
void setUpKeyBinding(VirtualKey key)
{
upKey = key;
}
void SetUpKeyBinding(VirtualKey key)
{
setUpKeyBinding(key);
StoreSettings();
}
VirtualKey GetDownKeyBinding(void)
{
return downKey;
}
void setDownKeyBinding(VirtualKey key)
{
downKey = key;
}
void SetDownKeyBinding(VirtualKey key)
{
setDownKeyBinding(key);
StoreSettings();
}
VirtualKey GetStartKeyBinding(void)
{
return startKey;
}
void setStartKeyBinding(VirtualKey key)
{
startKey = key;
}
void SetStartKeyBinding(VirtualKey key)
{
setStartKeyBinding(key);
StoreSettings();
}
VirtualKey GetSelectKeyBinding(void)
{
return selectKey;
}
void setSelectKeyBinding(VirtualKey key)
{
selectKey = key;
}
void SetSelectKeyBinding(VirtualKey key)
{
setSelectKeyBinding(key);
StoreSettings();
}
VirtualKey GetAKeyBinding(void)
{
return aKey;
}
void setAKeyBinding(VirtualKey key)
{
aKey = key;
}
void SetAKeyBinding(VirtualKey key)
{
setAKeyBinding(key);
StoreSettings();
}
VirtualKey GetBKeyBinding(void)
{
return bKey;
}
void setBKeyBinding(VirtualKey key)
{
bKey = key;
}
void SetBKeyBinding(VirtualKey key)
{
setBKeyBinding(key);
StoreSettings();
}
VirtualKey GetLKeyBinding(void)
{
return lKey;
}
void setLKeyBinding(VirtualKey key)
{
lKey = key;
}
void SetLKeyBinding(VirtualKey key)
{
setLKeyBinding(key);
StoreSettings();
}
VirtualKey GetRKeyBinding(void)
{
return rKey;
}
void setRKeyBinding(VirtualKey key)
{
rKey = key;
}
void SetRKeyBinding(VirtualKey key)
{
setRKeyBinding(key);
StoreSettings();
}
void SetTouchControllerOnTop(bool onTop)
{
setTouchControllerOnTop(onTop);
StoreSettings();
}
void setTouchControllerOnTop(bool onTop)
{
touchControllerOnTop = onTop;
EmulatorGame *emulator = EmulatorGame::GetInstance();
emulator->GetVirtualController()->UpdateVirtualControllerRectangles();
}
bool IsTouchControllerOnTop(void)
{
return touchControllerOnTop;
}
/*bool LowDisplayRefreshModeActivated(void)
{
return lowFrequencyMode;
}
void EnableLowDisplayRefreshMode(bool enable)
{
enableLowDisplayRefreshMode(enable);
StoreSettings();
}
void enableLowDisplayRefreshMode(bool enable)
{
lowFrequencyMode = enable;
timeMeasured = true;
}*/
bool TouchControlsEnabled(void)
{
return touchEnabled;
}
void EnableTouchControls(bool enable)
{
enableTouchControls(enable);
StoreSettings();
}
void enableTouchControls(bool enable)
{
touchEnabled = enable;
}
void ShowFPS(bool show)
{
enableShowFPS(show);
StoreSettings();
}
void enableShowFPS(bool show)
{
showFPS = show;
}
bool ShowingFPS(void)
{
return showFPS;
}
bool SoundEnabled(void)
{
return soundEnabled;
}
void EnableSound(bool enable)
{
enableSound(enable);
StoreSettings();
}
void enableSound(bool enable)
{
soundEnabled = enable;
soundInit();
//Settings.Mute = !enable;
}
void enableAutosaving(bool enable)
{
autosavingEnabled = enable;
}
void EnableAutosaving(bool enable)
{
enableAutosaving(enable);
StoreSettings();
}
bool AutosavingEnabled(void)
{
return autosavingEnabled;
}
void setAspectRatio(AspectRatioMode aspect)
{
VBA10::aspect = aspect;
}
void SetAspectRatio(AspectRatioMode aspect)
{
setAspectRatio(aspect);
StoreSettings();
}
AspectRatioMode GetAspectRatio(void)
{
return aspect;
}
void setImageScale(int scale)
{
imageScale = scale;
}
void SetImageScale(int scale)
{
setImageScale(scale);
StoreSettings();
}
int GetImageScale(void)
{
return imageScale;
}
void setControllerOpacity(int opacity)
{
controllerOpacity = opacity;
StoreSettings();
}
void SetControllerOpacity(int opacity)
{
setControllerOpacity(opacity);
StoreSettings();
}
int GetControllerOpacity(void)
{
return controllerOpacity;
}
void setDeadzone(float value)
{
deadzone = value;
}
void SetDeadzone(float value)
{
setDeadzone(value);
StoreSettings();
}
float GetDeadzone(void)
{
return deadzone;
}
void disableSaveConfirmation(bool disable)
{
saveConfirmDisabled = disable;
}
void DisableSaveConfirmation(bool disable)
{
disableSaveConfirmation(disable);
StoreSettings();
}
bool IsSaveConfirmationDisabled(void)
{
return saveConfirmDisabled;
}
void disableLoadConfirmation(bool disable)
{
loadConfirmDisabled = disable;
}
void DisableLoadConfirmation(bool disable)
{
disableLoadConfirmation(disable);
StoreSettings();
}
bool IsLoadConfirmationDisabled(void)
{
return loadConfirmDisabled;
}
void StoreSettings(void)
{
ApplicationDataContainer ^localSettings = ApplicationData::Current->LocalSettings;
auto values = localSettings->Values;
values->Insert("ShowFPS", dynamic_cast<PropertyValue^>(PropertyValue::CreateBoolean(showFPS)));
values->Insert("SoundEnabled", dynamic_cast<PropertyValue^>(PropertyValue::CreateBoolean(soundEnabled)));
values->Insert("TouchEnabled", dynamic_cast<PropertyValue^>(PropertyValue::CreateBoolean(touchEnabled)));
//values->Insert("LowRefreshMode", dynamic_cast<PropertyValue^>(PropertyValue::CreateBoolean(lowFrequencyMode)));
values->Insert("LeftKeyMapping", dynamic_cast<PropertyValue^>(PropertyValue::CreateInt32((int)leftKey)));
values->Insert("RightKeyMapping", dynamic_cast<PropertyValue^>(PropertyValue::CreateInt32((int)rightKey)));
values->Insert("DownKeyMapping", dynamic_cast<PropertyValue^>(PropertyValue::CreateInt32((int)downKey)));
values->Insert("UpKeyMapping", dynamic_cast<PropertyValue^>(PropertyValue::CreateInt32((int)upKey)));
values->Insert("LKeyMapping", dynamic_cast<PropertyValue^>(PropertyValue::CreateInt32((int)lKey)));
values->Insert("RKeyMapping", dynamic_cast<PropertyValue^>(PropertyValue::CreateInt32((int)rKey)));
values->Insert("StartKeyMapping", dynamic_cast<PropertyValue^>(PropertyValue::CreateInt32((int)startKey)));
values->Insert("SelectKeyMapping", dynamic_cast<PropertyValue^>(PropertyValue::CreateInt32((int)selectKey)));
values->Insert("BKeyMapping", dynamic_cast<PropertyValue^>(PropertyValue::CreateInt32((int)bKey)));
values->Insert("AKeyMapping", dynamic_cast<PropertyValue^>(PropertyValue::CreateInt32((int)aKey)));
values->Insert("TurboKeyMapping", dynamic_cast<PropertyValue^>(PropertyValue::CreateInt32((int)turboKey)));
values->Insert("TouchControllerOnTop", dynamic_cast<PropertyValue^>(PropertyValue::CreateBoolean(touchControllerOnTop)));
values->Insert("EnableAutosaving", dynamic_cast<PropertyValue^>(PropertyValue::CreateBoolean(autosavingEnabled)));
values->Insert("AspectRatio", dynamic_cast<PropertyValue^>(PropertyValue::CreateInt32((int) aspect)));
values->Insert("ImageScale", dynamic_cast<PropertyValue^>(PropertyValue::CreateInt32(imageScale)));
values->Insert("ControllerOpacity", dynamic_cast<PropertyValue^>(PropertyValue::CreateInt32(controllerOpacity)));
values->Insert("SynchronizeAudio", dynamic_cast<PropertyValue^>(PropertyValue::CreateBoolean(synchronize)));
values->Insert("Deadzone", dynamic_cast<PropertyValue^>(PropertyValue::CreateSingle(deadzone)));
values->Insert("MonitorType", dynamic_cast<PropertyValue^>(PropertyValue::CreateInt32(monitorType)));
values->Insert("LoadConfirmation", dynamic_cast<PropertyValue^>(PropertyValue::CreateBoolean(loadConfirmDisabled)));
values->Insert("SaveConfirmation", dynamic_cast<PropertyValue^>(PropertyValue::CreateBoolean(saveConfirmDisabled)));
}
void RestoreSettings(void)
{
ApplicationDataContainer ^localSettings = ApplicationData::Current->LocalSettings;
auto values = localSettings->Values;
auto loadConfirmEntry = safe_cast<IPropertyValue^>(values->Lookup("LoadConfirmation"));
auto saveConfirmEntry = safe_cast<IPropertyValue^>(values->Lookup("SaveConfirmation"));
auto showFpsEntry = safe_cast<IPropertyValue^>(values->Lookup("ShowFPS"));
auto enableSoundEntry = safe_cast<IPropertyValue^>(values->Lookup("SoundEnabled"));
auto touchEnabledEntry = safe_cast<IPropertyValue^>(values->Lookup("TouchEnabled"));
//auto lowFrequencyMode = safe_cast<IPropertyValue^>(values->Lookup("LowRefreshMode"));
auto touchControllerOnTop = safe_cast<IPropertyValue^>(values->Lookup("TouchControllerOnTop"));
auto controLCenterYlayer2 = safe_cast<IPropertyValue^>(values->Lookup("ControlAssignedToPlayer2"));
auto buttonsIntersecting = safe_cast<IPropertyValue^>(values->Lookup("TouchButtonsIntersecting"));
auto autosaving = safe_cast<IPropertyValue^>(values->Lookup("EnableAutosaving"));
auto grayButtons = safe_cast<IPropertyValue^>(values->Lookup("GrayButtons"));
auto aspect = safe_cast<IPropertyValue^>(values->Lookup("AspectRatio"));
auto imageScale = safe_cast<IPropertyValue^>(values->Lookup("ImageScale"));
auto controllerOpacity = safe_cast<IPropertyValue^>(values->Lookup("ControllerOpacity"));
auto synchronizeAudio = safe_cast<IPropertyValue^>(values->Lookup("SynchronizeAudio"));
auto deadzoneEntry = safe_cast<IPropertyValue^>(values->Lookup("Deadzone"));
auto monitorTypeEntry = safe_cast<IPropertyValue^>(values->Lookup("MonitorType"));
auto leftKeyEntry = safe_cast<IPropertyValue^>(values->Lookup("LeftKeyMapping"));
auto rightKeyEntry = safe_cast<IPropertyValue^>(values->Lookup("RightKeyMapping"));
auto downKeyEntry = safe_cast<IPropertyValue^>(values->Lookup("DownKeyMapping"));
auto upKeyEntry = safe_cast<IPropertyValue^>(values->Lookup("UpKeyMapping"));
auto lKeyEntry = safe_cast<IPropertyValue^>(values->Lookup("LKeyMapping"));
auto rKeyEntry = safe_cast<IPropertyValue^>(values->Lookup("RKeyMapping"));
auto startKeyEntry = safe_cast<IPropertyValue^>(values->Lookup("StartKeyMapping"));
auto selectKeyEntry = safe_cast<IPropertyValue^>(values->Lookup("SelectKeyMapping"));
auto bKeyEntry = safe_cast<IPropertyValue^>(values->Lookup("BKeyMapping"));
auto aKeyEntry = safe_cast<IPropertyValue^>(values->Lookup("AKeyMapping"));
auto xKeyEntry = safe_cast<IPropertyValue^>(values->Lookup("XKeyMapping"));
auto yKeyEntry = safe_cast<IPropertyValue^>(values->Lookup("YKeyMapping"));
auto turboKeyEntry = safe_cast<IPropertyValue^>(values->Lookup("TurboKeyMapping"));
auto linearFilterEntry = safe_cast<IPropertyValue^>(values->Lookup("LinearFilter"));
if(loadConfirmEntry)
{
disableLoadConfirmation(loadConfirmEntry->GetBoolean());
}else
{
disableLoadConfirmation(DEFAULT_LOAD_CONFIRM);
}
if(saveConfirmEntry)
{
disableSaveConfirmation(saveConfirmEntry->GetBoolean());
}else
{
disableSaveConfirmation(DEFAULT_SAVE_CONFIRM);
}
if(monitorTypeEntry)
{
setMonitorType(monitorTypeEntry->GetInt32());
}else
{
setMonitorType(DEFAULT_MONITOR_TYPE);
}
if(deadzoneEntry)
{
setDeadzone(deadzoneEntry->GetSingle());
}else
{
setDeadzone(DEFAULT_DEADZONE_VALUE);
}
if(synchronizeAudio)
{
setSynchronizeAudio(synchronizeAudio->GetBoolean());
}else
{
setSynchronizeAudio(DEFAULT_SYNC_AUDIO);
}
if(controllerOpacity)
{
setControllerOpacity(controllerOpacity->GetInt32());
}else
{
setControllerOpacity(DEFAULT_CONTROLLER_OPACITY);
}
if(aspect)
{
setAspectRatio((AspectRatioMode) aspect->GetInt32());
}else
{
setAspectRatio(DEFAULT_ASPECT);
}
if(imageScale)
{
setImageScale(imageScale->GetInt32());
}else
{
setImageScale(DEFAULT_IMAGE_SCALE);
}
if(autosaving)
{
enableAutosaving(autosaving->GetBoolean());
}else
{
enableAutosaving(DEFAULT_AUTOSAVING_ENABLED);
}
if(touchControllerOnTop)
{
setTouchControllerOnTop(touchControllerOnTop->GetBoolean());
}else
{
setTouchControllerOnTop(DEFAULT_TOUCH_ON_TOP);
}
/*if(lowFrequencyMode)
{
enableLowDisplayRefreshMode(lowFrequencyMode->GetBoolean());
}*/
if(showFpsEntry)
{
enableShowFPS(showFpsEntry->GetBoolean());
}
else
{
enableShowFPS(DEFAULT_SHOW_FPS_VALUE);
}
if(enableSoundEntry)
{
enableSound(enableSoundEntry->GetBoolean());
}
else
{
enableSound(DEFAULT_SOUND_ENABLED_VALUE);
}
if(touchEnabledEntry)
{
enableTouchControls(touchEnabledEntry->GetBoolean());
}else
{
enableTouchControls(DEFAULT_TOUCH_ENABLED_VALUE);
}
if(turboKeyEntry)
{
setTurboKeyBinding((VirtualKey) turboKeyEntry->GetInt32());
}else
{
setTurboKeyBinding((VirtualKey) DEFAULT_TURBO_KEY);
}
if(leftKeyEntry)
{
setLeftKeyBinding((VirtualKey) leftKeyEntry->GetInt32());
}else
{
setLeftKeyBinding((VirtualKey) DEFAULT_LEFT_KEY);
}
if(rightKeyEntry)
{
setRightKeyBinding((VirtualKey) rightKeyEntry->GetInt32());
}else
{
setRightKeyBinding((VirtualKey) DEFAULT_RIGHT_KEY);
}
if(upKeyEntry)
{
setUpKeyBinding((VirtualKey) upKeyEntry->GetInt32());
}else
{
setUpKeyBinding((VirtualKey) DEFAULT_UP_KEY);
}
if(downKeyEntry)
{
setDownKeyBinding((VirtualKey) downKeyEntry->GetInt32());
}else
{
setDownKeyBinding((VirtualKey) DEFAULT_DOWN_KEY);
}
if(startKeyEntry)
{
setStartKeyBinding((VirtualKey) startKeyEntry->GetInt32());
}else
{
setStartKeyBinding((VirtualKey) DEFAULT_START_KEY);
}
if(selectKeyEntry)
{
setSelectKeyBinding((VirtualKey) selectKeyEntry->GetInt32());
}else
{
setSelectKeyBinding((VirtualKey) DEFAULT_SELECT_KEY);
}
if(aKeyEntry)
{
setAKeyBinding((VirtualKey) aKeyEntry->GetInt32());
}else
{
setAKeyBinding((VirtualKey) DEFAULT_A_KEY);
}
if(bKeyEntry)
{
setBKeyBinding((VirtualKey) bKeyEntry->GetInt32());
}else
{
setBKeyBinding((VirtualKey) DEFAULT_B_KEY);
}
if(lKeyEntry)
{
setLKeyBinding((VirtualKey) lKeyEntry->GetInt32());
}else
{
setLKeyBinding((VirtualKey) DEFAULT_L_KEY);
}
if(rKeyEntry)
{
setRKeyBinding((VirtualKey) rKeyEntry->GetInt32());
}else
{
setRKeyBinding((VirtualKey) DEFAULT_R_KEY);
}
StoreSettings();
}
}