forked from kevinlekiller/linux_intel_display_overclocking
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVideo timing calculator.html
927 lines (898 loc) · 34 KB
/
Video timing calculator.html
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
<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
<!-- saved from url=(0047)https://www.epanorama.net/faq/vga2rgb/calc.html -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Video timing calculator</title>
<script language="JavaScript">
<!--Hide from old browsers
function TwoDecimal(number) {
number=((Math.round(number*100)/100));
return number;
}
function OneDecimal(number) {
number=((Math.round(number*10)/10));
return number;
}
function MakeModeline(form){
B = parseInt(form.H_DISP.value) + parseInt(form.H_FPORCH.value);
C = B + parseInt(form.H_SYNC.value);
F = parseInt(form.V_DISP.value) + parseInt(form.V_FPORCH.value);
G = F + parseInt(form.V_SYNC.value);
if (form.INTERLACE.value == "1") {
F = parseInt(form.V_DISP.value) + 2*parseInt(form.V_FPORCH.value);
G = F + 2*parseInt(form.V_SYNC.value);
}
hsyncparam="";
if (form.HSYNCPOL.value == "1") {
hsyncparam="+hsync"
} ;
if (form.HSYNCPOL.value == "0") {
hsyncparam="-hsync"
}
vsyncparam="";
if (form.VSYNCPOL.value == "1") {
vsyncparam="+vsync"
} ;
if (form.VSYNCPOL.value == "0") {
vsyncparam="-vsync"
}
result = "Modeline \""+form.H_DISP.value+"x"+form.V_DISP.value+"\" "+form.PIXEL_CLK.value+" "+form.H_DISP.value+" "+B+" "+C+" "+form.HTOTAL.value+" "+form.V_DISP.value+" "+F+" "+G+" "+form.VTOTAL.value+" "+hsyncparam+" "+vsyncparam;
if (form.INTERLACE.value == "1") result=result+" Interlace";
return result;
}
function MakeMatroxmon(form){
result="[*User-Defined_mode,("+form.H_DISP.value+"X"+form.V_DISP.value+")]\r\n"
+"PIXEL_CLK = "+form.PIXEL_CLK.value*1000+"\r\n"
+"H_DISP = "+form.H_DISP.value+"\r\n"
+"H_FPORCH = "+form.H_FPORCH.value+"\r\n"
+"H_SYNC = "+form.H_SYNC.value+"\r\n"
+"H_BPORCH = "+form.H_BPORCH.value+"\r\n"
+"H_SYNC_POL = "+form.HSYNCPOL.value+"\r\n"
+"V_DISP = "+form.V_DISP.value+"\r\n"
+"V_FPORCH = "+form.V_FPORCH.value+"\r\n"
+"V_SYNC = "+form.V_SYNC.value+"\r\n"
+"V_BPORCH = "+form.V_BPORCH.value+"\r\n"
+"V_SYNC_POL = "+form.VSYNCPOL.value+"\r\n"
+"INTERLACE_ENABLE = "+form.INTERLACE.value+"\r\n";
if (form.INTERLACE.value == "1") {
result="[*User-Defined_mode,("+form.H_DISP.value+"X"+form.V_DISP.value+")]\r\n"
+"PIXEL_CLK = "+form.PIXEL_CLK.value*1000+"\r\n"
+"H_DISP = "+form.H_DISP.value+"\r\n"
+"H_FPORCH = "+form.H_FPORCH.value+"\r\n"
+"H_SYNC = "+form.H_SYNC.value+"\r\n"
+"H_BPORCH = "+form.H_BPORCH.value+"\r\n"
+"H_SYNC_POL = "+form.HSYNCPOL.value+"\r\n"
+"V_DISP = "+Math.round(form.V_DISP.value/2)+"\r\n"
+"V_FPORCH = "+form.V_FPORCH.value+"\r\n"
+"V_SYNC = "+form.V_SYNC.value+"\r\n"
+"V_BPORCH = "+form.V_BPORCH.value+"\r\n"
+"V_SYNC_POL = "+form.VSYNCPOL.value+"\r\n"
+"INTERLACE_ENABLE = 1\r\n";
}
return result;
}
function MakeWin95inf(form){
hsyncparam="";
if (form.HSYNCPOL.value == "1") {
hsyncparam="+"
} ;
if (form.HSYNCPOL.value == "0") {
hsyncparam="-"
}
vsyncparam="";
if (form.VSYNCPOL.value == "1") {
vsyncparam="+"
} ;
if (form.VSYNCPOL.value == "0") {
vsyncparam="-"
}
result="HKR,\"MODES\\"+form.H_DISP.value+","+form.V_DISP.value+"\",Mode1,,\""+OneDecimal(parseFloat(form.HFREQ.value))+","+OneDecimal(parseFloat(form.VFREQ.value))+","+hsyncparam+","+vsyncparam+"\"";
if (form.INTERLACE.value == "1") result="Interlaced modes not supported";
return result;
}
function compute (form) {
form.HTOTAL.value = TwoDecimal(parseFloat(form.H_DISP.value)+parseFloat(form.H_FPORCH.value)+parseFloat(form.H_SYNC.value)+parseFloat(form.H_BPORCH.value));
form.VTOTAL.value = TwoDecimal(parseFloat(form.V_DISP.value)+parseFloat(form.V_FPORCH.value)+parseFloat(form.V_SYNC.value)+parseFloat(form.V_BPORCH.value));
if (form.INTERLACE.value == "1") form.VTOTAL.value = TwoDecimal(parseFloat(form.V_DISP.value)+2*parseFloat(form.V_FPORCH.value)+2*parseFloat(form.V_SYNC.value)+2*parseFloat(form.V_BPORCH.value));
form.HFREQ.value = TwoDecimal((1000*parseFloat(form.PIXEL_CLK.value))/(parseFloat(form.HTOTAL.value)));
form.VFREQ.value = TwoDecimal((1000000*parseFloat(form.PIXEL_CLK.value)) /(parseFloat(form.HTOTAL.value)*parseFloat(form.VTOTAL.value)));
form.FIELDRATE.value = form.VFREQ.value;
if (form.INTERLACE.value == "1") form.VFREQ.value=2*form.VFREQ.value;
form.HSYNCTIME.value=TwoDecimal((parseFloat(form.H_SYNC.value))/(parseFloat(form.PIXEL_CLK.value)));
form.VSYNCTIME.value=TwoDecimal((parseFloat(form.V_SYNC.value)*parseFloat(form.HTOTAL.value))/(parseFloat(form.PIXEL_CLK.value)));
form.MODELINE.value=MakeModeline(form);
form.WIN95INF.value=MakeWin95inf(form);
form.MATROXMON.value=MakeMatroxmon(form);
}
function set_mode_defaults(form) {
mode = form.SCREENMODE.options[form.SCREENMODE.selectedIndex].value;
form.INTERLACE.value="0";
form.VSYNCPOL.value="0";
form.HSYNCPOL.value="0";
if (mode == "CUSTOM") {
form.PIXEL_CLK.value="";
form.H_DISP.value="";
form.H_FPORCH.value="";
form.H_SYNC.value=""
form.H_BPORCH.value="";
form.V_DISP.value="";
form.V_FPORCH.value="";
form.V_SYNC.value=""
form.V_BPORCH.value="";
}
if (mode == "640x480_60") {
form.PIXEL_CLK.value="25.17";
form.H_DISP.value="640";
form.H_FPORCH.value="16";
form.H_SYNC.value="96"
form.H_BPORCH.value="48";
form.V_DISP.value="480";
form.V_FPORCH.value="11";
form.V_SYNC.value="2"
form.V_BPORCH.value="31";
form.HSYNCPOL.value="0";
form.VSYNCPOL.value="0";
}
if (mode == "640x480_72") {
form.PIXEL_CLK.value="31.5";
form.H_DISP.value="640";
form.H_FPORCH.value="24";
form.H_SYNC.value="40"
form.H_BPORCH.value="128";
form.V_DISP.value="480";
form.V_FPORCH.value="9";
form.V_SYNC.value="3"
form.V_BPORCH.value="28";
form.HSYNCPOL.value="0";
form.VSYNCPOL.value="0";
}
if (mode == "640x480_75") {
form.PIXEL_CLK.value="31.5";
form.H_DISP.value="640";
form.H_FPORCH.value="16";
form.H_SYNC.value="96"
form.H_BPORCH.value="48";
form.V_DISP.value="480";
form.V_FPORCH.value="11";
form.V_SYNC.value="2"
form.V_BPORCH.value="32";
form.HSYNCPOL.value="0";
form.VSYNCPOL.value="0";
}
if (mode == "640x480_85") {
form.PIXEL_CLK.value="36";
form.H_DISP.value="640";
form.H_FPORCH.value="32";
form.H_SYNC.value="48"
form.H_BPORCH.value="112";
form.V_DISP.value="480";
form.V_FPORCH.value="1";
form.V_SYNC.value="3"
form.V_BPORCH.value="25";
form.HSYNCPOL.value="0";
form.VSYNCPOL.value="0";
}
if (mode == "800x600_56") {
form.PIXEL_CLK.value="38.1";
form.H_DISP.value="800";
form.H_FPORCH.value="32";
form.H_SYNC.value="128"
form.H_BPORCH.value="128";
form.V_DISP.value="600";
form.V_FPORCH.value="1";
form.V_SYNC.value="4"
form.V_BPORCH.value="14";
form.HSYNCPOL.value="0";
form.VSYNCPOL.value="0";
}
if (mode == "800x600_60") {
form.PIXEL_CLK.value="40";
form.H_DISP.value="800";
form.H_FPORCH.value="40";
form.H_SYNC.value="128"
form.H_BPORCH.value="88";
form.V_DISP.value="600";
form.V_FPORCH.value="1";
form.V_SYNC.value="4"
form.V_BPORCH.value="23";
form.HSYNCPOL.value="1";
form.VSYNCPOL.value="1";
}
if (mode == "800x600_72") {
form.PIXEL_CLK.value="50";
form.H_DISP.value="800";
form.H_FPORCH.value="56";
form.H_SYNC.value="120"
form.H_BPORCH.value="64";
form.V_DISP.value="600";
form.V_FPORCH.value="37";
form.V_SYNC.value="6"
form.V_BPORCH.value="23";
form.HSYNCPOL.value="1";
form.VSYNCPOL.value="1";
}
if (mode == "800x600_75") {
form.PIXEL_CLK.value="49.5";
form.H_DISP.value="800";
form.H_FPORCH.value="16";
form.H_SYNC.value="80"
form.H_BPORCH.value="160";
form.V_DISP.value="600";
form.V_FPORCH.value="1";
form.V_SYNC.value="2"
form.V_BPORCH.value="21";
form.HSYNCPOL.value="1";
form.VSYNCPOL.value="1";
}
if (mode == "800x600_85") {
form.PIXEL_CLK.value="56.25";
form.H_DISP.value="800";
form.H_FPORCH.value="32";
form.H_SYNC.value="64"
form.H_BPORCH.value="152";
form.V_DISP.value="600";
form.V_FPORCH.value="1";
form.V_SYNC.value="3"
form.V_BPORCH.value="27";
form.HSYNCPOL.value="1";
form.VSYNCPOL.value="1";
}
if (mode == "1024x768_60") {
form.PIXEL_CLK.value="65";
form.H_DISP.value="1024";
form.H_FPORCH.value="24";
form.H_SYNC.value="136"
form.H_BPORCH.value="160";
form.V_DISP.value="768";
form.V_FPORCH.value="3";
form.V_SYNC.value="6"
form.V_BPORCH.value="29";
form.HSYNCPOL.value="0";
form.VSYNCPOL.value="0";
}
if (mode == "1024x768_70") {
form.PIXEL_CLK.value="75";
form.H_DISP.value="1024";
form.H_FPORCH.value="24";
form.H_SYNC.value="136"
form.H_BPORCH.value="144";
form.V_DISP.value="768";
form.V_FPORCH.value="3";
form.V_SYNC.value="6"
form.V_BPORCH.value="29";
form.HSYNCPOL.value="0";
form.VSYNCPOL.value="0";
}
if (mode == "1024x768_75") {
form.PIXEL_CLK.value="78.75";
form.H_DISP.value="1024";
form.H_FPORCH.value="16";
form.H_SYNC.value="96"
form.H_BPORCH.value="176";
form.V_DISP.value="768";
form.V_FPORCH.value="1";
form.V_SYNC.value="3"
form.V_BPORCH.value="28";
form.HSYNCPOL.value="1";
form.VSYNCPOL.value="1";
}
if (mode == "1024x768_85") {
form.PIXEL_CLK.value="94.5";
form.H_DISP.value="1024";
form.H_FPORCH.value="48";
form.H_SYNC.value="96"
form.H_BPORCH.value="208";
form.V_DISP.value="768";
form.V_FPORCH.value="1";
form.V_SYNC.value="3"
form.V_BPORCH.value="36";
form.HSYNCPOL.value="1";
form.VSYNCPOL.value="1";
}
if (mode == "1152x864_75") {
form.PIXEL_CLK.value="108";
form.H_DISP.value="1152";
form.H_FPORCH.value="64";
form.H_SYNC.value="128"
form.H_BPORCH.value="256";
form.V_DISP.value="864";
form.V_FPORCH.value="1";
form.V_SYNC.value="3"
form.V_BPORCH.value="32";
form.HSYNCPOL.value="1";
form.VSYNCPOL.value="1";
}
if (mode == "1152x864_85") {
form.PIXEL_CLK.value="128.94";
form.H_DISP.value="1152";
form.H_FPORCH.value="64";
form.H_SYNC.value="224"
form.H_BPORCH.value="224";
form.V_DISP.value="864";
form.V_FPORCH.value="1";
form.V_SYNC.value="3"
form.V_BPORCH.value="43";
form.HSYNCPOL.value="1";
form.VSYNCPOL.value="1";
}
if (mode == "1152x882_70") {
form.PIXEL_CLK.value="94.5";
form.H_DISP.value="1152";
form.H_FPORCH.value="32";
form.H_SYNC.value="96"
form.H_BPORCH.value="200";
form.V_DISP.value="882";
form.V_FPORCH.value="1";
form.V_SYNC.value="3"
form.V_BPORCH.value="44";
form.HSYNCPOL.value="1";
form.VSYNCPOL.value="1";
}
if (mode == "1152x882_85") {
form.PIXEL_CLK.value="121.5";
form.H_DISP.value="1152";
form.H_FPORCH.value="64";
form.H_SYNC.value="128"
form.H_BPORCH.value="232";
form.V_DISP.value="882";
form.V_FPORCH.value="1";
form.V_SYNC.value="3"
form.V_BPORCH.value="39";
form.HSYNCPOL.value="1";
form.VSYNCPOL.value="1";
}
if (mode == "1280x1024_60") {
form.PIXEL_CLK.value="108";
form.H_DISP.value="1280";
form.H_FPORCH.value="48";
form.H_SYNC.value="112"
form.H_BPORCH.value="248";
form.V_DISP.value="1024";
form.V_FPORCH.value="1";
form.V_SYNC.value="3"
form.V_BPORCH.value="38";
form.HSYNCPOL.value="1";
form.VSYNCPOL.value="1";
}
if (mode == "1280x1024_75") {
form.PIXEL_CLK.value="135";
form.H_DISP.value="1280";
form.H_FPORCH.value="16";
form.H_SYNC.value="144"
form.H_BPORCH.value="248";
form.V_DISP.value="1024";
form.V_FPORCH.value="1";
form.V_SYNC.value="3"
form.V_BPORCH.value="38";
form.HSYNCPOL.value="1";
form.VSYNCPOL.value="1";
}
if (mode == "1280x1024_85") {
form.PIXEL_CLK.value="157.5";
form.H_DISP.value="1280";
form.H_FPORCH.value="48";
form.H_SYNC.value="160"
form.H_BPORCH.value="240";
form.V_DISP.value="1024";
form.V_FPORCH.value="1";
form.V_SYNC.value="3"
form.V_BPORCH.value="44";
form.HSYNCPOL.value="1";
form.VSYNCPOL.value="1";
}
if (mode == "1600x1200_60") {
form.PIXEL_CLK.value="162";
form.H_DISP.value="1600";
form.H_FPORCH.value="64";
form.H_SYNC.value="192"
form.H_BPORCH.value="304";
form.V_DISP.value="1200";
form.V_FPORCH.value="1";
form.V_SYNC.value="3"
form.V_BPORCH.value="46";
form.HSYNCPOL.value="1";
form.VSYNCPOL.value="1";
}
if (mode == "1600x1200_70") {
form.PIXEL_CLK.value="189";
form.H_DISP.value="1600";
form.H_FPORCH.value="64";
form.H_SYNC.value="192"
form.H_BPORCH.value="304";
form.V_DISP.value="1200";
form.V_FPORCH.value="1";
form.V_SYNC.value="3"
form.V_BPORCH.value="46";
form.HSYNCPOL.value="1";
form.VSYNCPOL.value="1";
}
if (mode == "1600x1200_75") {
form.PIXEL_CLK.value="202.5";
form.H_DISP.value="1600";
form.H_FPORCH.value="64";
form.H_SYNC.value="192"
form.H_BPORCH.value="304";
form.V_DISP.value="1200";
form.V_FPORCH.value="1";
form.V_SYNC.value="3"
form.V_BPORCH.value="46";
form.HSYNCPOL.value="1";
form.VSYNCPOL.value="1";
}
if (mode == "1600x1200_80") {
form.PIXEL_CLK.value="216";
form.H_DISP.value="1600";
form.H_FPORCH.value="64";
form.H_SYNC.value="192"
form.H_BPORCH.value="304";
form.V_DISP.value="1200";
form.V_FPORCH.value="1";
form.V_SYNC.value="3"
form.V_BPORCH.value="46";
form.HSYNCPOL.value="1";
form.VSYNCPOL.value="1";
}
if (mode == "1600x1200_85") {
form.PIXEL_CLK.value="229.5";
form.H_DISP.value="1600";
form.H_FPORCH.value="64";
form.H_SYNC.value="192"
form.H_BPORCH.value="304";
form.V_DISP.value="1200";
form.V_FPORCH.value="1";
form.V_SYNC.value="3"
form.V_BPORCH.value="46";
form.HSYNCPOL.value="1";
form.VSYNCPOL.value="1";
}
if (mode == "640x480_VGA2TV50") {
form.PIXEL_CLK.value="25.175";
form.H_DISP.value="640";
form.H_FPORCH.value="16";
form.H_SYNC.value="64"
form.H_BPORCH.value="120";
form.V_DISP.value="480";
form.V_FPORCH.value="51";
form.V_SYNC.value="3"
form.V_BPORCH.value="66";
}
if (mode == "640x480_VGA2TV60") {
form.PIXEL_CLK.value="25.175";
form.H_DISP.value="640";
form.H_FPORCH.value="16";
form.H_SYNC.value="64"
form.H_BPORCH.value="120";
form.V_DISP.value="480";
form.V_FPORCH.value="1";
form.V_SYNC.value="3"
form.V_BPORCH.value="16";
}
if (mode == "800x600_VGA2TV50") {
form.PIXEL_CLK.value="34";
form.H_DISP.value="800";
form.H_FPORCH.value="40";
form.H_SYNC.value="120"
form.H_BPORCH.value="128";
form.V_DISP.value="600";
form.V_FPORCH.value="10";
form.V_SYNC.value="3"
form.V_BPORCH.value="12";
}
if (mode == "640x480_NTSC") {
form.PIXEL_CLK.value="12.700";
form.H_DISP.value="640";
form.H_FPORCH.value="16";
form.H_SYNC.value="88"
form.H_BPORCH.value="64";
form.V_DISP.value="480";
form.V_FPORCH.value="6";
form.V_SYNC.value="5"
form.V_BPORCH.value="13";
form.INTERLACE.value="1";
}
if (mode == "640x480_PAL") {
form.PIXEL_CLK.value="15.319";
form.H_DISP.value="640";
form.H_FPORCH.value="80";
form.H_SYNC.value="40"
form.H_BPORCH.value="160";
form.V_DISP.value="480";
form.V_FPORCH.value="35";
form.V_SYNC.value="5"
form.V_BPORCH.value="30";
form.INTERLACE.value="1";
}
if (mode == "800x600_PAL") {
form.PIXEL_CLK.value="15.407";
form.H_DISP.value="800";
form.H_FPORCH.value="8";
form.H_SYNC.value="128"
form.H_BPORCH.value="50";
form.V_DISP.value="600";
form.V_FPORCH.value="2";
form.V_SYNC.value="8"
form.V_BPORCH.value="4";
form.INTERLACE.value="1";
}
if (mode == "HDTV1920_60Hz") {
form.PIXEL_CLK.value="74.150";
form.H_DISP.value="1920";
form.H_FPORCH.value="44";
form.H_SYNC.value="88"
form.H_BPORCH.value="148";
form.V_DISP.value="517";
form.V_FPORCH.value="5";
form.V_SYNC.value="5"
form.V_BPORCH.value="35";
form.INTERLACE.value="1";
}
if (mode == "1920x1080_60") {
form.PIXEL_CLK.value="182.5";
form.H_DISP.value="1920";
form.H_FPORCH.value="32";
form.H_SYNC.value="696"
form.H_BPORCH.value="32";
form.V_DISP.value="1080";
form.V_FPORCH.value="22";
form.V_SYNC.value="11"
form.V_BPORCH.value="22";
form.INTERLACE.value="0";
}
}
function moveleft(form) {
if (parseFloat(form.H_BPORCH.value)>=8) {
form.H_FPORCH.value=parseFloat(form.H_FPORCH.value)+8;
form.H_BPORCH.value=parseFloat(form.H_BPORCH.value)-8;
}
}
function moveright(form) {
if (parseFloat(form.H_FPORCH.value)>=8) {
form.H_FPORCH.value=parseFloat(form.H_FPORCH.value)-8;
form.H_BPORCH.value=parseFloat(form.H_BPORCH.value)+8;
}
}
function moveup(form) {
if (parseFloat(form.V_BPORCH.value)>=1) {
form.V_FPORCH.value=parseFloat(form.V_FPORCH.value)+1;
form.V_BPORCH.value=parseFloat(form.V_BPORCH.value)-1;
}
}
function movedown(form) {
if (parseFloat(form.V_FPORCH.value)>=1) {
form.V_FPORCH.value=parseFloat(form.V_FPORCH.value)-1;
form.V_BPORCH.value=parseFloat(form.V_BPORCH.value)+1;
}
}
// by wolfgang loeffler, email: [email protected]
// modified by Tomi Engdahl
function importModeline(form) {
var args = new Object();
var argc = 0;
// Get Query String
var query = form.INMODELINE.value;
var lcquery = query.toLowerCase();
// Split query at the blank
var pairs = query.split(" ");
form.MATROXMON.value = "";
// Begin loop through the querystring
for(var i = 0; i < pairs.length; i++) {
if (pairs[i]!="") {
args[argc]=pairs[i];
argc++;
// form.MATROXMON.value = form.MATROXMON.value + "<"+args[argc-1]+">\n";
}
}
if (argc < 11) {
form.MATROXMON.value = form.MATROXMON.value + "wrong count of modeline params " + argc + " < 11 !\n";
exit();
}
// handle args
// 1: <"640x480">
var resstr = args[1].substring(1, args[1].length-1);
var reso = resstr.split("x");
// form.MATROXMON.value = form.MATROXMON.value + "reso0=" + reso[0] + ", " + reso[1] + "\n";
form.H_DISP.value=reso[0];
form.V_DISP.value=reso[1];
// 2: dot clock
form.PIXEL_CLK.value=args[2];
// 3,7: xres/yres
if ((parseInt(reso[0])!=parseInt(args[3])) || (parseInt(reso[1])!=parseInt(args[7])) ) {
form.MATROXMON.value = form.MATROXMON.value + "resolution mismatch!\n";
exit();
}
// interlace
var interlacenom=1;
if (query.toLowerCase().search("interlace")>=0) {
form.INTERLACE.value="1";
interlacenom=2;
}
// 4, 8:
form.H_FPORCH.value=parseInt(args[4]) - parseInt(reso[0]);
form.V_FPORCH.value=(parseInt(args[8]) - parseInt(reso[1]))/interlacenom;
// 5, 9:
form.H_SYNC.value=parseInt(args[5]) - parseInt(args[4]);
form.V_SYNC.value=(parseInt(args[9]) - parseInt(args[8]))/interlacenom;
// 6, 10:
form.H_BPORCH.value=parseInt(args[6 ]) - parseInt(args[5]);
form.V_BPORCH.value=(parseInt(args[10]) - parseInt(args[9]))/interlacenom;
// rest
form.HSYNCPOL.value="0";
form.VSYNCPOL.value="0";
form.INTERLACE.value="0";
if (lcquery.indexOf("+hsync")>=0) form.HSYNCPOL.value="1";
if (lcquery.indexOf("+vsync")>=0) form.VSYNCPOL.value="1";
if (lcquery.indexOf("-hsync")>=0) form.HSYNCPOL.value="0";
if (lcquery.indexOf("-vsync")>=0) form.VSYNCPOL.value="0";
if (lcquery.indexOf("interlace")>=0) form.INTERLACE.value="1";
}
//End Hide -->
</script>
<link type="image/x-icon" rel="shortcut icon" href="data:image/png;base64,AAABAAEAMDAQAAEABABoBgAAFgAAACgAAAAwAAAAYAAAAAEABAAAAAAAAAAAABMLAAATCwAAEAAAAAAAAAAAAAAA////AP39/gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////AAD///////8AAP///////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////AAD///////8AAP///////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP///////wAA"></head>
<body bgcolor="#dfdfdf" text="#000000">
<p>
</p><h1>Calculator for video timings v. 1.9</h1>
<p>
<i>Copyright Tomi Engdahl 1998-2006</i>
</p><p>
<b>NOTE1: You need a web broser that supports JavaScript to run this application. Most modern web browsers support JavaScript, but some users have this disable on their system for security reasons.
This software hould work with following or newer browsers:
Netscape 2.0, IE3 browser (with JavaScipt/Jscript turned to), Mozilla Firefox 1.0 and Opera.
This version has been tested to work with IE6 and Mozilla Firefox 1.0.
</b>
</p><p>
<b>NOTE2: There is no guarantee that the results you get from this from are correct. Use this at your own risk. If you find errors in this page please <a href="mailto:[email protected]">e-mail</a> me with a good description what is wrong.</b>
</p><p>
</p><hr>
<h2>1. Select the setting where you start</h2>
<p>
There are two ways to select the settings. You can freely use either one of them.
For most applications selecting from the readily available screen modes is the best option.
</p><p>
</p><form action="https://www.epanorama.net/faq/vga2rgb/calc.html">
<p>
Select the screen mode timings:
<select name="SCREENMODE" onchange="set_mode_defaults(this.form)">
<option value="CUSTOM" selected="">Custom screen mode
</option><option value="640x480_60">VGA 640x480 60Hz
</option><option value="640x480_72">VGA 640x480 72Hz
</option><option value="640x480_75">VESA 640x480 75Hz
</option><option value="640x480_85">VESA 640x480 85Hz
</option><option value="800x600_56">SVGA 800x600 56Hz
</option><option value="800x600_60">VESA 800x600 60Hz
</option><option value="800x600_72">VESA 800x600 72Hz
</option><option value="800x600_75">VESA 800x600 75Hz
</option><option value="800x600_85">VESA 800x600 85Hz
</option><option value="1024x768_60">VESA 1024x768 60Hz
</option><option value="1024x768_70">VESA 1024x768 70Hz
</option><option value="1024x768_75">VESA 1024x768 75Hz
</option><option value="1024x768_85">VESA 1024x768 85Hz
</option><option value="1152x864_75">VESA 1152x864 75 Hz
</option><option value="1152x864_85">VESA 1152x864 85 Hz
</option><option value="1152x882_70">VESA 1152x882 70Hz
</option><option value="1152x882_85">VESA 1152x882 85Hz
</option><option value="1280x1024_60">VESA 1280x1024 60Hz
</option><option value="1280x1024_75">VESA 1280x1024 75Hz
</option><option value="1280x1024_85">VESA 1280x1024 85Hz
</option><option value="1600x1200_60">VESA 1600x1200 60Hz
</option><option value="1600x1200_70">VESA 1600x1200 70Hz
</option><option value="1600x1200_75">VESA 1600x1200 75Hz
</option><option value="1600x1200_80">VESA 1600x1200 80Hz
</option><option value="1600x1200_85">VESA 1600x1200 85Hz
</option><option value="1920x1080_60">Special 1920x1080 60 Hz
</option><option value="640x480_VGA2TV50">VGA to TV converter 640x480 50 Hz (PAL)
</option><option value="640x480_VGA2TV60">VGA to TV converter 640x480 60 Hz (NTSC)
</option><option value="800x600_VGA2TV50">VGA to TV converter 800x600 50 Hz (PAL)
</option><option value="640x480_NTSC">640x480 NTSC TV interlaced
</option><option value="640x480_PAL">640x480 PAL TV interlaced
</option><option value="800x600_PAL">800x600 PAL TV interlaced
</option><option value="HDTV1920_60Hz">HDTV 1920x1034i 60 Hz
</option></select>
<input type="button" value="Set mode parameters to form below" onclick="set_mode_defaults(this.form)">
</p><p>
Or give Xfree86 modeline to import: <br>
<input type="text" name="INMODELINE" size="80"> <br>
<input type="button" value="Import Modeline" onclick="importModeline(this.form)">
</p><p>
</p><hr>
<p>
</p><h2>2. Look at graphics card settings and modify them</h2>
<p>
<table border="1" cellspacing="1" width="100%">
<tbody><tr>
<td>
<h3>General parameters</h3>
<p>
Pixel clock frequency
<input type="text" name="PIXEL_CLK" value="" size="6"> MHz
</p><p>
Interlace
<input type="text" name="INTERLACE" value="0" size="2">
</p></td>
</tr>
<tr><td>
<h3>Horizontal timing parameters</h3>
Resolution
<input type="text" name="H_DISP" value="" size="4"> pixels
<br>
Front porch
<input type="text" name="H_FPORCH" value="" size="4"> pixels
<br>
Sync pulse
<input type="text" name="H_SYNC" value="" size="4"> pixels, polarity
<input type="text" name="HSYNCPOL" value="0" size="2"> *
<br>
Back porch
<input type="text" name="H_BPORCH" value="" size="4"> pixels
<br>
<p>
</p></td>
<td>
<h3>Vertical timing parameters</h3>
<p>
Resolution
<input type="text" name="V_DISP" value="" size="4"> lines
<br>
Front porch
<input type="text" name="V_FPORCH" value="" size="4"> lines
<br>
Sync pulse
<input type="text" name="V_SYNC" value="" size="4"> lines, polarity
<input type="text" name="VSYNCPOL" value="0"" size="1"> *
<br>
Back porch
<input type="text" name="V_BPORCH" value="" size="4"> lines
<br>
</p><p>
</p></td>
</tr>
</tbody></table>
* For sync polarities 0 = NEGATIVE SYNC and 1 = POSITIVE SYNC
</p><p>
Move picture:
<input type="button" value="Left" onclick="moveleft(this.form)">
<input type="button" value="Right" onclick="moveright(this.form)">
<input type="button" value=" Up " onclick="moveup(this.form)">
<input type="button" value="Down" onclick="movedown(this.form)">
</p><p>
</p><hr>
<p>
</p><h2>3. Start calculation</h2>
<p>
Press
<input type="button" value="Calculate" onclick="compute(this.form)">
when you want to get the results.
</p><p>
</p><hr>
<h2>4. View calculated results</h2>
<p>
</p><h3>Numerical results</h3>
<p>
Horizontal sync frequency is
<input type="text" name="HFREQ" size="6"> kHz.
<br>
Vertical sync frequency is
<input type="text" name="VFREQ" size="6"> Hz.
<br>
Field rate is
<input type="text" name="FIELDRATE" size="6"> Hz.
</p><p>
Horizontal sync pulse length is
<input type="text" name="HSYNCTIME" size="6"> microseconds.
<br>
Vertical sync pulse length is
<input type="text" name="VSYNCTIME" size="6"> microseconds.
</p><p>
Horizontal total is
<input type="text" name="HTOTAL" size="6"> pixels
and vertical total is
<input type="text" name="VTOTAL" size="6"> lines.
</p><p>
<b>If you want to test other values then fill in new values
to form on step 2 and press calculate again.</b>
</p><p>
</p><h3>Configuration files</h3>
<p>
NOTE: The following configuration files are calculated from the data
above. There no guaantee that the calculated configuration files
work on your system. Use the configuration files at your own risk.
In some unfortunate cases it is possible that you damage your
monitor or mess up your graphics card driver settings.
</p><p>
Xfree86 modeline (to be included to XConfig file): <br>
<input type="text" name="MODELINE" size="80">
</p><p>
Matrox Windows driver custom monitor settings (to be included to MGA.MON file): <br>
<textarea name="MATROXMON" rows="15" cols="60" wrap="PHYSICAL"></textarea></p><p>
</p><p>
Windows95 monitor.inf file modeline: <br>
<input type="text" name="WIN95INF" size="80">
<br>
Note: Windows monitor .INF file contains only the screen refresh rate and
sync polarity information. It does not contain screen position information.
</p><p>
</p></form>
<p>
</p><hr>
<p>
</p><h3>Some instructions and notes</h3>
<p>
This page lists the most commonly used resolutions and refresh rates that
you can modify. You can modify all the parameters you want.
The you can use any combination of H and V resolution
(ok, number of pixels) and refresh rate that are
supported by your operating system, graphics card and your monitor.
Windows is pretty much limited on what resolutions it can use,
but with X you can pratcially use almost any
any combination of H and V resolution
(ok, number of pixels) and the limit is the card (clock and RAM) and
the monitor capabilities.
</p><p>
Note 1: Actual vertical and horizontal refresh rated depend on
the screen resolution, video clock rate and some other numbers
(porch and sync pulses).
</p><p>
Note 2: The horizontal timing parameters must be normally to be multiple
of 8 because this is the resolution which stadard VGA cards operate in
those timings and same applies to most of SVGA cards also.
</p><p>
Note 3: Screen mode settings do not set the sync signal polarity because the
needed sync signal polarity depends on the monitor and screen mode used.
If you do not know what polarity is needed try first to check both negative.
Sync signal polarity settings do not affect the timing calculations.
Sync signal polarities affect only to the generated configuration files.
</p><p>
Note 4: Moving picture the picture to the extreme positions may result
unstable picture on the monitor.
</p><p>
Note 5: The screen mode settings are general settings usually targeted
for 8 bpp (256 colors) modes. On some higher color modes some graphics
cards seem to have some limitations what horizontal resolution
settings can be (a multiple of 32 pixels in some cards). This might
cause that all settings might not work with all card in all modes.
Because of large variety of graphics cards and operating systems,
not all combinations of things could have been tested. If something
does not work for you, then try some other settings or try to
modify the mode to suit better to your card (if you know what to correct).
</p><p>
Note 6: In interlaced modes the vertical sync timing parameters are
per interlaced field.
Interlace draws only half of the screen each refresh, doubling the effective refresh rate. Interlaced modes are well known for their high flicker, but a 60Hz interlaced mode looks much better than a 30Hz non-interlaced mode.
</p><p>
Note 7: Horizontal Sync Time typically varies form 3.5 to 4.0 microseconds in normal PC monitor applications. Vertical Sync Time usually varies from 50 to 300 microseconds.
</p><p>
Note 8: I can't have all the screen modes in the world in my calculator (don't e-mail me to ask for details of modes not listed here, I don't have a secret repositiory of all the screen modes). To be able to fullfill the need
od people that need something else that not already offred here,
there is option to modify the screen mode settings
(the actual reason to built this calculator was to make modifying
screen modes easy).
Generally you take the nearest matching mode and then modify
it to match your needs. For example if you need slightly higher
or lower refresh rate that is offered by the ready made settings,
just try to modify the pixel clock frequency accordingly to
make the mode to refresh at the rate you want.
If the resolution is not exacly right, you can make slight
modifications to vertical and horizontal resolution fields.
</p><p>
Note 9: If you need a screen mode not listed here or are in doubt what is suitable for your monitor specifications, take a look at the screen mode calculator at
<a href="http://xtiming.sourceforge.net/cgi-bin/xtiming.pl">http://xtiming.sourceforge.net/cgi-bin/xtiming.pl</a>.
It can generate Xfree68 modelines with different kind
of user interface, you just need to input few details
of your monitor and resolution you eant.
Those modelines can be imported to this calculator, and
modify them here if you feel a need to do so.
</p><p>
Note 10: If you have problems with this newest calculator version, try some older version:
<a href="https://www.epanorama.net/faq/vga2rgb/calc_v16.html">v1.6</a> or <a href="https://www.epanorama.net/faq/vga2rgb/calc_v15.html">v1.5</a>
</p><p>
Note 11: If you want to have on off-line calculator like this on you computer, just simply
save this web page to your computer. It will work nicely locally on your computer through
you web browser just like this on-line version. You do not need any Internet connection
to use this locally saved copy of this calculator.
</p><p>
Note 12: The Xfree86 modeline importer in this calcualtor version is not foolproof and might not import all modelines correctly.
So check after modeline import that your data got imported correctly and do corrections to it if needed. According the comments I have received the modeline importer does not handle interlaced screen modes correctly.
</p><p>
</p><hr>
<address><a href="http://www.hut.fi/~then/">Tomi Engdahl</a> <<a href="mailto:[email protected]">[email protected]</a>></address>
<br>
<a href="https://www.epanorama.net/faq/vga2rgb/index.html"><img src="./Video timing calculator_files/back.gif" align="CENTER" alt="">Back to index</a>
</body></html>