-
Notifications
You must be signed in to change notification settings - Fork 193
/
menu.c
4089 lines (3651 loc) · 135 KB
/
menu.c
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
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/****************************************************************************
* menu.c
*
* Genesis Plus GX menu
*
* Copyright Eke-Eke (2009-2016)
*
* Redistribution and use of this code or any derivative works are permitted
* provided that the following conditions are met:
*
* - Redistributions may not be sold, nor may they be used in a commercial
* product or activity.
*
* - Redistributions that are modified from the original source must include the
* complete source code, including the source code for all components used by a
* binary built from the modified sources. However, as a special exception, the
* source code distributed need not include anything that is normally distributed
* (in either source or binary form) with the major components (compiler, kernel,
* and so on) of the operating system on which the executable runs, unless that
* component itself accompanies the executable.
*
* - Redistributions must reproduce the above copyright notice, this list of
* conditions and the following disclaimer in the documentation and/or other
* materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************************/
#include "shared.h"
#include "font.h"
#include "gui.h"
#include "filesel.h"
#include "cheats.h"
#include "file_load.h"
#include "file_slot.h"
#ifdef HW_RVL
#include <ogc/usbmouse.h>
#endif
#include <ogc/lwp_threads.h>
#include <ogc/lwp_watchdog.h>
/* Credits */
extern const u8 Bg_credits_png[];
/* Main menu */
extern const u8 Main_load_png[];
extern const u8 Main_options_png[];
extern const u8 Main_quit_png[];
extern const u8 Main_file_png[];
extern const u8 Main_reset_png[];
extern const u8 Main_cheats_png[];
extern const u8 Main_showinfo_png[];
extern const u8 Main_takeshot_png[];
#ifdef HW_RVL
extern const u8 Main_play_wii_png[];
#else
extern const u8 Main_play_gcn_png[];
#endif
/* Options menu */
extern const u8 Option_menu_png[];
extern const u8 Option_ctrl_png[];
extern const u8 Option_sound_png[];
extern const u8 Option_video_png[];
extern const u8 Option_system_png[];
/* Load ROM menu */
extern const u8 Load_recent_png[];
extern const u8 Load_md_png[];
extern const u8 Load_ms_png[];
extern const u8 Load_gg_png[];
extern const u8 Load_sg_png[];
extern const u8 Load_cd_png[];
/* Save Manager menu */
extern const u8 Button_load_png[];
extern const u8 Button_load_over_png[];
extern const u8 Button_save_png[];
extern const u8 Button_save_over_png[];
extern const u8 Button_special_png[];
extern const u8 Button_special_over_png[];
extern const u8 Button_delete_png[];
extern const u8 Button_delete_over_png[];
/* Controller Settings */
extern const u8 Ctrl_4wayplay_png[];
extern const u8 Ctrl_gamepad_png[];
extern const u8 Ctrl_justifiers_png[];
extern const u8 Ctrl_menacer_png[];
extern const u8 Ctrl_mouse_png[];
extern const u8 Ctrl_xe_1ap_png[];
extern const u8 Ctrl_activator_png[];
extern const u8 Ctrl_lightphaser_png[];
extern const u8 Ctrl_paddle_png[];
extern const u8 Ctrl_sportspad_png[];
extern const u8 Ctrl_none_png[];
extern const u8 Ctrl_teamplayer_png[];
extern const u8 Ctrl_mastertap_png[];
extern const u8 Ctrl_graphic_board_png[];
extern const u8 Ctrl_pad_auto_png[];
extern const u8 Ctrl_pad2b_png[];
extern const u8 Ctrl_pad3b_png[];
extern const u8 Ctrl_pad6b_png[];
extern const u8 Ctrl_config_png[];
extern const u8 ctrl_option_off_png[];
extern const u8 ctrl_option_on_png[];
extern const u8 ctrl_gamecube_png[];
#ifdef HW_RVL
extern const u8 ctrl_classic_png[];
extern const u8 ctrl_nunchuk_png[];
extern const u8 ctrl_wiimote_png[];
#endif
/* Generic images */
extern const u8 Button_sm_blue_png[];
extern const u8 Button_sm_grey_png[];
extern const u8 Button_sm_yellow_png[];
/* Exit callback */
void (*reload)(void);
/*****************************************************************************/
/* Specific Menu Callbacks */
/*****************************************************************************/
static void ctrlmenu_cb(void);
static void savemenu_cb(void);
static void mainmenu_cb(void);
/*****************************************************************************/
/* Generic Buttons data */
/*****************************************************************************/
static butn_data arrow_up_data =
{
{NULL,NULL},
{Button_up_png,Button_up_over_png}
};
static butn_data arrow_down_data =
{
{NULL,NULL},
{Button_down_png,Button_down_over_png}
};
static butn_data button_text_data =
{
{NULL,NULL},
{Button_text_png,Button_text_over_png}
};
static butn_data button_icon_data =
{
{NULL,NULL},
{Button_icon_png,Button_icon_over_png}
};
static butn_data button_icon_sm_data =
{
{NULL,NULL},
{Button_icon_sm_png,Button_icon_sm_over_png}
};
static butn_data button_player_data =
{
{NULL,NULL},
{Button_sm_blue_png,Button_sm_yellow_png}
};
static butn_data button_player_none_data =
{
{NULL,NULL},
{Button_sm_grey_png,NULL}
};
static butn_data button_load_data =
{
{NULL,NULL},
{Button_load_png,Button_load_over_png}
};
static butn_data button_save_data =
{
{NULL,NULL},
{Button_save_png,Button_save_over_png}
};
static butn_data button_special_data =
{
{NULL,NULL},
{Button_special_png,Button_special_over_png}
};
static butn_data button_delete_data =
{
{NULL,NULL},
{Button_delete_png,Button_delete_over_png}
};
/*****************************************************************************/
/* Generic GUI items */
/*****************************************************************************/
static gui_item action_cancel =
{
NULL,Key_B_png,"","Back",10,422,28,28
};
static gui_item action_select =
{
NULL,Key_A_png,"","",602,422,28,28
};
/*****************************************************************************/
/* GUI backgrounds images */
/*****************************************************************************/
static gui_image bg_main[] =
{
{NULL,Bg_layer_png,IMAGE_VISIBLE|IMAGE_REPEAT,0,0,640,480,255},
{NULL,Bg_overlay_png,IMAGE_VISIBLE|IMAGE_REPEAT,0,0,640,480,255},
{NULL,Banner_main_png,IMAGE_VISIBLE|IMAGE_SLIDE_BOTTOM,0,340,640,140,255},
{NULL,Main_logo_png,IMAGE_VISIBLE|IMAGE_SLIDE_BOTTOM,202,362,232,56,255}
};
static gui_image bg_misc[] =
{
{NULL,Bg_layer_png,IMAGE_VISIBLE|IMAGE_REPEAT,0,0,640,480,255},
{NULL,Bg_overlay_png,IMAGE_VISIBLE|IMAGE_REPEAT,0,0,640,480,255},
{NULL,Banner_top_png,IMAGE_VISIBLE|IMAGE_SLIDE_TOP,0,0,640,108,255},
{NULL,Banner_bottom_png,IMAGE_VISIBLE|IMAGE_SLIDE_BOTTOM,0,380,640,100,255},
{NULL,Main_logo_png,IMAGE_VISIBLE|IMAGE_SLIDE_TOP,466,40,152,44,255}
};
static gui_image bg_ctrls[] =
{
{NULL,Bg_layer_png,IMAGE_VISIBLE|IMAGE_REPEAT,0,0,640,480,255},
{NULL,Bg_overlay_png,IMAGE_VISIBLE|IMAGE_REPEAT,0,0,640,480,255},
{NULL,Banner_top_png,IMAGE_VISIBLE,0,0,640,108,255},
{NULL,Banner_bottom_png,IMAGE_VISIBLE,0,380,640,100,255},
{NULL,Main_logo_png,IMAGE_VISIBLE,466,40,152,44,255},
{NULL,Frame_s2_png,IMAGE_VISIBLE,38,72,316,168,128},
{NULL,Frame_s2_png,IMAGE_VISIBLE,38,242,316,168,128},
{NULL,Frame_s3_png,IMAGE_SLIDE_RIGHT,400,134,292,248,128}
};
static gui_image bg_list[] =
{
{NULL,Bg_layer_png,IMAGE_VISIBLE|IMAGE_REPEAT,0,0,640,480,255},
{NULL,Bg_overlay_png,IMAGE_VISIBLE|IMAGE_REPEAT,0,0,640,480,255},
{NULL,Banner_top_png,IMAGE_VISIBLE,0,0,640,108,255},
{NULL,Banner_bottom_png,IMAGE_VISIBLE,0,380,640,100,255},
{NULL,Main_logo_png,IMAGE_VISIBLE,466,40,152,44,255},
{NULL,Frame_s1_png,IMAGE_VISIBLE,8,70,372,336,76}
};
static gui_image bg_saves[] =
{
{NULL,NULL,0,0,0,0,0,255},
{NULL,Bg_layer_png,IMAGE_VISIBLE|IMAGE_REPEAT,0,0,640,480,255},
{NULL,Bg_overlay_png,IMAGE_VISIBLE|IMAGE_REPEAT,0,0,640,480,255},
{NULL,Banner_top_png,IMAGE_VISIBLE|IMAGE_SLIDE_TOP,0,0,640,108,255},
{NULL,Banner_bottom_png,IMAGE_VISIBLE|IMAGE_SLIDE_BOTTOM,0,380,640,100,255},
{NULL,Main_logo_png,IMAGE_VISIBLE|IMAGE_SLIDE_TOP,466,40,152,44,255},
{NULL,Frame_s1_png,IMAGE_VISIBLE,8,70,372,336,76},
{NULL,Frame_s1_png,IMAGE_SLIDE_RIGHT,468,108,372,296,76}
};
/*****************************************************************************/
/* Menu Items description */
/*****************************************************************************/
/* Main menu */
static gui_item items_main[] =
{
{NULL,Main_load_png ,"","",114,162,80,92},
{NULL,Main_options_png ,"","",290,166,60,88},
{NULL,Main_quit_png ,"","",460,170,52,84},
{NULL,Main_file_png ,"","",114,216,80,92},
{NULL,Main_reset_png ,"","",294,227,52,80},
{NULL,Main_cheats_png ,"","",454,218,64,92},
{NULL,NULL ,"","", 10,334,84,32},
#ifdef HW_RVL
{NULL,Main_play_wii_png,"","", 10,372,84,32},
#else
{NULL,Main_play_gcn_png,"","", 10,372,84,32},
#endif
{NULL,Main_takeshot_png,"","",546,334,84,32},
{NULL,Main_showinfo_png,"","",546,372,84,32}
};
/* Controllers menu */
static gui_item items_ctrls[] =
{
{NULL,NULL,"","", 0, 0, 0, 0},
{NULL,NULL,"","", 0, 0, 0, 0},
{NULL,NULL,"","",305, 0, 24, 0},
{NULL,NULL,"","",305, 0, 24, 0},
{NULL,NULL,"","",305, 0, 24, 0},
{NULL,NULL,"","",305, 0, 24, 0},
{NULL,NULL,"","",305, 0, 24, 0},
{NULL,NULL,"","",305, 0, 24, 0},
{NULL,NULL,"","",305, 0, 24, 0},
{NULL,NULL,"","",305, 0, 24, 0},
{NULL,NULL,"","", 0, 0, 0, 0},
{NULL,NULL,"","", 0, 0, 0, 0},
{NULL,Ctrl_config_png,"Keys\nConfig","Configure Controller Keys",530,306,32,32}
};
/* Load menu */
static gui_item items_load[] =
{
{NULL,Load_recent_png,"","Load recently played games", 119,144,72, 92},
{NULL,Load_md_png, "","Load Mega Drive/Genesis games", 278,141,84, 92},
{NULL,Load_cd_png, "","Load Sega/Mega CD games", 454,141,64, 92},
{NULL,Load_ms_png, "","Load Master System games", 114,284,84, 96},
{NULL,Load_gg_png, "","Load Game Gear games", 278,283,84,100},
{NULL,Load_sg_png, "","Load SG-1000 games", 454,281,64, 96}
};
/* Option menu */
static gui_item items_options[] =
{
{NULL,Option_system_png,"","System settings", 114,142,80,92},
{NULL,Option_video_png, "","Video settings", 288,150,64,84},
{NULL,Option_sound_png, "","Audio settings", 464,154,44,80},
{NULL,Option_ctrl_png, "","Controllers settings", 192,286,88,92},
{NULL,Option_menu_png, "","Menu settings", 370,286,60,92}
};
/* Audio options */
static gui_item items_audio[] =
{
{NULL,NULL,"Master System FM: AUTO", "Enable/disable YM2413 chip", 56,132,276,48},
{NULL,NULL,"High-Quality FM: ON", "Adjust YM2612/YM2413 resampling quality", 56,132,276,48},
{NULL,NULL,"FM Resolution: MAX", "Adjust YM2612 DAC precision", 56,132,276,48},
{NULL,NULL,"FM Volume: 1.00", "Adjust YM2612/YM2413 output level", 56,132,276,48},
{NULL,NULL,"PSG Volume: 2.50", "Adjust SN76489 output level", 56,132,276,48},
{NULL,NULL,"PSG Noise Boost: OFF", "Boost SN76489 Noise Channel", 56,132,276,48},
{NULL,NULL,"Audio Out: STEREO", "Select audio mixing output type", 56,132,276,48},
{NULL,NULL,"Filtering: 3-BAND EQ", "Setup Audio filtering", 56,132,276,48},
{NULL,NULL,"Low Gain: 1.00", "Adjust EQ Low Band Gain", 56,132,276,48},
{NULL,NULL,"Mid Gain: 1.00", "Adjust EQ Mid Band Gain", 56,132,276,48},
{NULL,NULL,"High Gain: 1.00", "Adjust EQ High Band Gain", 56,132,276,48},
{NULL,NULL,"Low Freq: 200 Hz", "Adjust EQ Lowest Frequency", 56,132,276,48},
{NULL,NULL,"High Freq: 20000 Hz", "Adjust EQ Highest Frequency", 56,132,276,48}
};
/* System ROM paths */
static gui_item items_rompaths[] =
{
{NULL,NULL,"CD BIOS (USA): NOT FOUND", "Select Sega CD (USA) BIOS", 56,132,276,48},
{NULL,NULL,"CD BIOS (PAL): NOT FOUND", "Select Mega CD (PAL) BIOS", 56,132,276,48},
{NULL,NULL,"CD BIOS (JAP): NOT FOUND", "Select Mega CD (JAP) BIOS", 56,132,276,48},
{NULL,NULL,"MD BIOS (TMSS): NOT FOUND", "Select Mega Drive / Genesis BootROM", 56,132,276,48},
{NULL,NULL,"MS BIOS (USA): NOT FOUND", "Select Master System (USA) BootROM", 56,132,276,48},
{NULL,NULL,"MS BIOS (PAL): NOT FOUND", "Select Master System (PAL) BootROM", 56,132,276,48},
{NULL,NULL,"MS BIOS (JAP): NOT FOUND", "Select Master System (JAP) BootROM", 56,132,276,48},
{NULL,NULL,"Game Gear BIOS: NOT FOUND", "Select Game Gear BootROM", 56,132,276,48},
{NULL,NULL,"Game Genie: NOT FOUND", "Select Game Genie ROM", 56,132,276,48},
{NULL,NULL,"Action Replay: NOT FOUND", "Select Action Replay (Pro) ROM", 56,132,276,48},
{NULL,NULL,"S&K (2MB ROM): NOT FOUND", "Select Sonic & Knuckle main ROM", 56,132,276,48},
{NULL,NULL,"S2&K (256K ROM): NOT FOUND","Select Sonic 2 & Knuckle upmem ROM", 56,132,276,48},
};
/* System options */
static gui_item items_system[] =
{
{NULL,NULL,"Console Hardware: AUTO", "Select system hardware model", 56,132,276,48},
{NULL,NULL,"Console Region: AUTO", "Select system region", 56,132,276,48},
{NULL,NULL,"VDP Mode: AUTO", "Select VDP mode", 56,132,276,48},
{NULL,NULL,"System Clock: AUTO", "Select system clock frequency", 56,132,276,48},
{NULL,NULL,"System Boot: BIOS&CART", "Select system booting method", 56,132,276,48},
{NULL,NULL,"System Lockups: ON", "Enable/disable original system lock-ups", 56,132,276,48},
{NULL,NULL,"68k Address Error: ON", "Enable/disable 68k address error exceptions", 56,132,276,48},
{NULL,NULL,"Lock-on: OFF", "Select Lock-On cartridge type", 56,132,276,48},
{NULL,NULL,"Cartridge Swap: OFF", "Enable/disable cartridge hot swap", 56,132,276,48},
{NULL,NULL,"BIOS & Lock-On ROM paths","Configure BIOS & Lock-On ROM paths", 56,132,276,48},
{NULL,NULL,"SVP Cycles: 1500", "Adjust SVP chip emulation speed", 56,132,276,48}
};
/* Video options */
static gui_item items_video[] =
{
{NULL,NULL,"Display: PROGRESSIVE", "Select video mode", 56,132,276,48},
{NULL,NULL,"TV mode: 50/60HZ", "Select video refresh rate", 56,132,276,48},
{NULL,NULL,"VSYNC: AUTO", "Enable/disable sync with video hardware", 56,132,276,48},
{NULL,NULL,"Bilinear Filter: OFF", "Enable/disable GX hardware texture filtering", 56,132,276,48},
{NULL,NULL,"Deflickering Filter: AUTO", "Enable/disable GX hardware framebuffer filtering", 56,132,276,48},
#ifdef HW_RVL
{NULL,NULL,"Trap Filter: ON", "Enable/disable VI hardware composite out filtering",56,132,276,48},
{NULL,NULL,"Gamma Correction: 1.0", "Adjust VI hardware gamma correction", 56,132,276,48},
#endif
{NULL,NULL,"LCD Ghosting Filter: OFF", "Enable/disable software LCD image persistence", 56,132,276,48},
{NULL,NULL,"NTSC Filter: COMPOSITE", "Enable/disable software NTSC filtering", 56,132,276,48},
{NULL,NULL,"NTSC Sharpness: 0.0", "Adjust edge contrast enhancement/blurring", 56,132,276,48},
{NULL,NULL,"NTSC Resolution: 0.0", "Adjust image resolution", 56,132,276,48},
{NULL,NULL,"NTSC Artifacts: 0.0", "Adjust artifacts caused by color changes", 56,132,276,48},
{NULL,NULL,"NTSC Color Bleed: 0.0", "Adjust color resolution reduction", 56,132,276,48},
{NULL,NULL,"NTSC Color Fringing: 0.0", "Adjust artifacts caused by brightness changes", 56,132,276,48},
{NULL,NULL,"Borders: OFF", "Enable/disable overscan emulation", 56,132,276,48},
{NULL,NULL,"GG screen: ORIGINAL", "Enable/disable Game Gear extended screen", 56,132,276,48},
{NULL,NULL,"Aspect: ORIGINAL (4:3)", "Select display aspect ratio", 56,132,276,48},
{NULL,NULL,"Screen Position (+0,+0)", "Adjust display position", 56,132,276,48},
{NULL,NULL,"Screen Scaling (+0,+0)", "Adjust display scaling", 56,132,276,48}
};
/* Menu options */
static gui_item items_prefs[] =
{
{NULL,NULL,"Auto ROM Load: OFF", "Enable/disable automatic ROM loading on startup", 56,132,276,48},
{NULL,NULL,"Auto Cheats: OFF", "Enable/disable automatic cheats activation", 56,132,276,48},
{NULL,NULL,"Auto Saves: OFF", "Enable/disable automatic saves", 56,132,276,48},
{NULL,NULL,"ROM Load Device: SD", "Configure default device for ROM files", 56,132,276,48},
{NULL,NULL,"Saves Device: FAT", "Configure default device for Save files", 56,132,276,48},
{NULL,NULL,"SFX Volume: 100", "Adjust sound effects volume", 56,132,276,48},
{NULL,NULL,"BGM Volume: 100", "Adjust background music volume", 56,132,276,48},
{NULL,NULL,"BG Overlay: ON", "Enable/disable background overlay", 56,132,276,48},
{NULL,NULL,"Screen Width: 658", "Adjust menu screen width in pixels", 56,132,276,48},
{NULL,NULL,"Show CD Leds: OFF", "Enable/disable CD leds display", 56,132,276,48},
{NULL,NULL,"Show FPS: OFF", "Enable/disable FPS counter", 56,132,276,48},
#ifdef HW_RVL
{NULL,NULL,"Wiimote Timeout: OFF","Enable/disable Wii remote automatic shutodwn", 56,132,276,48},
{NULL,NULL,"Wiimote Calibration: AUTO","Calibrate Wii remote pointer", 56,132,276,48},
#endif
};
/* Save Manager */
static gui_item items_saves[] =
{
{NULL,NULL,"","" ,0,0,0,0},
{NULL,NULL,"","" ,0,0,0,0},
{NULL,NULL,"","" ,0,0,0,0},
{NULL,NULL,"","" ,0,0,0,0},
{NULL,NULL,"","" ,0,0,0,0},
{NULL,NULL,"","Load file" ,0,0,0,0},
{NULL,NULL,"","Set as default file",0,0,0,0},
{NULL,NULL,"","Delete file" ,0,0,0,0},
{NULL,NULL,"","Save file" ,0,0,0,0}
};
/*****************************************************************************/
/* Menu Buttons description */
/*****************************************************************************/
/* Generic Buttons for list menu */
static gui_butn arrow_up = {&arrow_up_data,BUTTON_ACTIVE|BUTTON_OVER_SFX,{0,0,0,0},14,76,360,32};
static gui_butn arrow_down = {&arrow_down_data,BUTTON_ACTIVE|BUTTON_OVER_SFX,{0,0,0,0},14,368,360,32};
/* Generic list menu */
static gui_butn buttons_list[] =
{
{&button_text_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX,{1,1,0,0},56,132,276,48},
{&button_text_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX,{1,1,0,0},56,188,276,48},
{&button_text_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX,{1,1,0,0},56,244,276,48},
{&button_text_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX,{1,1,0,0},56,300,276,48}
};
/* Main menu */
static gui_butn buttons_main[] =
{
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{0,0,0,1}, 80,140,148,132},
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{0,0,1,1},246,140,148,132},
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{0,0,1,0},412,140,148,132},
{&button_icon_data, BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{3,4,0,1}, 80,194,148,132},
{&button_icon_data, BUTTON_OVER_SFX ,{3,4,1,1},246,194,148,132},
{&button_icon_data, BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{3,3,1,0},412,194,148,132},
{NULL , BUTTON_OVER_SFX ,{3,1,0,2}, 10,334, 84, 32},
{NULL , BUTTON_OVER_SFX ,{4,0,0,2}, 10,372, 84, 32},
{NULL , BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{3,1,1,0},546,334, 84, 32},
{NULL , BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{1,0,2,0},546,372, 84, 32}
};
/* Controllers Menu */
static gui_butn buttons_ctrls[] =
{
{&button_icon_data ,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX ,{0,1,0,2}, 60, 88,148,132},
{&button_icon_data ,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX ,{1,0,0,5}, 60,258,148,132},
{NULL ,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{0,1,2,0},250, 79, 84, 32},
{NULL ,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{1,1,3,0},250,117, 84, 32},
{NULL ,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{1,1,4,0},250,155, 84, 32},
{NULL ,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{1,1,5,0},250,193, 84, 32},
{NULL ,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{1,1,5,0},250,249, 84, 32},
{NULL ,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{1,1,6,0},250,287, 84, 32},
{NULL ,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{1,1,7,0},250,325, 84, 32},
{NULL ,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{1,0,8,0},250,363, 84, 32},
{&button_icon_sm_data ,BUTTON_SLIDE_RIGHT|BUTTON_OVER_SFX ,{0,1,1,0},436,168,160, 52},
{&button_icon_sm_data ,BUTTON_SLIDE_RIGHT|BUTTON_OVER_SFX ,{1,1,0,0},436,232,160, 52},
{&button_icon_sm_data ,BUTTON_SLIDE_RIGHT|BUTTON_OVER_SFX|BUTTON_SELECT_SFX ,{1,0,0,0},436,296,160, 52}
};
/* Load Game menu */
static gui_butn buttons_load[] =
{
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{0,3,0,1}, 80,120,148,132},
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{0,3,1,1},246,120,148,132},
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{0,3,1,0},412,120,148,132},
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{3,0,0,1}, 80,264,148,132},
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{3,0,1,1},246,264,148,132},
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{3,0,1,0},412,264,148,132}
};
/* Options menu */
static gui_butn buttons_options[] =
{
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{0,3,0,1}, 80,120,148,132},
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{0,3,1,1},246,120,148,132},
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{0,2,1,1},412,120,148,132},
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{3,0,1,1},162,264,148,132},
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{2,0,1,0},330,264,148,132}
};
/* Save Manager Menu */
static gui_butn buttons_saves[] =
{
{&button_text_data ,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX,{0,1,0,0}, 56,102,276,48},
{&button_text_data ,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX,{1,1,0,0}, 56,158,276,48},
{&button_text_data ,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX,{1,1,0,0}, 56,214,276,48},
{&button_text_data ,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX,{1,1,0,0}, 56,270,276,48},
{&button_text_data ,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_OVER_SFX,{1,0,0,0}, 56,326,276,48},
{&button_load_data ,BUTTON_ACTIVE|BUTTON_SLIDE_RIGHT|BUTTON_OVER_SFX,{0,1,0,0},530,130, 56,56},
{&button_special_data,BUTTON_ACTIVE|BUTTON_SLIDE_RIGHT|BUTTON_OVER_SFX,{1,1,0,0},530,196, 56,56},
{&button_delete_data ,BUTTON_ACTIVE|BUTTON_SLIDE_RIGHT|BUTTON_OVER_SFX,{1,1,0,0},530,262, 56,56},
{&button_save_data ,BUTTON_ACTIVE|BUTTON_SLIDE_RIGHT|BUTTON_OVER_SFX,{1,0,0,0},530,328, 56,56}
};
/*****************************************************************************/
/* Menu descriptions */
/*****************************************************************************/
/* Main menu */
static gui_menu menu_main =
{
"",
0,0,
10,10,4,0,
items_main,
buttons_main,
bg_main,
{NULL,NULL},
{NULL,NULL},
NULL
};
/* Main menu */
gui_menu menu_ctrls =
{
"Controller Settings",
0,0,
13,13,8,0,
items_ctrls,
buttons_ctrls,
bg_ctrls,
{&action_cancel, &action_select},
{NULL,NULL},
ctrlmenu_cb
};
/* Load Game menu */
static gui_menu menu_load =
{
"Load Game",
0,0,
6,6,5,0,
items_load,
buttons_load,
bg_misc,
{&action_cancel, &action_select},
{NULL,NULL},
NULL
};
/* Options menu */
static gui_menu menu_options =
{
"Settings",
0,0,
5,5,5,0,
items_options,
buttons_options,
bg_misc,
{&action_cancel, &action_select},
{NULL,NULL},
NULL
};
/* System ROM Path submenu */
static gui_menu menu_rompaths =
{
"System ROM Paths",
0,0,
12,4,6,0,
items_rompaths,
buttons_list,
bg_list,
{&action_cancel, &action_select},
{&arrow_up,&arrow_down},
NULL
};
/* System Options menu */
static gui_menu menu_system =
{
"System Settings",
0,0,
0,4,6,0,
items_system,
buttons_list,
bg_list,
{&action_cancel, &action_select},
{&arrow_up,&arrow_down},
NULL
};
/* Video Options menu */
static gui_menu menu_video =
{
"Video Settings",
0,0,
0,4,6,0,
items_video,
buttons_list,
bg_list,
{&action_cancel, &action_select},
{&arrow_up,&arrow_down},
NULL
};
/* Sound Options menu */
static gui_menu menu_audio =
{
"Audio Settings",
0,0,
0,4,6,0,
items_audio,
buttons_list,
bg_list,
{&action_cancel, &action_select},
{&arrow_up,&arrow_down},
NULL
};
/* Sound Options menu */
static gui_menu menu_prefs =
{
"Menu Settings",
0,0,
0,4,6,0,
items_prefs,
buttons_list,
bg_list,
{&action_cancel, &action_select},
{&arrow_up,&arrow_down},
NULL
};
/* Save Manager menu */
static gui_menu menu_saves =
{
"Save Manager",
0,0,
9,9,8,0,
items_saves,
buttons_saves,
bg_saves,
{&action_cancel, &action_select},
{NULL,NULL},
savemenu_cb
};
/****************************************************************************
* GUI Settings menu
*
****************************************************************************/
static void update_screen_w(void)
{
vmode->viWidth = config.screen_w;
vmode->viXOrigin = (VI_MAX_WIDTH_NTSC -config.screen_w)/2;
VIDEO_Configure(vmode);
VIDEO_Flush();
}
static void update_bgm(void)
{
SetVolumeOgg(((int)config.bgm_volume * 255) / 100);
}
static void prefmenu ()
{
int ret, quit = 0;
gui_menu *m = &menu_prefs;
gui_item *items = m->items;
sprintf (items[0].text, "Auto ROM Load: %s", config.autoload ? "ON":"OFF");
sprintf (items[1].text, "Auto Cheats: %s", config.autocheat ? "ON":"OFF");
if (config.s_auto == 3) sprintf (items[2].text, "Auto Saves: ALL");
else if (config.s_auto == 2) sprintf (items[2].text, "Auto Saves: STATE ONLY");
else if (config.s_auto == 1) sprintf (items[2].text, "Auto Saves: SRAM ONLY");
else sprintf (items[2].text, "Auto Saves: NONE");
#ifdef HW_RVL
if (config.l_device == 1) sprintf (items[3].text, "ROM Load Device: USB");
else if (config.l_device == 2) sprintf (items[3].text, "ROM Load Device: DVD");
#else
if (config.l_device == 1) sprintf (items[3].text, "ROM Load Device: DVD");
#endif
else sprintf (items[3].text, "ROM Load Device: SD");
if (config.s_device == 1) sprintf (items[4].text, "Saves Device: MCARD A");
else if (config.s_device == 2) sprintf (items[4].text, "Saves Device: MCARD B");
else sprintf (items[4].text, "Saves Device: FAT");
sprintf (items[5].text, "SFX Volume: %1.1f", config.sfx_volume);
sprintf (items[6].text, "BGM Volume: %1.1f", config.bgm_volume);
sprintf (items[7].text, "BG Overlay: %s", config.bg_overlay ? "ON":"OFF");
sprintf (items[8].text, "Screen Width: %d", config.screen_w);
sprintf (items[9].text, "Show CD Leds: %s", config.cd_leds ? "ON":"OFF");
sprintf (items[10].text, "Show FPS: %s", config.fps ? "ON":"OFF");
#ifdef HW_RVL
sprintf (items[11].text, "Wiimote Timeout: %s", config.autosleep ? "5 MIN":"30 MIN");
sprintf (items[12].text, "Wiimote Calibration: %s", ((config.calx * config.caly) != 0) ? "MANUAL":"AUTO");
sprintf (items[12].comment, "%s", ((config.calx * config.caly) != 0) ? "Reset default Wii remote pointer calibration":"Calibrate Wii remote pointer");
m->max_items = 13;
#else
m->max_items = 11;
#endif
GUI_InitMenu(m);
GUI_SlideMenuTitle(m,strlen("Menu "));
while (quit == 0)
{
ret = GUI_RunMenu(m);
switch (ret)
{
case 0: /* Auto load last ROM file on startup */
config.autoload ^= 1;
sprintf (items[0].text, "Auto ROM Load: %s", config.autoload ? "ON":"OFF");
break;
case 1: /* Cheats automatic activation */
config.autocheat ^= 1;
sprintf (items[1].text, "Auto Cheats: %s", config.autocheat ? "ON":"OFF");
break;
case 2: /*** Auto load/save STATE & SRAM files ***/
config.s_auto = (config.s_auto + 1) % 4;
if (config.s_auto == 3) sprintf (items[2].text, "Auto Saves: ALL");
else if (config.s_auto == 2) sprintf (items[2].text, "Auto Saves: STATE ONLY");
else if (config.s_auto == 1) sprintf (items[2].text, "Auto Saves: SRAM ONLY");
else sprintf (items[2].text, "Auto Saves: NONE");
break;
case 3: /*** Default ROM device ***/
#ifdef HW_RVL
config.l_device = (config.l_device + 1) % 3;
if (config.l_device == 1) sprintf (items[3].text, "ROM Load Device: USB");
else if (config.l_device == 2) sprintf (items[3].text, "ROM Load Device: DVD");
#else
config.l_device ^= 1;
if (config.l_device == 1) sprintf (items[3].text, "ROM Load Device: DVD");
#endif
else sprintf (items[3].text, "ROM Load Device: SD");
break;
case 4: /*** Default saves device ***/
config.s_device = (config.s_device + 1) % 3;
if (config.s_device == 1) sprintf (items[4].text, "Saves Device: MCARD A");
else if (config.s_device == 2) sprintf (items[4].text, "Saves Device: MCARD B");
else sprintf (items[4].text, "Saves Device: FAT");
break;
case 5: /*** Sound effects volume ***/
GUI_OptionBox(m,0,"SFX Volume",(void *)&config.sfx_volume,10.0,0.0,100.0,0);
sprintf (items[5].text, "SFX Volume: %1.1f", config.sfx_volume);
break;
case 6: /*** Background music volume ***/
GUI_OptionBox(m,update_bgm,"BGM Volume",(void *)&config.bgm_volume,10.0,0.0,100.0,0);
sprintf (items[6].text, "BGM Volume: %1.1f", config.bgm_volume);
break;
case 7: /*** Background overlay ***/
config.bg_overlay ^= 1;
if (config.bg_overlay)
{
bg_main[1].state |= IMAGE_VISIBLE;
bg_misc[1].state |= IMAGE_VISIBLE;
bg_ctrls[1].state |= IMAGE_VISIBLE;
bg_list[1].state |= IMAGE_VISIBLE;
bg_saves[2].state |= IMAGE_VISIBLE;
sprintf (items[7].text, "BG Overlay: ON");
}
else
{
bg_main[1].state &= ~IMAGE_VISIBLE;
bg_misc[1].state &= ~IMAGE_VISIBLE;
bg_ctrls[1].state &= ~IMAGE_VISIBLE;
bg_list[1].state &= ~IMAGE_VISIBLE;
bg_saves[2].state &= ~IMAGE_VISIBLE;
sprintf (items[7].text, "BG Overlay: OFF");
}
break;
case 8: /*** Screen Width ***/
GUI_OptionBox(m,update_screen_w,"Screen Width",(void *)&config.screen_w,2,640,VI_MAX_WIDTH_NTSC,1);
sprintf (items[8].text, "Screen Width: %d", config.screen_w);
break;
case 9: /*** CD LEDS ***/
config.cd_leds ^= 1;
sprintf (items[9].text, "Show CD Leds: %s", config.cd_leds ? "ON":"OFF");
break;
case 10: /*** FPS counter ***/
config.fps ^= 1;
sprintf (items[10].text, "Show FPS: %s", config.fps ? "ON":"OFF");
break;
#ifdef HW_RVL
case 11: /*** Wii remote auto switch-off ***/
config.autosleep ^= 1;
sprintf (items[11].text, "Wiimote Timeout: %s", config.autosleep ? "5min":"30min");
WPAD_SetIdleTimeout(config.autosleep ? 300 : 1800);
break;
case 12: /*** Wii remote pointer calibration ***/
if ((config.calx * config.caly) == 0)
{
if (GUI_WaitConfirm("Pointer Calibration","Aim center of TV screen"))
{
sprintf (items[12].text, "Wiimote Calibration: MANUAL");
sprintf (items[12].comment, "Reset default Wii remote pointer calibration");
config.calx = 320 - m_input.ir.x;
config.caly = 240 - m_input.ir.y;
m_input.ir.x = 320;
m_input.ir.y = 240;
}
}
else
{
sprintf (items[12].text, "Wiimote Calibration: AUTO");
sprintf (items[12].comment, "Calibrate Wii remote pointer");
config.calx = config.caly = 0;
}
break;
#endif
case -1:
quit = 1;
break;
}
}
/* stop DVD drive when not in use */
if (config.l_device != 2)
{
#ifdef HW_RVL
DI_StopMotor();
#else
vu32* const dvd = (u32*)0xCC006000;
dvd[0] = 0x2e;
dvd[1] = 0;
dvd[2] = 0xe3000000;
dvd[3] = 0;
dvd[4] = 0;
dvd[5] = 0;
dvd[6] = 0;
dvd[7] = 1;
while (dvd[7] & 1);
#endif
}
GUI_DeleteMenu(m);
}
/****************************************************************************
* Audio Settings menu
*
****************************************************************************/
static void soundmenu ()
{
int ret, quit = 0;
float fm_volume = (float)config.fm_preamp/100.0;
float psg_volume = (float)config.psg_preamp/100.0;
gui_menu *m = &menu_audio;
gui_item *items = m->items;
if (config.ym2413 == 0) sprintf (items[0].text, "Master System FM: OFF");
else if (config.ym2413 == 1) sprintf (items[0].text, "Master System FM: ON");
else sprintf (items[0].text, "Master System FM: AUTO");
if (config.hq_fm) sprintf (items[1].text, "High-Quality FM: ON");
else sprintf (items[1].text, "High-Quality FM: OFF");
if (config.dac_bits < 14) sprintf (items[2].text, "FM Resolution: %d bits", config.dac_bits);
else sprintf (items[2].text, "FM Resolution: MAX");
sprintf (items[3].text, "FM Volume: %1.2f", fm_volume);
sprintf (items[4].text, "PSG Volume: %1.2f", psg_volume);
sprintf (items[5].text, "PSG Noise Boost: %s", config.psgBoostNoise ? "ON":"OFF");
sprintf (items[6].text, "Audio Out: %s", config.mono ? "MONO":"STEREO");
if (config.filter == 2)
{
float lg = (float)config.lg/100.0;
float mg = (float)config.mg/100.0;
float hg = (float)config.hg/100.0;
sprintf(items[7].text, "Filtering: 3-BAND EQ");
sprintf(items[8].text, "Low Gain: %1.2f", lg);
strcpy(items[8].comment, "Adjust EQ Low Band Gain");
sprintf(items[9].text, "Middle Gain: %1.2f", mg);
sprintf(items[10].text, "High Gain: %1.2f", hg);
sprintf(items[11].text, "Low Freq: %d", config.low_freq);
sprintf(items[12].text, "High Freq: %d", config.high_freq);
m->max_items = 13;
}
else if (config.filter == 1)
{
int16 lp_range = (config.lp_range * 100 + 0xffff) / 0x10000;
sprintf (items[7].text, "Filtering: LOW-PASS");
sprintf (items[8].text, "Low-Pass Rate: %d %%", lp_range);
strcpy (items[8].comment, "Adjust Low Pass filter");
m->max_items = 9;
}
else
{
sprintf (items[7].text, "Filtering: OFF");
m->max_items = 8;
}
GUI_InitMenu(m);
GUI_SlideMenuTitle(m,strlen("Audio "));
while (quit == 0)
{
ret = GUI_RunMenu(m);
switch (ret)
{
case 0:
{
config.ym2413++;
if (config.ym2413 > 2) config.ym2413 = 0;
if (config.ym2413 == 0) sprintf (items[0].text, "Master System FM: OFF");
else if (config.ym2413 == 1) sprintf (items[0].text, "Master System FM: ON");
else sprintf (items[0].text, "Master System FM: AUTO");
/* Automatic detection */
if ((config.ym2413 & 2) && system_hw && ((system_hw & SYSTEM_PBC) != SYSTEM_MD))
{
/* detect if game is using YM2413 */
sms_cart_init();
/* restore SRAM */
slot_autoload(0,config.s_device);
}
break;
}
case 1:
{
config.hq_fm ^= 1;
if (config.hq_fm) sprintf (items[1].text, "High-Quality FM: ON");
else sprintf (items[1].text, "High-Quality FM: OFF");
break;
}
case 2:
{
config.dac_bits++;
if (config.dac_bits > 14) config.dac_bits = 7;
if (config.dac_bits < 14) sprintf (items[2].text, "FM Resolution: %d bits", config.dac_bits);
else sprintf (items[2].text, "FM Resolution: MAX");
YM2612Config(config.dac_bits);
break;
}
case 3:
{
GUI_OptionBox(m,0,"FM Volume",(void *)&fm_volume,0.01,0.0,5.0,0);
sprintf (items[3].text, "FM Volume: %1.2f", fm_volume);
config.fm_preamp = (int)(fm_volume * 100.0 + 0.5);
break;
}
case 4:
{
GUI_OptionBox(m,0,"PSG Volume",(void *)&psg_volume,0.01,0.0,5.0,0);
sprintf (items[4].text, "PSG Volume: %1.2f", psg_volume);