-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathForm2.frm
1350 lines (1304 loc) · 39.6 KB
/
Form2.frm
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
VERSION 5.00
Begin VB.Form Form2
BackColor = &H00000000&
Caption = "MedAdvCFG v0.0.0 (Mednafen v0.9.x.x Frontend) by Nigel Todman [BASIC MODE]"
ClientHeight = 5250
ClientLeft = 225
ClientTop = 855
ClientWidth = 10920
BeginProperty Font
Name = "Arial"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form2"
ScaleHeight = 11799.5
ScaleMode = 0 'User
ScaleWidth = 10920
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton Command4
BackColor = &H00000000&
Caption = "Back"
Height = 315
Left = 10320
TabIndex = 21
Top = 0
Visible = 0 'False
Width = 615
End
Begin VB.CheckBox Check1
BackColor = &H00000000&
Caption = "Quick Launch (Skip Info)"
ForeColor = &H0000FF00&
Height = 195
Left = 3720
TabIndex = 20
Top = 3360
Value = 1 'Checked
Visible = 0 'False
Width = 2175
End
Begin VB.TextBox Text3
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 2055
Left = 9840
MultiLine = -1 'True
TabIndex = 19
Text = "Form2.frx":0000
Top = 6600
Visible = 0 'False
Width = 6015
End
Begin VB.DirListBox Dir1
BackColor = &H00C0C0C0&
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1890
Left = 11160
TabIndex = 16
Top = 450
Width = 3615
End
Begin VB.FileListBox File1
BackColor = &H00C0C0C0&
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 2820
Left = 11160
TabIndex = 15
Top = 2280
Width = 3615
End
Begin VB.DriveListBox Drive1
BackColor = &H00C0C0C0&
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 11160
TabIndex = 14
Top = 120
Width = 3615
End
Begin VB.CommandButton Command3
Caption = "List Games"
Height = 495
Left = 4920
TabIndex = 10
Top = 4080
Visible = 0 'False
Width = 1455
End
Begin VB.TextBox Text1
BackColor = &H00000000&
ForeColor = &H0000FF00&
Height = 285
Left = 3240
TabIndex = 7
Text = "Not Set"
Top = 2520
Visible = 0 'False
Width = 4575
End
Begin VB.CommandButton Command1
BackColor = &H00000000&
Caption = "Set"
Height = 315
Left = 7920
TabIndex = 6
Top = 2520
Visible = 0 'False
Width = 615
End
Begin VB.TextBox Text2
BackColor = &H00000000&
ForeColor = &H0000FF00&
Height = 285
Left = 3240
TabIndex = 5
Text = "Not Set"
Top = 2880
Visible = 0 'False
Width = 4575
End
Begin VB.CommandButton Command2
BackColor = &H00000000&
Caption = "Set"
Height = 315
Left = 7920
TabIndex = 4
Top = 2880
Visible = 0 'False
Width = 615
End
Begin VB.TextBox Text5
BackColor = &H00000000&
ForeColor = &H0000FF00&
Height = 285
Left = 6840
TabIndex = 2
Text = "1366"
Top = 3360
Visible = 0 'False
Width = 495
End
Begin VB.TextBox Text6
BackColor = &H00000000&
ForeColor = &H0000FF00&
Height = 285
Left = 7320
TabIndex = 1
Text = "768"
Top = 3360
Visible = 0 'False
Width = 515
End
Begin VB.CheckBox Check23
BackColor = &H00000000&
Caption = "Fullscreen"
ForeColor = &H0000FF00&
Height = 195
Left = 3720
TabIndex = 0
Top = 3600
Value = 1 'Checked
Visible = 0 'False
Width = 1215
End
Begin VB.Label Label6
AutoSize = -1 'True
BackColor = &H00000000&
Caption = "Not Set"
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000FF00&
Height = 225
Left = 3240
TabIndex = 18
Top = 2280
Width = 615
End
Begin VB.Label Label5
AutoSize = -1 'True
BackColor = &H00000000&
Caption = "System BIOS:"
ForeColor = &H0000FF00&
Height = 210
Left = 2040
TabIndex = 17
Top = 2280
Width = 990
End
Begin VB.Label Label3
AutoSize = -1 'True
BackColor = &H00000000&
Caption = "Mednafen EXE:"
ForeColor = &H0000FF00&
Height = 210
Left = 1920
TabIndex = 13
Top = 2040
Width = 1095
End
Begin VB.Label Label2
AutoSize = -1 'True
BackColor = &H00000000&
Caption = "0.9.41.0-win64 Detected! MD5: 6AADC9A8A196DA610E6DB43367B339B4"
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000FF00&
Height = 225
Left = 3240
TabIndex = 12
Top = 2040
Width = 6135
End
Begin VB.Label Label1
AutoSize = -1 'True
BackColor = &H00000000&
Caption = "BASIC MODE is not Finished yet."
BeginProperty Font
Name = "Arial"
Size = 11.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 270
Left = 3720
TabIndex = 11
Top = 0
Width = 3480
End
Begin VB.Label Label4
AutoSize = -1 'True
BackColor = &H00000000&
Caption = "System BIOS:"
ForeColor = &H0000FF00&
Height = 210
Left = 2040
TabIndex = 9
Top = 2520
Visible = 0 'False
Width = 990
End
Begin VB.Label Label7
AutoSize = -1 'True
BackColor = &H00000000&
Caption = "ROM Folder:"
ForeColor = &H0000FF00&
Height = 210
Left = 2070
TabIndex = 8
Top = 2880
Visible = 0 'False
Width = 885
End
Begin VB.Label Label26
AutoSize = -1 'True
BackColor = &H00000000&
Caption = "Resolution"
ForeColor = &H0000FF00&
Height = 210
Left = 6000
TabIndex = 3
Top = 3360
Visible = 0 'False
Width = 750
End
Begin VB.Image Image15
Height = 1335
Left = 4440
Picture = "Form2.frx":0007
Stretch = -1 'True
Top = 3480
Width = 1695
End
Begin VB.Image Image14
Height = 1335
Left = 9000
Picture = "Form2.frx":0BD9
Stretch = -1 'True
Top = 2040
Width = 1935
End
Begin VB.Image Image13
Height = 1335
Left = 6360
Picture = "Form2.frx":4586
Stretch = -1 'True
Top = 3600
Width = 2415
End
Begin VB.Image Image12
Height = 1335
Left = 240
Picture = "Form2.frx":5A41
Stretch = -1 'True
Top = 1680
Width = 1095
End
Begin VB.Image Image11
Height = 1335
Left = 4440
Picture = "Form2.frx":BD68
Stretch = -1 'True
Top = 240
Width = 1815
End
Begin VB.Image Image10
Height = 1575
Left = 2040
Picture = "Form2.frx":1413D
Stretch = -1 'True
Top = 3360
Width = 1455
End
Begin VB.Image Image9
Height = 1335
Left = 120
Picture = "Form2.frx":1585A
Stretch = -1 'True
Top = 120
Width = 1575
End
Begin VB.Image Image8
Height = 1335
Left = 7080
Picture = "Form2.frx":1E9A1
Stretch = -1 'True
Top = 2040
Width = 1695
End
Begin VB.Image Image7
Height = 1335
Left = 1680
Picture = "Form2.frx":40ECE
Stretch = -1 'True
Top = 1680
Width = 1695
End
Begin VB.Image Image6
Height = 1575
Left = 9000
Picture = "Form2.frx":43473
Stretch = -1 'True
Top = 3360
Width = 1575
End
Begin VB.Image Image5
Height = 1335
Left = 6480
Picture = "Form2.frx":4A85F
Stretch = -1 'True
Top = 240
Width = 1935
End
Begin VB.Image Image4
Height = 975
Left = 8280
Picture = "Form2.frx":4EC15
Stretch = -1 'True
Top = 480
Width = 2535
End
Begin VB.Image Image3
Height = 1335
Left = 3840
Picture = "Form2.frx":5E225
Stretch = -1 'True
Top = 1920
Width = 3015
End
Begin VB.Image Image2
Height = 1335
Left = 1680
Picture = "Form2.frx":5F682
Stretch = -1 'True
Top = 240
Width = 2295
End
Begin VB.Image Image1
Height = 1725
Left = 120
Picture = "Form2.frx":655C9
Stretch = -1 'True
Top = 3360
Width = 1665
End
Begin VB.Menu File
Caption = "File"
Begin VB.Menu Save
Caption = "Save Settings"
End
Begin VB.Menu Quit
Caption = "Quit"
End
End
Begin VB.Menu Mode
Caption = "Mode"
Begin VB.Menu Advanced
Caption = "Advanced"
End
Begin VB.Menu Basic
Caption = "Basic"
Checked = -1 'True
End
End
Begin VB.Menu About
Caption = "About"
End
Begin VB.Menu Help
Caption = "Help"
Begin VB.Menu Documentation
Caption = "Documentation"
End
End
Begin VB.Menu Chat
Caption = "Chat"
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim MedEXE, FSO, tmp, tmp2, tmp3(99), BIOSFILE, BIOSPATH, ROMFILE, SystemCore, SysCore, BIOSSanity, ROMSanity, Stretch, PixelShader, VideoScaler, x, y, z
Dim cmdstring, Build, Frameskip, Fullscreen, TBlur, TblurAccum, AccumAmount, VideoIP, ActiveFile, XRes, YRes, ScaleFactor, LastPath, SavePath, BiosPathLoad
Dim ResetBios, ResetRom, ResetRomDir, ResetSave, FatalError, SystemRegion, SystemRegionLoad, ROMDIR, M3USize, LastFile, VideoDriver
Dim Bilinear, DisableSound, ForceMono, video_blit_timesync, video_glvsync, untrusted_fip_check, cd_image_memcache, scanlines, numplayers, customparams
Dim MedAdvGAMES, MedAdvCOVERS, MedAdvEXT, BasicModeFolder, LogoTop, LogoLeft, QuickLaunch, MedMD5, MedDat
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub about_Click()
MsgBox "MedAdvCFG v" & Build & " (Mednafen v0.9.x.x Frontend)" & vbCrLf & "Written by Nigel Todman ([email protected])" & vbCrLf & "Primarily written as a PSX Frontend." & vbCrLf & "Tested with the following System Cores:" & vbCrLf & "GB, GBA, GG, MD, NES, PCE, PCE_FAST, PSX, SNES, SS, VB" & vbCrLf & vbCrLf & "Homepage: www.NigelTodman.com" & vbCrLf & "Facebook: facebook.com/nigel.todman.3" & vbCrLf & "Twitter: @Veritas_83" & vbCrLf & "YouTube: Veritas0923" & vbCrLf & "BTC: 18j2Env7QokhGG5MccS3LPBKnjsko6u4NQ"
End Sub
Private Sub Advanced_Click()
Basic.Checked = False
Form1.Basic.Checked = False
Form1.Visible = True
Form1.Advanced.Checked = True
Form2.Visible = False
Unload Form2
End Sub
Private Sub Basic_Click()
Basic.Checked = True
Form1.Visible = False
Form2.Visible = True
End Sub
Private Sub Chat_Click()
Shell ("cmd.exe /c start http://bit.ly/2k5E1Xq"), vbHide
End Sub
Private Sub Command1_Click()
Form2.Width = 15075
ActiveFile = "BIOS"
If Len(Text1.Text) >= 1 Then
If Text1.Text = "Not Set" Then
ResetBios = vbYes
Else
ResetBios = MsgBox("Reset Bios?", vbYesNo, "Reset Bios?")
End If
If ResetBios = vbYes Then
If Len(BiosPathLoad) > 0 Then Dir1.Path = BiosPathLoad
BIOSFILE = ""
Else
a = Validate_Bios()
End If
End If
End Sub
Function Validate_Bios()
If FSO.FileExists(BIOSPATH & "\" & BIOSFILE) = True Then
tmp = Form1.CalcMD5(Form1.ShortPath(BIOSPATH & "\" & BIOSFILE))
Text1.Text = BIOSPATH & "\" & BIOSFILE
End If
If FSO.FileExists(BIOSFILE) = True Then
tmp = Form1.CalcMD5(Form1.ShortPath(BIOSFILE))
Text1.Text = BIOSFILE
End If
BiosDat = VB.App.Path & "\dat\bios.dat"
If FSO.FileExists(BiosDat) = True Then
Close #16
Open BiosDat For Input As #16
Do
Line Input #16, BiosMD5
If LCase(tmp) = Mid$(BiosMD5, 1, 32) Then
'MsgBox Mid$(MedMD5, 34, Len(MedMD5))
Label6.Caption = Mid$(BiosMD5, 34, Len(BiosMD5))
End If
Loop Until EOF(16)
If Label6.Caption = "Not Set" Then
Label6.Caption = "Set a BIOS"
End If
Else
MsgBox "Fatal Error: bios.dat verification missing. Reinstall MedAdvCFG"
Unload Form1
End If
Validate_Bios = tmp
End Function
Function Validate_MedEXE()
If FSO.FileExists(MedEXE) = True Then
MedDat = VB.App.Path & "\dat\Mednafen.dat"
If FSO.FileExists(MedDat) = True Then
tmp = Form1.CalcMD5(Form1.ShortPath(MedEXE))
Close #16
Open MedDat For Input As #16
Do
Line Input #16, MedMD5
If tmp = Mid$(MedMD5, 1, 32) Then
'MsgBox Mid$(MedMD5, 34, Len(MedMD5))
Label2.Caption = Mid$(MedMD5, 34, Len(MedMD5)) & " Detected! MD5: " & Mid$(MedMD5, 1, 32)
End If
Loop Until EOF(16)
Else
MsgBox "Fatal Error: Mednafen.dat verification missing. Reinstall MedAdvCFG"
Unload Form1
End If
End If
Validate_MedEXE = tmp
End Function
Private Sub Command2_Click()
Form2.Width = 15075
ActiveFile = "ROMDIR"
If Len(Text2.Text) >= 1 Then
If Text2.Text = "Not Set" Then
ResetRomDir = vbYes
Else
ResetRomDir = MsgBox("Reset Rom Folder?", vbYesNo, "Reset Rom Folder?")
End If
End If
If ResetRomDir = vbYes Then
If Len(ROMDIR) > 0 Then Dir1.Path = ROMDIR
ROMFILE = ""
Else
Text2.Text = Dir1.Path
ROMDIR = Dir1.Path
End If
End Sub
Public Function RecursiveDir(colFiles As Collection, _
strFolder As String, _
strFileSpec As String, _
bIncludeSubfolders As Boolean)
Dim strTemp As String
Dim colFolders As New Collection
Dim vFolderName As Variant
'Add files in strFolder matching strFileSpec to colFiles
strFolder = TrailingSlash(strFolder)
strTemp = Dir(strFolder & strFileSpec)
Do While strTemp <> vbNullString
colFiles.Add strFolder & strTemp
strTemp = Dir
Loop
If bIncludeSubfolders Then
'Fill colFolders with list of subdirectories of strFolder
strTemp = Dir(strFolder, vbDirectory)
Do While strTemp <> vbNullString
If (strTemp <> ".") And (strTemp <> "..") Then
If (GetAttr(strFolder & strTemp) And vbDirectory) <> 0 Then
colFolders.Add strTemp
End If
End If
strTemp = Dir
Loop
'Call RecursiveDir for each subfolder in colFolders
For Each vFolderName In colFolders
Call RecursiveDir(colFiles, strFolder & vFolderName, strFileSpec, True)
Next vFolderName
End If
End Function
Public Function TrailingSlash(strFolder As String) As String
If Len(strFolder) > 0 Then
If Right(strFolder, 1) = "\" Then
TrailingSlash = strFolder
Else
TrailingSlash = strFolder & "\"
End If
End If
End Function
Private Sub Command3_Click()
'Text3.Visible = True
ROMDIR = Text2.Text
CurrFolder = Dir(Text2.Text, vbDirectory)
If SysCore = "gb" Then Form1.Combo1.Text = "gb (GameBoy (Color))"
If SysCore = "gba" Then Form1.Combo1.Text = "gba (GameBoy Advanced)"
If SysCore = "gg" Then Form1.Combo1.Text = "gg (Sega Game Gear)"
If SysCore = "lynx" Then Form1.Combo1.Text = "lynx (Atari Lynx)"
If SysCore = "md" Then Form1.Combo1.Text = "md (Sega Genesis/MegaDrive)"
If SysCore = "nes" Then Form1.Combo1.Text = "nes (Nintendo Entertainment System)"
If SysCore = "ngp" Then Form1.Combo1.Text = "ngp (Neo Geo Pocket (Color))"
If SysCore = "pce" Then Form1.Combo1.Text = "pce (PC Engine (CD)/TurboGrafx 16 (CD)/SuperGrafx)"
If SysCore = "pce_fast" Then Form1.Combo1.Text = "pce_fast (PC Engine (CD)/TurboGrafx 16 (CD)/SuperGrafx)"
If SysCore = "pcfx" Then Form1.Combo1.Text = "pcfx (PC-FX)"
If SysCore = "psx" Then Form1.Combo1.Text = "psx (Sony PlayStation)"
If SysCore = "sms" Then Form1.Combo1.Text = "sms (Sega Master System)"
If SysCore = "snes" Then Form1.Combo1.Text = "snes (Super Nintendo Entertainment System)"
If SysCore = "ss" Then Form1.Combo1.Text = "ss (Sega Saturn)"
If SysCore = "vb" Then Form1.Combo1.Text = "vb (Virtual Boy)"
If SysCore = "wswan" Then Form1.Combo1.Text = "wswan (WonderSwan)"
'Create list of extracted cue sheets
Dim colFiles As New Collection
If SysCore = "psx" Then
MedAdvGAMES = VB.App.Path & "\dat\MedAdvPSX.dat"
MedAdvCOVERS = VB.App.Path & "\dat\MedAdvPSXCOVERS.dat"
MedAdvEXT = "cue"
ElseIf SysCore = "snes" Then
MedAdvGAMES = VB.App.Path & "\dat\MedAdvSNES.dat"
MedAdvCOVERS = VB.App.Path & "\dat\MedAdvSNESCOVERS.dat"
MedAdvEXT = "smc"
ElseIf SysCore = "nes" Then
MedAdvGAMES = VB.App.Path & "\dat\MedAdvNES.dat"
MedAdvCOVERS = VB.App.Path & "\dat\MedAdvNESCOVERS.dat"
MedAdvEXT = "nes"
ElseIf SysCore = "ss" Then
MedAdvGAMES = VB.App.Path & "\dat\MedAdvSS.dat"
MedAdvCOVERS = VB.App.Path & "\dat\MedAdvSSCOVERS.dat"
MedAdvEXT = "cue"
ElseIf SysCore = "gba" Then
MedAdvGAMES = VB.App.Path & "\dat\MedAdvGBA.dat"
MedAdvCOVERS = VB.App.Path & "\dat\MedAdvGBACOVERS.dat"
MedAdvEXT = "gba"
ElseIf SysCore = "gb" Then
MedAdvGAMES = VB.App.Path & "\dat\MedAdvGB.dat"
MedAdvCOVERS = VB.App.Path & "\dat\MedAdvGBCOVERS.dat"
MedAdvEXT = "gbc"
ElseIf SysCore = "gg" Then
MedAdvGAMES = VB.App.Path & "\dat\MedAdvGG.dat"
MedAdvCOVERS = VB.App.Path & "\dat\MedAdvGGCOVERS.dat"
MedAdvEXT = "gg"
ElseIf SysCore = "pce" Then
MedAdvGAMES = VB.App.Path & "\dat\MedAdvPCE.dat"
MedAdvCOVERS = VB.App.Path & "\dat\MedAdvPCECOVERS.dat"
MedAdvEXT = "cue"
ElseIf SysCore = "pce_fast" Then
MedAdvGAMES = VB.App.Path & "\dat\MedAdvPCE.dat"
MedAdvCOVERS = VB.App.Path & "\dat\MedAdvPCECOVERS.dat"
MedAdvEXT = "cue"
ElseIf SysCore = "md" Then
MedAdvGAMES = VB.App.Path & "\dat\MedAdvMD.dat"
MedAdvCOVERS = VB.App.Path & "\dat\MedAdvMDCOVERS.dat"
MedAdvEXT = "bin"
ElseIf SysCore = "lynx" Then
MedAdvGAMES = VB.App.Path & "\dat\MedAdvLYNX.dat"
MedAdvCOVERS = VB.App.Path & "\dat\MedAdvLYNXCOVERS.dat"
MedAdvEXT = "lnx"
ElseIf SysCore = "vb" Then
MedAdvGAMES = VB.App.Path & "\dat\MedAdvVB.dat"
MedAdvCOVERS = VB.App.Path & "\dat\MedAdvVBCOVERS.dat"
MedAdvEXT = "vb"
End If
RecursiveDir colFiles, Text2.Text, "*." & MedAdvEXT, True
If FSO.FileExists(MedAdvGAMES) = False Then
'MsgBox "cmd.exe /c echo " & Chr(34) & Chr(34) & " >> " & Chr(34) & MedAdvGAMES & Chr(34)
Shell ("cmd.exe /c echo " & Chr(34) & Chr(34) & " >> " & Chr(34) & MedAdvGAMES & Chr(34))
End If
Dim vFile As Variant
Close #7
Open MedAdvGAMES For Output As #7
For Each vFile In colFiles
Text3.Text = Text3.Text & vFile & vbCrLf
Print #7, vFile
Next vFile
Close #7
a = Save_Settings()
Unload Form3
Form3.Refresh
Form2.Visible = False
Form3.Visible = True
End Sub
Private Sub ListFiles(strPath As String, Optional Extention As String)
'Leave Extention blank for all files
Dim File As String
If Right$(strPath, 1) <> "\" Then strPath = strPath & "\"
If Trim$(Extention) = "" Then
Extention = "*.*"
ElseIf Left$(Extention, 2) <> "*." Then
Extention = "*." & Extention
End If
File = Dir$(strPath & Extention)
Do While Len(File)
Text3.Text = Text3.Text & File & vbCrLf
File = Dir$
Loop
End Sub
Private Sub Command4_Click()
a = Unhide_Buttons()
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
If ActiveFile = "SAVE" Then
tmp2 = MsgBox("Set Path: " & Dir1.Path, vbYesNo, "Set this path?")
If tmp2 = vbYes Then
Text7.Text = Dir1.Path
SavePath = Text7.Text
Form1.Width = 9240
ActiveFile = "None"
tmp2 = ""
End If
ElseIf ActiveFile = "ROMDIR" Then
tmp2 = MsgBox("Set Path: " & Dir1.Path, vbYesNo, "Set this path?")
If tmp2 = vbYes Then
Text2.Text = Dir1.Path
RomPath = Text2.Text
ROMDIR = Text2.Text
Form1.Width = 9240
ActiveFile = "None"
tmp2 = ""
End If
End If
End Sub
Private Sub Documentation_Click()
Shell "cmd.exe /c start https://mednafen.github.io/documentation/", vbHide
End Sub
Private Sub Drive1_Change()
On Error Resume Next
Dir1.Path = Drive1.Drive
End Sub
Private Sub File1_Click()
If ActiveFile = "MEDEXE" Then
If Check15.Value = 1 Then
a = a
tmp2 = vbYes
Else
tmp2 = MsgBox("Set File: " & File1.FileName, vbYesNo, "Set this file?")
End If
If tmp2 = vbYes Then
MedEXE = Dir1.Path & "\" & File1.FileName
Form1.Width = 9240
ActiveFile = "None"
tmp2 = ""
a = Validate_MedEXE()
End If
End If
If ActiveFile = "BIOS" Then
tmp2 = MsgBox("Set File: " & File1.FileName, vbYesNo, "Set this file?")
If tmp2 = vbYes Then
BIOSPATH = Dir1.Path
BIOSFILE = File1.FileName
Text1.Text = BIOSPATH & "\" & BIOSFILE
Form1.Width = 9240
ActiveFile = "None"
tmp2 = ""
a = Validate_Bios()
End If
End If
If ActiveFile = "ROM" Then
If Check15.Value = 1 Then
a = a
tmp2 = vbYes
Else
tmp2 = MsgBox("Set File: " & File1.FileName, vbYesNo, "Set this file?")
End If
If tmp2 = vbYes Then
Text2.Text = Dir1.Path & "\" & File1.FileName
ROMDIR = Dir1.Path
ROMFILE = Text2.Text
'Form1.Width = 12735
Form1.Width = 9240
ActiveFile = "None"
tmp2 = ""
a = Validate_Rom()
End If
End If
If ActiveFile = "M3U" Then
If z = 0 Then
If Check15.Value = 1 Then
a = a
tmp2 = vbYes
Else
tmp2 = MsgBox("Set Disc 1: " & File1.FileName, vbYesNo, "Set this file?")
End If
If tmp2 = vbYes Then
Print #2, Dir1.Path & "\" & File1.FileName
tmp1 = File1.FileName
End If
tmp2 = ""
z = z + 1
MsgBox ("Now select the next disc")
ElseIf z >= 1 And z <= Val(M3USize) Then
Do
If File1.FileName <> tmp1 And Len(File1.FileName) > 1 And z <= Val(M3USize) And File1.FileName <> LastFile Then
If Check15.Value = 1 Then
a = a
tmp2 = vbYes
Else
tmp2 = MsgBox("Set Disc " & z + 1 & ": " & File1.FileName, vbYesNo, "Set this file?")
End If
LastFile = File1.FileName
If tmp2 = vbYes Then
Print #2, Dir1.Path & "\" & File1.FileName
z = z + 1
If z <> Val(M3USize) Then
MsgBox ("Now select the next disc")
End If
ElseIf tmp2 = vbNo Then
File1.FileName = ""
End If
End If
DoEvents
Loop Until z = Val(M3USize) Or z > Val(M3USize)
tmp2 = ""
ActiveFile = "None"
Form1.Width = 9240
Close #2
MsgBox "M3U Generated! Written to: " & VB.App.Path & "\multi.m3u" & vbCrLf & vbCrLf & "You should rename your multi.m3u" & vbCrLf & vbCrLf & "Your Memory Card and Save State filenames will be based on it." & vbCrLf & vbCrLf & "Use F8 to 'Eject/Close' and F6 to cycle thru the Disc Set"
Text2.Text = VB.App.Path & "\multi.m3u"
End If
End If
End Sub
Private Sub Form_Load()
Build = Form1.GetBuild()
Form2.Caption = "MedAdvCFG v" & Build & " (Mednafen v1.x Frontend) by Nigel Todman"
Form2.Width = 11145
Form2.Height = 6120
Basic.Checked = True
Set FSO = CreateObject("Scripting.FileSystemObject")
a = LoadSettings()
If SysCore = "psx" Or SysCore = "ss" Or SysCore = "pce" Then
If Len(BIOSFILE) = 0 Then
MsgBox "Please select a BIOS"
End If
End If
Text1.Text = BIOSFILE
Text2.Text = BasicModeFolder
Text5.Text = XRes
Text6.Text = YRes
Dir1.Path = LastPath
File1.Path = LastPath
ROMDIR = BasicModeFolder
BIOSPATH = BiosPathLoad
a = Validate_MedEXE()
a = Validate_Bios()
Label6.Visible = False
Label5.Visible = False
Label3.Visible = False
Label2.Visible = False
End Sub
Function LoadSettings()
'Load Settings
Set FSO = CreateObject("Scripting.FileSystemObject")
If FSO.FileExists(VB.App.Path & "\MedAdvCFG.dat") Then
Close #66
Open VB.App.Path & "\MedAdvCFG.dat" For Input As #66
For x = 1 To 35
On Error Resume Next
Line Input #66, tmp3(x)
Next x
Close #66
MedEXE = Mid$(tmp3(1), 8, Len(tmp3(1)))
SystemCore = Mid$(tmp3(2), 12, Len(tmp3(2)))
BIOSFILE = Mid$(tmp3(3), 12, Len(tmp3(3)))
BIOSSanity = Mid$(tmp3(4), 12, 1)
ROMFILE = Mid$(tmp3(5), 10, Len(tmp3(5)))
ROMSanity = Mid$(tmp3(6), 11, 1)
Stretch = Mid$(tmp3(7), 9, Len(tmp3(7)))
PixelShader = Mid$(tmp3(8), 13, Len(tmp3(8)))
VideoScaler = Mid$(tmp3(9), 13, Len(tmp3(9)))
Fullscreen = Mid$(tmp3(10), 12, 1)
Frameskip = Mid$(tmp3(11), 11, 1)
TBlur = Mid$(tmp3(12), 7, 1)
TblurAccum = Mid$(tmp3(13), 13, Len(tmp3(13)))
AccumAmount = Mid$(tmp3(14), 11, 1)
VideoIP = Mid$(tmp3(15), 9, 1)
XRes = Mid$(tmp3(16), 6, Len(tmp3(16)))
YRes = Mid$(tmp3(17), 6, Len(tmp3(17)))
ScaleFactor = Mid$(tmp3(18), 13, 1)
LastPath = Mid$(tmp3(19), 10, Len(tmp3(19)))
BiosPathLoad = Mid$(tmp3(20), 14, Len(tmp3(20)))
SavePath = Mid$(tmp3(21), 10, Len(tmp3(21)))
SystemRegion = Mid$(tmp3(22), 14, Len(tmp3(22)))
ROMPathLoad = Mid$(tmp3(23), 9, Len(tmp3(23)))
DisableSound = Mid$(tmp3(24), 14, Len(tmp3(24)))
ForceMono = Mid$(tmp3(25), 11, Len(tmp3(25)))
video_blit_timesync = Mid$(tmp3(26), 21, Len(tmp3(26)))
video_glvsync = Mid$(tmp3(27), 15, Len(tmp3(27)))
untrusted_fip_check = Mid$(tmp3(28), 21, Len(tmp3(28)))
cd_image_memcache = Mid$(tmp3(29), 19, Len(tmp3(29)))
scanlines = Mid$(tmp3(30), 11, Len(tmp3(30)))
axisscale = Mid$(tmp3(31), 11, Len(tmp3(31)))
numplayers = Mid$(tmp3(32), 12, Len(tmp3(32)))
customparams = Mid$(tmp3(33), 14, Len(tmp3(33)))
BasicModeFolder = Mid$(tmp3(34), 17, Len(tmp3(34)))
QuickLaunch = Mid$(tmp3(35), 13, 1)
End If
'End Load Settings
End Function
Private Sub Image1_Click()
'PSX
Form1.Combo1.Text = "psx (Sony PlayStation)"
a = Hide_Buttons()
LogoTop = Image1.Top
LogoLeft = Image1.Left
Image1.Left = 4740
Image1.Top = 809.109
Image1.Visible = True
SysCore = "psx"
End Sub
Function Validate_Rom()
If Check9.Value = 1 Then
If FSO.FileExists(ROMFILE) = True Then
tmp = Form1.CalcMD5(Form1.ShortPath(ROMFILE))
Text2.Text = ROMFILE
Label9.Caption = "MD5: " & tmp
End If
Else
Label9.Caption = "MD5: ROM MD5 Disabled"
End If
Validate_Rom = tmp
End Function
Public Function Hide_Buttons()
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
Image5.Visible = False
Image6.Visible = False
Image7.Visible = False
Image8.Visible = False