forked from whosmatt/uvmod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
uvmod.valek.net.ru_mods_v31.js
2341 lines (2121 loc) · 175 KB
/
uvmod.valek.net.ru_mods_v31.js
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
modClasses = [
/*
class Mod_Example extends FirmwareMod {
constructor() {
super("Example Mod", "This mod does absolutely nothing and is used as an example for implementing new mods. It is hidden for convenience, not because it does anything risky.", 0); // Add name, description and size (additional flash used, 0 for most mods)
this.hidden = true; // Set this to true for high-risk mods such as the "Enable TX everywhere" mod
// Customize the mod-specific div with input elements
// There is a helper function for adding input fields easily:
this.inputField1 = addInputField(this.modSpecificDiv, "Example Mod specific input field 1", "Editable data");
}
apply(firmwareData) {
log("The value of input field 1 is: " + this.inputField1.value);
// Implement the logic to apply the specific mod here
// You can use the mod-specific inputs in this.modSpecificDiv
return firmwareData;
}
}
,
*/
/*
class Mod_APP extends FirmwareMod {
constructor() {
super("Приложения", "Добавляет приложение из списка на выбор:", "зависит от модификации");
this.selectSbar = addRadioButton(this.modSpecificDiv, "S-метр (уровни по 6дБ) + вольтметр батареи в строке состояния. Отображает уровень при передаче, но перекрывает субтон при копировании частоты. By @manujedi, v9.", "selectSbar", "selectApp"); // v78
this.selectSbarOld = addRadioButton(this.modSpecificDiv, "S-метр (уровни по 6дБ) + вольтметр батареи в строке состояния. Старая версия, не перекрывает субтон, но не отображает уровень при передаче. By @valekrus, (based on v44 by piotr022) НЕ РАБОТАЕТ.", "selectSbarOld", "selectApp"); // v44
this.selectGraph = addRadioButton(this.modSpecificDiv, "Шкала RSSI с выводом цифрового значения. By @manujedi, v9.", "selectGraph", "selectApp");
this.selectSpectr = addRadioButton(this.modSpecificDiv, "Спектроанализатор. Включается по кнопке фонарика. Вверх/вниз (удержание) - сменить центральную частоту, 8/2 - приблизить/отдалить, 1/7 - увеличить/уменьшить разрешение, PTT/EXIT - выход. После выхода надо зайти в меню, чтобы обновить экран. By @manujedi, v9.", "selectSpectr", "selectApp");
*/
// this.selectSpectrM = addRadioButton(this.modSpecificDiv, "Спектроанализатор от Михаила. Включается по кнопке фонарика. Перед запуском либо выключить шумодав (SQL в 0) либо включить режим мониторинга. Вверх/вниз - смена частоты, 1/7 - чувствительность(время замера), 2/8 - шаг частоты, 9/3 - приблизить/отдалить, */F (удержание) - уровень шумодава, 5 - подсветка, 0 - удалить частоту (подавить помеху), EXIT - выход. После выхода надо зайти в меню, чтобы обновить экран. By @manujedi, v9.", "selectSpectrM", "selectApp");
/*
this.selectMessenger = addRadioButton(this.modSpecificDiv, "Текстовый чат. Включается по кнопке фонарика. Клавиатура для набора сообщения, MENU - отправить, EXIT - очистить, если сообщения нет - выйти. Для набора следующей буквы на той же кнопке, что и предыдущая нажать * для подтверждения. By @manujedi, v9.", "selectMessenger", "selectApp");
this.selectPong = addRadioButton(this.modSpecificDiv, "Пинпонг. By @manujedi, v9.", "selectPong", "selectApp");
this.selectSpectrM.checked = true;
this.selectSbarOld.disabled = true;
}
apply(firmwareData) {
const dataSbar = hexString("10B5064C2378002B07D1054B002B02D0044800E000BF0123237010BDB813002000000000C0000000044B10B5002B03D00349044800E000BF10BDC04600000000BC130020C000000000207047D308DB015918E0239B00994207D807231A40063B93404068425C134343547047406840187047002070470A00303A0300D0B2092805D900202D2901D15868463070470720424358688018F9E708207047072070470020704770477047837D0248002B00D1014870474EED00005BED000008B4024B9C46083808BC6047F1E500000A2903D10123827D534083757047000008B4024B9C46083808BC604715E60000E02210B500214068920000F07EFB10BD002310B50180074A494209B214780133DBB2A14201DB837010BD01320D2BF5D10133F8E7A0ED000010B5F1F731FD10BDF8B5C3680400591CC160C72959D932232F4DFF33EB5C0122FF3B58425841237C93430343100023742A4B1B689843C3002948285C042580002840034327480068400A8243AA401C201343227C00258243134323744B0709D123681868A84205D02100036808315B68984705006668002E1FD0E368DB071CD4237C1B0711D4FCF7F5FC227EC7B297420BD061694868FF2A18D1002804D03A00036808319B68984727762100336830001B68083198470543EDB2AB0701D5FCF799FFEB0701D5FCF7D1FFF8BD0028EBD003680831DB68E6E704070020001006401A0300000008064073B52F4C2378002B05D100F0B1FA00F0BFFA012323702B4B1B68DB074AD52A4C237C012B46D13F20FCF704F9C021030089010B408B4203D001433F20FCF7CAFB0C20FCF7F7F8C30734D502200021FCF7C1FB0220FCF7EEF8C3042BD504265F20FCF7E8F80190A068002809D0237B628A023B9A4204DA801801A9022200F0ACFA638A013E02339BB2F6B26382002EE6D1257BAB420ED30B202674FCF7CBF802002068002806D06368002B03D0D2062900D20F98470548FFF733FFFDF7D7FD73BD1C14002000100640F0130020D4130020F8B5040040680D0000281FD003685B68984707002068218903689B6898470600606829000368DB6898470200002E05D039003000002F0BD000F066FA606829000368DB68984723891B1823810020F8BD00F063FAF2E770B506000D0000242800F1F7B0FC844206DA295D30000134FFF7C7FFE4B2F3E770BDF0B50C00002187B017000190072204A81E00039100F045FA002C04DA2D210198FFF7B2FF6442194B0093002319000822D21A974219DC009A126A94460022A44503DC60460132241AF9E7302084469444654603A8C554002A02D0002900D11900009A0133043A0092E1E703AB002901D130221A70002E02D00921C91B891B01985918FFF7ACFF07B0F0BDC046B0ED0000F0B50C0087B00DA909781600E3180CAA0500127805910193802B01DD802301936B461B790393B3180293382B01DD382302936B4637001B7A0493049B9F4210D228683A00036821005B689847039B2868591E03683A005B68C9B201379847FFB2EBE72700039B9F4210D228683900036832005B689847049B28685A1E036839005B68D2B201379847FFB2EBE7059B002B13D0019B0134E4B2013B9C420DDA771C029BFFB2013B9F42F3DA28683A00036821005B6898470137F2E707B0F0BD00001823F0B50A7A04000E0085B01A4268D10B681B68002B08D0824B01201A0066321278002A2FD005B0F0BDC3685A1CC2605B07F1D07C4B1A6801235209934343750C20FBF7ABFF7949830702D4637D002B01D000230B700B78754A0A2B05D8377A01203D00054007423DD01178002938D1012470481470802200F06BF9337A23422FD10220CFE75F331B780120002BCAD1694B1D88FA239B009D4200D9674D14220021674800F055F94D23664C02222900200023814C3BFFF7FBFE02226021624800F047F958230022290020002381563BFFF7EEFE05225D495D4800F031F90120A1E700209FE701330B701570A37D2900002B63D1637D002B59D06F20FBF74EFF7F2318402B001D2801D91E3803B20D20584380112382A07480220021454800F018F91023E65EC0234A4A5B001381002E03DD20211000FFF77FFE0323002231004448FFF7B5FE637D002B41D00F224249424800F0F5F81323414A1178013BC943DBB211700132002BF7D1A37C1C1C0D2B00D90D24E4B2AC4283D02B1C062D00D906230820002605211F22A842764169430133DBB2D21A403100932E480423D2B2C9B201960135FFF7CBFEEDB2E3E76720FBF7F4FE4008C1B2A03909B203A8FFF74BFD2000032203A9103000F0B9F8A3E703AE032230002349A77C00F0B1F8A37D002B0AD0204B3380AC231A4AFF33310010001381FFF74BFEB7E708221748092F07D91A4900F09CF83023273773703770EAE7174900F094F82023303737707370E2E7C0468406002000100640B5130020B41300208408002006040020E7030000D1060020A0130020D9060020D6D40000EB0600208C1300208AD40000A7080020A50800206AED000035390000C5D30000DDD30000104900230800104A083013605360137453820E4A28319160D360938293750C4910600C4A4A600C494A600C4A0C4953601160D360111D1374FF339160526113767047C046E0ED0000F0130020041400208C130020D4ED0000A0130020D4130020DCED0000044B054A0548834202D202CA02C3FAE77047C0468C13002034EE0000B613002070B500260C4D0D4C641BA410A64209D1002600F08BF80A4D0A4C641BA410A64205D170BDB300EB5898470136EEE7B300EB5898470136F2E728EE000028EE000028EE000030EE0000002310B59A4200D110BDCC5CC4540133F8E703008218934200D1704719700133F9E7532D6D65747220202020353900532D6D65747220206E6F726D616C00202000000000000000000000000091E5000095E50000B5E5000035E600000000000000000000BBE50000BFE50000E1E50000E5E500008D87817B756F69635D53493F35000000010000000A00000064000000E803000010270000A086010040420F008096980000E1F50590ED000048D60000041400200000000000000000E9E50000EDE90000EDE50000EFE50000F1E5000015E60000F8FFFFFF0000000005E6000025E60000F8B5C046F8BC08BC9E467047F8B5C046F8BC08BC9E46704771E5000061EC000049E5000098130020000000000000000078ED000004070020AC130020000000000000000078ED00008406002001FF");
const dataSbarOld = hexString("0448054B10B5834203D0044B002B00D0984710BD94130020941300200000000006480749091A8B10C90FC91810B5491003D0044B002B00D0984710BD94130020941300200000000010B5074C2378002B09D1FFF7D5FF054B002B02D0044800E000BF0123237010BD9413002000000000C0000000054B10B5002B03D00449054800E000BFFFF7CCFF10BDC0460000000098130020C000000070B50C4D0C4E761BB61005D0002408CD01349847A642FAD100F0F0FB074D084E761BB61005D0002408CD01349847A642FAD170BDF4ED0000F4ED0000F4ED0000FCED0000F0B5C64600B50F2A41D903270D003E0005430C0003002E402F423DD11500103D2D09A8462D01AC46844427681D001F6067685F60A7689F60E7681034DF6010336545F2D145460F230C2401352D01491913404519144222D08C59AC5104369C1B032CF9D8043B9B0801339B00ED18C91803231A40561E002A06D00023CC5C1A00EC5401339642F9D180BCB846F0BD0500561E002AF1D1F7E70500561EEDE71A00F6E7C046F0B50500830749D0541E002A45D003000326CAB202E00135013C3ED301332A703342F8D1032C30D9FF220A40150215432A0415430F2C34D92700103F3F093E01B4461E001A0010366644156055609560D5601032B242F8D101373F01DB190F270C22274022403C00002A0ED03E1FB608B400A4461A001C1D644420C2A242FCD103240136B6009B193C40002C05D0C9B21C19197001339C42FBD1F0BD03001400C0E72700E2E7C04610B583070AD00300032102E001330B4205D01A78002AF9D1181A10BD030019680C4A0D4C8A188A4322420FD15968094A04338A188A43224208D15968054A04338A188A432242F1D000E001331A78002AFBD1E1E7FFFEFEFE8080808000207047D308DB01C918E0239B00994207D807231A40063B93404068425C13434354704740684018704700207047030008003038C2B2092A05D900202D2901D15868463070470722424358688018F9E70820704707207047E02210B5002140689200FFF74BFF10BD10B5D523984710BDF7B50400002701910198FFF793FF874200D3F7BD019B6068DB19002822D01B780093036800995B68984706002068218903689B6898470500606800990368DB6898470200002D05D031002800002E0CD0FFF7CAFE606800990368DB6898472389C01820810137FFB2CEE7FFF70FFFF1E7F0B5002789B0029000920C000722390006A801930597FFF701FF3B00BC4204DA2D2205AB1A700123644219001A0000200831184F03910399009D891A8D4216DC396A8C46002102E065460131641BA445FADD3025AC468C44664605ADAE54002902D0834200D110000132043FE3E705A9834201D130230B54019B002B04D00920009BC01A019BC01A09180298FFF780FF09B0F0BD30ED0000F0B505000C0087B003930CAB019204CB019E1B7804920593049A019B944663440293B3420DD82700039BE618BE421CD8059B002B03D00134731EA3422AD807B0F0BD372E0FD82868F7B203683A0021005B689847039B2868E118036801393A005B68C9B298470136D6E77F2F10D82868FEB2036831005B68019A9847049B28685A1E019B31009A180368D2B25B6898470137C9E77F2CCED8019B5F1C029B013BBB42C8D9372F05D82868FAB20368E1B25B6898470137F1E7F0B500258C4A97B00A920C924A680B680F9210AA158101220B930CAB13930EAB1493864B0F0003901B68086984490AAE13AC0D900E9110961195258113425BD0804A1368591C11601B0727D0142229004D30FFF73BFE4D2323817B690222198820000123FFF724FF3869022260215530FFF72CFE582323817B692A00198820000223FFF715FFB9683869673105226730FF31FFF7C9FD039B1B6D9847039B0C205B6998476849800701D500230B7076680B7830008130654AFF30142B08D83224FF34345DFF2C03D0614C345D002C15D01178002910D1012313708022FFF7F6FD3223FF33F35CFF2B03D1594BF35C002B02D0039B9B69984717B0F0BD01330B70147021008022FFF7E1FDC02210AB52001A8108AD0EAA4F49119228000522FFF783FD039B67205B6998474008C0B20028E2D0A02863D96030C2B213000A33DBB200210493632B02D95A3AD3B201310022092B5BD83033303130326970EB702900AA70002510A8FFF76BFE3B4B1A78049905950135EDB28A424DD83849032207A8FFF752FD3000A430B968FF30092D4CD93000B968A4300822FF305531FFF744FD302207AB5A702B002733DBB207A90B70AC2310A8FF3303812F1CFFF741FE0D2D00D90D27FFB2231C062C00D906230820002505211F22A0426D4161430133DBB2D21A403101340093D2B20423C9B2019510A8E4B2FFF7A8FEA742E4D179E760222D235242121AD2B22B7096E701320A3BD2B2DBB29CE701330D2DA7D103220F4907A8FFF701FD0135B2E708226D31FFF7FBFC059B3133B8E708ED00000010064020ED0000BC13002090130020911300201A030000F8EC000054ED0000FDEC000010B50F4C2378002B05D100F02FF8FFF7B9FC012323700B4B19684A1C1A600A4B4B430121CB4109498B4205D8C82A03D907490848FFF7B4FE074B984710BDC046B01300208C130020CDCCCCCC9999991964ED00007CED0000C1C30000014B024A5A607047B4130020B5130020074B0849002210B50748994203D803331A1A920892000549FFF7A0FC10BDC04692130020891300208C13002000EE000067303030002020000000000000000000CDE70000D1E70000F1E7000025E800000000000000000000F7E70000FBE700001DE8000021E80000010000000A00000064000000E803000010270000A086010040420F008096980000E1F5058D87817B756F69635D53493F350000000407002048D6000070D30000B303002084060020060400207587000015D1000029D100006DBE000029AF000089A9000061B60000E1B0000011C700003587000075860000A5A6000041A50000F5A7000029010000E5AA0000FDAA0000011D000065A60000BDA70000D9B60000399C0000D5000000C1C30000F8B5C046F8BC08BC9E467047F8B5C046F8BC08BC9E467047BDE50000B9EC000091E5000001000000FF01"); //v44
const dataGraph = hexString("10B5064C2378002B07D1054B002B02D0044800E000BF0123237010BD9413002000000000C0000000044B10B5002B03D00349044800E000BF10BDC0460000000098130020C0000000002243088B4274D303098B425FD3030A8B4244D3030B8B4228D3030C8B420DD3FF22090212BA030C8B4202D31212090265D0030B8B4219D300E0090AC30B8B4201D3CB03C01A5241830B8B4201D38B03C01A5241430B8B4201D34B03C01A5241030B8B4201D30B03C01A5241C30A8B4201D3CB02C01A5241830A8B4201D38B02C01A5241430A8B4201D34B02C01A5241030A8B4201D30B02C01A5241CDD2C3098B4201D3CB01C01A524183098B4201D38B01C01A524143098B4201D34B01C01A524103098B4201D30B01C01A5241C3088B4201D3CB00C01A524183088B4201D38B00C01A524143088B4201D34B00C01A5241411A00D20146524110467047FFE701B5002000F006F802BDC0460029F7D076E770477047C04600207047D308DB015918E0239B00994207D807231A40063B93404068425C134343547047406840187047002070470A00303A0300D0B2092805D900202D2901D15868463070470720424358688018F9E70820704707207047E02210B500214068920000F060F910BD10B5F1F7DFFC10BDF8B5040040680D0000281FD003685B68984707002068218903689B6898470600606829000368DB6898470200002E05D039003000002F0BD000F034F9606829000368DB68984723891B1823810020F8BD00F031F9F2E70000F0B5594B8BB00393584B05AC0593584B002663606B469E84564B574D1B6803AF079708967D60DB0729D50C20FCF7F4F85249830700D50E700B78514A142B04D83220FF30285CFF281BD11478002C16D1012378681370813080222100FF3000F0FEF860222100474800F0F9F8464B1C703223FF33EB5CFF2B01D0FCF739FF0BB0F0BD01330B70002313706A468133FF3301AD93843D4905222800089400F0D6F86720FCF7B9F84008C0B20028E7D0A02826D920236030C4B22B7064212000FFF7AFFE30300A2168702000FFF7A9FE0A21C0B2FFF72BFF3031A97020000A21FFF725FF00263031E9702800F1F7C5FC86420CDAA95D07A80136FFF756FFF6B2F3E760246442241A2D23E4B2D5E71E4E3378203B5F2B01D92023337007235C431C4135781849201C4A19E4B2203A9C4200D9181CC0B21B1AFF201841C34313707B2D08D800232A0018001F3A8A18D0540133042BFBD178686022A130FF30013500F075F8357089E7C046ECE9000004EA000048D6000000100640040700208C1300208D130020B013002010140020DEE9000010B50D4C2378002B05D100F023F800F031F801232370094B19684A1C1A60084B4B4308498B4203D8C82A01D9FFF720FFFDF746FD10BDC0461C14002090130020EFEEEEEE11111111014B5A1C5A60704714140020044B054A0548834202D202CA02C3FAE77047C0468C13002038EA00009413002070B500260C4D0D4C641BA410A64209D1002600F045F80A4D0A4C641BA410A64205D170BDB300EB5898470136EEE7B300EB5898470136F2E72CEA00002CEA00002CEA000034EA0000002310B59A4200D110BDCC5CC4540133F8E703008218934200D1704719700133F9E76730303000000000000000000000A9E60000ADE60000CDE6000001E700000000000000000000D3E60000D7E60000F9E60000FDE60000F8B5C046F8BC08BC9E467047F8B5C046F8BC08BC9E46704771E5000049E9000049E50000FF01000001000000");
const dataSpectr = hexString("10B5064C2378002B07D1054B002B02D0044800E000BF0123237010BD9013002000000000C0000000044B10B5002B03D00349044800E000BF10BDC0460000000094130020C000000007207047082070470A00303A0300D0B2092805D900202D2901D15868463070470720424358688018F9E700207047406840187047D308DB015918E0239B00994207D807231A40063B93404068425C13434354704700207047F8B5154C05006069002820D0036829005B68984707002069218B03689B6898470600606929000368DB6898470200002E05D039003000002F0BD000F02BFA606929000368DB689847238B1B1823830020F8BD00F017FAF2E7AC130020E02210B500214068920000F00DFA10BD7FB500210400072202A8019100F004FA002C03DA2D20FFF7BDFF644200231A00134D01A800212E6AA64202DCA41B0131FAE70E0030361E54002902D0002A00D11A000133043D072BECD1002A01D129330370002485182800F1F79CFD844205DA285D0134FFF796FFE4B2F4E77FBDC04690EA000010B50400010C3920FCF72AFCA1B23820FCF726FC00213020FCF722FC30200249FCF71EFC10BDC046F1BF0000F0B5974C0023250087B04C3502932B78002B05D100F07CF900F08AF901232B70904A0B990023914206D9531C0C9AFF339A429B415B42DBB28B490A68501C0860C82A3BD9002B39D10121884D2B680B4234D0082213420DD0200093432D3001702B60834B053A1A70FCF7C0FC23002B33187004E023002D331B78002BF4D12B68217F9B0604D523002B331B780D2B19D1230000222D331A7000290FD1E022012392007448237700F067F9FCF75FFF606AFFF790FF4720218DFCF7BCFBFDF706FE07B0F0BD23002D331B78002BE4D0002912D03920FCF7DEF805003820FCF7DAF82D0480B2054347206562FCF7D3F8002120854720FCF79EFB0022210022772B310878236A01380B2800D9A7E000F0C0F89A8CA6A6A6A69F92A6A60689636A564A9B1863620024E022250000215148920000F022F901941F23E7B21C4201D07F2F02D1FF224D4B1A552300454A106A4343DB090093002C0AD0517F0223002902D113002C331B78190021408B420FD14308506AC01A009BC018FFF72CFFC8208000FEF758FC6720FCF785F84008C5B2FA236B43DB11143B5BB21E1C302B00DD3026330600D50026392376B29E1B372E06DC2B4B39001869F2B203685B68984701363A2EF3D1019B264E9D4208D9336A726A5B08D31A009A02979B18039301950134802CA8D1264D07222900264800F0CCF80023706A3383FFF7B3FE306A3483FFF7AFFE562303983383FFF7AAFE0298194BFD3007222900C01800F0B6F8FCF7A6FE4CE7636A184A7BE701226277174A9B18236277E7012215496277994292410A409B1AF5E72C342378013323706AE72C342378002B00D165E7013BF6E7627761E7AC130020E1B000008C13002000100640B303002004070020102700000408002087D3000052070020F0D8FFFF204E000002B4714649084900095C49008E4402BC7047C0460E4B0F481A0045329A640E4A18625A600D4A1800110044329A600C4A2C31DA6001229A839A851A00196000212A3008321B61198301705A617047C046AC130020A08601000407002090EA000048D6000010B5F1F773FB002010BDC04602488546FFF7F6FFFEE7000088130020044B054A0548834202D202CA02C3FAE77047C0468C13002008EB00009013002070B500260C4D0D4C641BA410A64209D1002600F055F80A4D0A4C641BA410A64205D170BDB300EB5898470136EEE7B300EB5898470136F2E7FCEA0000FCEA0000FCEA000004EB000003008218934200D1704719700133F9E7002310B59A4200D110BDCC5CC4540133F8E70000010000000A00000064000000E803000010270000A086010040420F008096980000E1F5050000000000000000E5E50000C5E50000BFE5000045E600000000000000000000BBE5000099E5000095E5000091E50000F8B5C046F8BC08BC9E467047F8B5C046F8BC08BC9E46704771E5000099E9000049E5000001000000");
const dataSpectrM = hexString("10B5064C2378002B07D1054B002B02D0044800E000BF0123237010BD8C13002000000000C0000000044B10B5002B03D00349044800E000BF10BDC0460000000090130020C000000007207047082070470A00303A0300D0B2092805D900202D2901D15868463070470720424358688018F9E700207047406840187047D308DB015918E0239B00994207D807231A40063B93404068425C1343435470470020704710B53020FCF7CCF9012401003020A143FCF796FC3020FCF7C3F90100A14330202143FCF78DFC0B4B03211A00AE33AC3210881A78002391425B419840FEF780FD6720FCF7ADF9C005C00DFF2800D9FF20C0B210BDB413002010B50400010C3920FCF76EFCA1B23820FCF76AFC3020FCF797F9040000213020FCF762FC21003020FCF75EFC10BDF0B5002789B004000D0016003900072206A80393059700F0E8FB0822944636483B0005AF0022016AA14202DC641A0132FAE73032DA5562460133D21AD2B204389542EFD90922961B751BEDB27B1918000293F1F792FDC3B21F000193002F4AD0039B264CBB420FD1230025009833A03518682988036801319B6889B29847402303702B8802332B801E4B186800282DD0019A029B9B187A429E5C036831005B6898472300983305001868A034036821889B689847134B0400186831000368DB6898470200002C05D029002000002D0FD000F093FB0A4C310023009C331868A0340368DB68984723881B182380013FB5E700F07BFBEEE709B0F0BD7CEE0000B413002050140020E02210B500214068920000F06BFB10BDF0B5C04C85B0237A002B05D100F02EFB00F03CFB01232372BB4D2B68DA0768D5BA4ABB4C1778002F3AD10822134260D093432B60B74B053A39201A70FCF7E2F806003820FCF7DEF823003604B433064347201E60FCF7D6F82300B83318804320FCF7D0F82300BA33390018804720FCF799FB230003223800AE331B7801269A427841C0B2FCF732F9230085331F7023003900C13306201E70FBF7CEFF9B4B1E7026002700B0363378B1373B70FCF756FCC0B230700D2820D19748FFF799FFFCF70DFF2300B4331868FFF7F8FE2300B83319884720FCF766FB2300BA3319884320FCF760FB01210620FBF7A6FF0023C0342370FDF7A3FD05B0F0BDFF2800D1FEE03B7898426FD122008D321378FF2B0BD10F2878D800F048FADF6AAB8577DA777CBAA477BFCD77E5EE0133137023008D331B78102BECD8220023008532AF3312781B789A4200D3F5E000210620FBF774FF10232A6826009A4323002A60B4331B68AE36009333786D4D9B00EB1800995B6D221DCB1A47200021D367FCF713FB2A003378703259008A5A7E350292EA5C8023002613413700DBB203930196039B5C4DB34200D054E12A0000232900C132843113700A780132D2B20A70290085310978B94202D30F2A00D8E0E02A00843213702B0085331F702B00009A88331A60019B86352B70D2E0FF2BA0D191E72200FA21AC32138849018B4205D2643313802300FF228C331A702300853300221A7092E72200C821AC32138849008B42F3D9643BECE72600AE363378052B15D8013303220020DBB29A424041C0B23370FCF756F82300FF2221008C331A703278334B92009B185B6DBC310B6023000122C133D1E72600AE363378002BF6D0013BDFE72200BC3213682A495B182A498B4200DD0B0027498B4200DA0B001360BCE72200BC3213682549EFE72300BC331B68002BDBD02200B432116821485B188142D4D81360D2E72300BC3319680029CDD02200B43213681A488342C7D85B1AF0E74023184A11684B40D8E72300FF2286331B78E25491E72200AF32137801335A201370FEF74FFB88E72200AF321378013BF5E723008D3382E7A81300200010064074140020B4130020B3030020441400207CEE000010270000400D0300F0D8FFFF7FA4BF070008064006200121FBF77EFE10232A6813432B60230088331868231DDA6F824208D0D867FFF7B2FD2300B83347201988FCF720FA1026FCF7F9FAFF2868D0230086331E78FFF776FD2300853318702300A055AF331B78834200D9DDE68048FFF72FFEB02238217F4B7F4C920099547F4F210022003800AE31097886327E30415C127878258A407A49D2B25118CB180221494280268818304209D1CE17881970402E00864030001E78284030431870013101330329EDD10026F3B2009323003A00AE331B787E32D35C32001A41A55CFF2D53D10136802EEFD123002200AF338C3212781B789B1A2A22934260DD13000026D31ADDB23700F31CBB425CD0230098331868F9B203682A005B6898470137F2E7013E4020F6B2FEF7A3FA002E8BD18EE7FCF784FA2B00C1331B78FF2816D0002B00D1A0E60435E86FFFF728FDFFF7FAFC2070B84203D90700EB6F01960093464B8C331A78824206D9187004E0002BE9D12378FF2BE6D1404B02990433DA6F01365218F6B2DA67013478E623008C331B78ED1A2A2D0FDD2A252A235D1BEDB2230098331868EAB2036800995B68013598472B2DF4D195E7EB43DB171D40ECE7D943C9170B409BE70436802E9BD125000023A0352B8023000222AC331100188826000123FFF7F2FC6923AE362B803378234A9B00D3180322586D110002234000FFF7E4FC20002A2388302B80062202210068273BFFF7DAFCC0239B002B8033782700164A9B00D3180422B437586D3B681100181A0123FFF7C9FC124B104A2B803378BC349B00D3180422586D3B681100C0180123FFF7BAFCCD2303229B00110020682B800223FFF7B1FCFCF7A8FCB1E5C0464414002004070020B41300207CEE00007E0200006203000002B4714649084900095C49008E4402BC7047C0461D4B10B51D4C5A1C5A6000218022200000F082F82300002284331A80230086331A70230088331A602300FF218C3319802300134994331960124B2100180090312C3008602000983001602100A0310A8022004433A432136023000B49A833196023000A49AC33196023009C331A60084BBC34236010BDC046A8130020B4130020040700207CEE000048D60000200305328038010010B5F1F77DF9002010BDC04602488546FFF7F6FFFEE7000088130020044B054A0548834202D202CA02C3FAE77047C0468C13002028EF00008C13002070B500260C4D0D4C641BA410A64209D1002600F06FF80A4D0A4C641BA410A64205D170BDB300EB5898470136EEE7B300EB5898470136F2E71CEF00001CEF00001CEF000024EF000003008218934200D1704719700133F9E7002310B59A4200D110BDCC5CC4540133F8E70000010000000A00000064000000E803000010270000A086010040420F008096980000E1F5050000000000000000E5E50000C5E50000BFE5000075E700000000000000000000BBE5000099E5000095E5000091E50000400600008813000010270000204E0000409C00008038010000710200640038017102E204C409C409C40902020202020100000000F8B5C046F8BC08BC9E467047F8B5C046F8BC08BC9E46704771E5000041ED000049E50000");
const dataMessenger = hexString("10B5064C2378002B07D1054B002B02D0044800E000BF0123237010BD8C13002000000000C0000000044B10B5002B03D00349044800E000BF10BDC0460000000090130020C000000003000222A233FF321A800023A43003707047406840187047D308DB015918E0239B00994207D807231A40063B93404068425C13434354704700207047E02210B500214068920000F0E7FA10BDF0B5B94C8DB0237D002B05D100F0AAFA00F0B8FA01232375B44D2B68DB0749D5237C012B46D13F20FCF7C0F9C021030089010B408B4203D001433F20FCF786FC0C20FCF7B3F9C30734D502200021FCF77DFC0220FCF7AAF9C3042BD504275F20FCF7A4F90490A068002809D0237B628A023B9A4204DA801804A9022200F0AEFA638A013F02339BB2FFB26382002FE6D1267BB3420ED30B202774FCF787F902002068002806D06368002B03D0D2063100D20F984701212B680B4200D1D3E00822134200D1BBE08A489343A23001702B60884B053A1A70FCF715FDC3B20293844B94331D78029BAB420ED0FF2D08D0804B90331C680A2D00D0B9E00223A33423707B4B029A94331A70794E3300A2331B78002B00D199E03300E0220021A03376489200197000F052FA330003259E331C78E4000A347F2C07DC33000833D86FEAB20368E1B25B68984701350E2DF2D100240826674B694998331A6804A8FDF7EAFF230021008022019404A80096FAF714F85F4D032342352F7880222C700121604801940096FAF708F82F70052301948022012128000096F9F7FFFF1A34544D22000835E86F002103685B689847E86F2200036801347E215B68E4B29847382CEDD100244B4D21000835E86F1A2203685B689847E86F21000368013437225B68E4B298477F2CEDD1424BA4331A78632A0BD801321A700123019307330093802200214048063BF9F7C8FF394E3500A3352F78012F00D1A7E0022F23D1334B5A7D002A00D0B2E001325A750123019307330093802200213448063BF9F7AEFF11E02C4BA2331B78002B00D045E7294BA0331978002908D101221A70E0222748920000F0B5F9FCF70FFFFDF7BDFD0DB0F0BD0D2D06D123009E331B78002B09D1A2343EE70F2D05D101239834E2795340E37137E726009836F379002B0BD0092D09D8B37930355A1CB2713268D5543268B379002108E0002D08D19C342580B3793268591CB1712021D1541BE70D2D07D1B379002B01D0013BDBB23268B371E8E70E2D15D19C3425800CE7C046A813002000100640C0130020B3030020040700203EEC0000F213002042EC000050EC000023009E331F78336803933379AB421DD1002F01D0013FFFB27079214B01306833C0B2595D707100F0C9F81D4ACBB2E9005118C9180B7E7A1CB271039A9834D3550022A3792168CA542571D3E600237371134BEA009B181B7EEDE7124C124B26606360124BA3604823237300236382FBF7F3FDFBF783FE042327742B706BE700245C75F3F7C9F9FBF7E7FD3000FBF796FE21000120FBF71EFF01232B703EE7C046CCEB0000A813002091E50000F2130020002243088B4274D303098B425FD3030A8B4244D3030B8B4228D3030C8B420DD3FF22090212BA030C8B4202D31212090265D0030B8B4219D300E0090AC30B8B4201D3CB03C01A5241830B8B4201D38B03C01A5241430B8B4201D34B03C01A5241030B8B4201D30B03C01A5241C30A8B4201D3CB02C01A5241830A8B4201D38B02C01A5241430A8B4201D34B02C01A5241030A8B4201D30B02C01A5241CDD2C3098B4201D3CB01C01A524183098B4201D38B01C01A524143098B4201D34B01C01A524103098B4201D30B01C01A5241C3088B4201D3CB00C01A524183088B4201D38B00C01A524143088B4201D34B00C01A5241411A00D20146524110467047FFE701B5002000F006F802BDC0460029F7D076E770477047C0460022174B17481A605A601A745A82164B191DC867154916480831D96719000831C867190088310A6019008C310A801900180090310B60FF219430017018009830036018009C3002601A000120A03210701A004018A232A433108019707047C046A813002004070020C0130020CCEB00003C14002010B5F1F7D5FA002010BDC04602488546FFF7F6FFFEE7000088130020044B054A0548834202D202CA02C3FAE77047C0468C13002084EC00008C13002070B500260C4D0D4C641BA410A64209D1002600F075F80A4D0A4C641BA410A64205D170BDB300EB5898470136EEE7B300EB5898470136F2E778EC000078EC000078EC000080EC000003008218934200D1704719700133F9E7002310B59A4200D110BDCC5CC4540133F8E700000000000000000000C9E50000A9E50000A3E50000CDE5000020000000000000002E2C27213F2F23246162634142430000646566444546000067686947484900006A6B6C4A4B4C00006D6E6F4D4E4F0000707172735051525374757654555600007778797A5758595A010806060606060806083E25730020203E3E205258203C3C2020200020203E3E205458203C3C202020000000F8B5C046F8BC08BC9E467047F8B5C046F8BC08BC9E46704771E50000B1EA000049E50000");
const dataPong = hexString("10B5064C2378002B07D1054B002B02D0044800E000BF0123237010BD9013002000000000C0000000044B10B5002B03D00349044800E000BF10BDC0460000000094130020C0000000002243088B4274D303098B425FD3030A8B4244D3030B8B4228D3030C8B420DD3FF22090212BA030C8B4202D31212090265D0030B8B4219D300E0090AC30B8B4201D3CB03C01A5241830B8B4201D38B03C01A5241430B8B4201D34B03C01A5241030B8B4201D30B03C01A5241C30A8B4201D3CB02C01A5241830A8B4201D38B02C01A5241430A8B4201D34B02C01A5241030A8B4201D30B02C01A5241CDD2C3098B4201D3CB01C01A524183098B4201D38B01C01A524143098B4201D34B01C01A524103098B4201D30B01C01A5241C3088B4201D3CB00C01A524183088B4201D38B00C01A524143088B4201D34B00C01A5241411A00D20146524110467047FFE701B5002000F006F802BDC0460029F7D076E770477047C04600207047D308DB015918E0239B00994207D807231A40063B93404068425C134343547047406840187047002070470A00303A0300D0B2092805D900202D2901D15868463070470720424358688018F9E70820704707207047E02210B500214068920000F0BCF910BD10B5F1F7DFFC10BDF0B50C0087B00DA909781600E3180CAA0500127805910193802B01DD802301936B461B790393B3180293382B01DD382302936B4637001B7A0493049B9F4210D228683A00036821005B689847039B2868591E03683A005B68C9B201379847FFB2EBE72700039B9F4210D228683900036832005B689847049B28685A1E036839005B68D2B201379847FFB2EBE7059B002B13D0019B0134E4B2013B9C420DDA771C029BFFB2013B9F42F3DA28683A00036821005B6898470137F2E707B0F0BDF8B5040040680D0000281FD003685B68984707002068218903689B6898470600606829000368DB6898470200002E05D039003000002F0BD000F031F9606829000368DB68984723891B1823810020F8BD00F02EF9F2E7F0B5060042363378040087B0002B00D183E0FFF75FFF484B0593FCF74BFC05000D2801D10023337064212800FFF79AFE05AE30300A2130702800FFF793FE0A21FFF716FF3031280071700A21FFF710FFEDB23031A36AB1700B2D4DD1002B01DD013BA362E369606B226AC118A36BA56A9A18E1612262002907DCAA4212DBE66BAE19B2420EDC40426063E06A814202DB606B40426063002A02DD206B824201DB5B42A363636A260001270393072310363000D2B2C9B200930197FFF717FF6B46197B1423EAB2009330000E3B0197FFF70DFF220000230832238362611C0005AD2800F1F76BFC84420FDA295D30000134FFF75BFFE4B2F2E70C2DB3D1226BE16B521A9A42AEDD0133ABE70C4A136801331360DB0503D4FCF78DFE07B0F0BDE0200023074C800019190A680433D2430A608342F8D1EFE7C04630303000AC1300200407002010B50C4C2378002B05D100F047F800F055F80123237008490A68531C0B60D20704D4C82B02D90548FFF748FFFDF710FD10BDC046F41300208C130020B01300202020114B114A40215A60114A18621A60104AE2209A60104AD961DA6000225A611A835A6216329A626A32DA6219637F3A2C39D9631B61991C5A639A6340014233C8871A707047C046B013002004070020A0EA0000B8EA000048D60000044B054A0548834202D202CA02C3FAE77047C0468C130020ECEA00009013002070B500260C4D0D4C641BA410A64209D1002600F043F80A4D0A4C641BA410A64205D170BDB300EB5898470136EEE7B300EB5898470136F2E7E0EA0000E0EA0000E0EA0000E8EA0000002310B59A4200D110BDCC5CC4540133F8E703008218934200D1704719700133F9E700000000000000000000A9E60000ADE60000CDE6000001E700000000000000000000D3E60000D7E60000F9E60000FDE60000F8B5C046F8BC08BC9E467047F8B5C046F8BC08BC9E46704771E50000B1E9000049E5000001000000");
const offset = 0xe548;
if (this.selectSbar.checked) {
firmwareData = replaceSection(firmwareData, hexString("6DE6000002000000030000000400000005000000060000000700000008000000090000000A0000000B0000000C0000000D0000000E00000055E7"), 0x0004);
firmwareData = replaceSection(firmwareData, dataSbar, offset);
log(`Успешно применён: ${this.name}. Добавлен S-метр. Использовано ${dataSbar.length/2} байт(а) дополнительно.`);
}
if (this.selectSbarOld.checked) {
firmwareData = replaceSection(firmwareData, hexString("35E8000002000000030000000400000005000000060000000700000008000000090000000A0000000B0000000C0000000D0000000E0000005DEC"), 0x0004); //v44
firmwareData = replaceSection(firmwareData, dataSbarOld, firmwareData.length);
log(`Успешно применён: ${this.name}. Добавлен S-метр v44. Использовано ${dataSbar.length/2} байт(а) дополнительно.`);
}
else if (this.selectGraph.checked) {
firmwareData = replaceSection(firmwareData, hexString("11E7000002000000030000000400000005000000060000000700000008000000090000000A0000000B0000000C0000000D0000000E00000001E9"), 0x0004);
firmwareData = replaceSection(firmwareData, dataGraph, offset);
log(`Успешно применён: ${this.name}. Добавлена шкала. Использовано ${dataGraph.length/2} байт(а) дополнительно.`);
}
else if (this.selectSpectr.checked) {
firmwareData = replaceSection(firmwareData, hexString("F5E9000002000000030000000400000005000000060000000700000008000000090000000A0000000B0000000C0000000D0000000E000000F5E6"), 0x0004);
firmwareData = replaceSection(firmwareData, dataSpectr, offset);
log(`Успешно применён: ${this.name}. Добавлен спектроанализатор. Использовано ${dataSpectr.length/2} байт(а) дополнительно.`);
}
else if (this.selectSpectrM.checked) {
firmwareData = replaceSection(firmwareData, hexString("E1ED000002000000030000000400000005000000060000000700000008000000090000000A0000000B0000000C0000000D0000000E00000085E7"), 0x0004);
firmwareData = replaceSection(firmwareData, dataSpectrM, offset);
log(`Успешно применён: ${this.name}. Добавлен спектроанализатор от Михаила. Использовано ${dataSpectrM.length/2} байт(а) дополнительно.`);
}
else if (this.selectMessenger.checked) {
firmwareData = replaceSection(firmwareData, hexString("31EB000002000000030000000400000005000000060000000700000008000000090000000A0000000B0000000C0000000D0000000E000000DDE5"), 0x0004);
firmwareData = replaceSection(firmwareData, dataMessenger, offset);
log(`Успешно применён: ${this.name}. Добавлен чат. Использовано ${dataMessenger.length/2} байт(а) дополнительно.`);
}
else if (this.selectPong.checked) {
firmwareData = replaceSection(firmwareData, hexString("11E7000002000000030000000400000005000000060000000700000008000000090000000A0000000B0000000C0000000D0000000E00000071E9"), 0x0004);
firmwareData = replaceSection(firmwareData, dataPong, offset);
log(`Успешно применён: ${this.name}. Добавлен пинпонг. Использовано ${dataPong.length/2} байт(а) дополнительно.`);
}
return firmwareData;
}
}
,
class Mod_APP_Advanced extends FirmwareMod {
constructor() {
super("Приложения (дополнительно)", "ВАЖНО! Только одно приложение может быть установлено - либо из этого мода с приложениями, либо из первого. Добавляет приложение из списка на выбор:", "зависит от модификации");
this.hidden = true;
this.selectAMTX = addRadioButton(this.modSpecificDiv, "AM TX. Передаёт только тон ~1.9 кГц. Для тестирования. By @manujedi, v9-git.", "selectAMTX", "selectApp");
}
apply(firmwareData) {
const dataAMTX = hexString("0448054B10B5834203D0044B002B00D0984710BD8C1300208C1300200000000006480749091A8B10C90FC91810B5491003D0044B002B00D0984710BD8C1300208C1300200000000010B5074C2378002B09D1FFF7D5FF054B002B02D0044800E000BF0123237010BD8C13002000000000C0000000054B10B5002B03D00449054800E000BFFFF7CCFF10BDC0460000000090130020C000000070B50C4D0C4E761BB61005D0002408CD01349847A642FAD100F070FA074D084E761BB61005D0002408CD01349847A642FAD170BDF4EA0000F4EA0000F4EA0000FCEA0000F0B5C64600B50F2A41D903270D003E0005430C0003002E402F423DD11500103D2D09A8462D01AC46844427681D001F6067685F60A7689F60E7681034DF6010336545F2D145460F230C2401352D01491913404519144222D08C59AC5104369C1B032CF9D8043B9B0801339B00ED18C91803231A40561E002A06D00023CC5C1A00EC5401339642F9D180BCB846F0BD0500561E002AF1D1F7E70500561EEDE71A00F6E7C046F0B50500830749D0541E002A45D003000326CAB202E00135013C3ED301332A703342F8D1032C30D9FF220A40150215432A0415430F2C34D92700103F3F093E01B4461E001A0010366644156055609560D5601032B242F8D101373F01DB190F270C22274022403C00002A0ED03E1FB608B400A4461A001C1D644420C2A242FCD103240136B6009B193C40002C05D0C9B21C19197001339C42FBD1F0BD03001400C0E72700E2E7C046704770470822F8B51B4E040033680D00007A13422DD0012193433360174B053A41401A7021721ED0022200211448FFF793FF144B0C22180013491F00FFF73AFF002239780132C943D2B2397001370E2AF7D133689B060AD4012323762B681A6862601C6003E00E220648FFF775FF012001E00028D8D1F8BD00100640B303002090060020840600204FD40000F0B50A7A0823150004000E0089B01D401A4270D13020FCF7B9F880076BD5237E002B12D025764020FCF7B0F8334901404020FCF77BFB3920FCF7A8F805003820FCF7A4F82D04054365616420FCF79EF80A21638982B29B1AA28123616281694402A8FBF7A1FA6B46002508271A89244903A8FDF74FFF2B007F22290003A801950097F9F779FF6B461E495A8903A8FDF741FF022303A87F22290001950097F9F76BFF194B02201B689B0625D564693730210CFCF73BFBA1B23820FCF737FB3020FCF764F8040029003020FCF72FFB21003020FCF72BFB4020FCF758F88021490101434020FCF722FB32681368AB4202D0596811605D60002009B0F0BDFFEFFFFFA4EA0000B2EA00000010064010B5F1F7E3FB10BDC168F8B501310400C160C72927D93223324DFF33E85C0122FF3843425841237C93430343100023742D4B1B689843C3002C48285C04258000284003432A480068400A8243AA401C201343227C824313432374490704D000256668AE4208D1F8BD23681868002821D166680500002EF6D0237C1B0711D4FCF7ABFB227EC7B297420BD061694868FF2A22D1002804D03A00036808319B68984727762100336830001B68083198470543EDB208E02100036808315B68984766680500002ED8D1AB0701D5FCF745FEED07C9D5FCF77DFEC6E70028E1D003680831DB68DCE704070020001006401A0300000008064010B5084C2378002B05D100F035F8FFF7E9FD012323700448FFF77CFFFDF7D2FC10BDC046A8130020AC13002000230C4A0C491360136153600B4A1160936093811361536113760949094A116009495360D3601374FF339160526113767047C046E4130020C8EA0000C8130020D8EA0000AC130020B0130020074B0849002210B50748994203D803331A1A920892000549FFF7CAFD10BDC0468C130020891300208C13002000EB0000696E20313A202530356920202000696E20323A2025303569202020000000000000000000FDE7000075E7000071E7000073E70000C8130020F8B5C046F8BC08BC9E467047F8B5C046F8BC08BC9E467047BDE5000029EA000091E50000");
const offset = 0xe548;
if (this.selectAMTX.checked) {
firmwareData = replaceSection(firmwareData, hexString("09E9000002000000030000000400000005000000060000000700000008000000090000000A0000000B0000000C0000000D0000000E000000FDE9"), 0x0004);
firmwareData = replaceSection(firmwareData, dataAMTX, offset);
log(`Успешно применён: ${this.name}. Добавлен AM TX. Использовано ${dataAMTX.length/2} байт(а) дополнительно.`);
}
return firmwareData;
}
}
,
*/
class Mod_BatteryIcon extends FirmwareMod {
constructor() {
super("Значок батареи", "Исправляет иконку заряда батареи.", 0);
}
apply(firmwareData) {
const offset = 0xD3BC + 134;
const oldData = hexString("3e227f4141414141414141414141414163003e227f415d5d4141414141414141414163003e227f415d5d415d5d4141414141414163003e227f415d5d415d5d415d5d4141414163003e227f415d5d415d5d415d5d415d5d4163");
const newData = hexString("3e2263414141414141414141414141417f003e2263414141414141414141415d5d4163003e2263414141414141415d5d415d5d417f003e2263414141415d5d415d5d415d5d417f003e2263415d5d415d5d415d5d415d5d417f");
if (compareSection(firmwareData, oldData, offset)) {
firmwareData = replaceSection(firmwareData, newData, offset);
log(`Успешно применён: ${this.name}.`);
}
else {
log(`Ошибка применения ${this.name}: Неожиданные данные! Патч либо уже был применён, либо несовместимая версия прошивки.`);
}
return firmwareData;
}
}
,
class Mod_ChangeContrast extends FirmwareMod {
constructor() {
super("Контраст LCD", "Изменяет контраст LCD на любое значение от 0 до 63 (больше - темнее). Значение по умолчанию 31", 0);
//this.contrastValue = addInputField(this.modSpecificDiv, ["Новое значение контраста, в диапазоне 0-63:"], "31");
const contrastValueDiv = document.createElement("div");
contrastValueDiv.classList.add("form-group");
this.contrastValueInput = document.createElement("input");
//this.contrastValueInput.id = "contrastValue";
this.contrastValueInput.className = "form-control-range";
this.contrastValueInput.type = "range";
this.contrastValueInput.min = "0";
this.contrastValueInput.max = "63";
this.contrastValueInput.value = "31";
this.contrastValueLabel = document.createElement("label");
this.contrastValueLabel.innerText = "Новое значение контраста:";
this.contrastValueText = document.createElement("span");
this.contrastValueText.id = "contrastValueText";
this.contrastValueText.innerText = this.contrastValueInput.value;
contrastValueDiv.appendChild(this.contrastValueLabel);
contrastValueDiv.appendChild(this.contrastValueInput);
contrastValueDiv.appendChild(this.contrastValueText);
this.modSpecificDiv.appendChild(contrastValueDiv);
this.contrastValueInput.oninput = () => {
this.contrastValueText.innerText = this.contrastValueInput.value;
}
}
apply(firmwareData) {
const offset = 0xb820;
const minValue = 0;
const maxValue = 63;
const inputValue = parseInt(this.contrastValueInput.value);
if (!isNaN(inputValue) && inputValue >= minValue && inputValue <= maxValue) {
const newData = new Uint8Array([inputValue]);
firmwareData = replaceSection(firmwareData, newData, offset);
log(`Успешно применён: ${this.name}.`);
}
else {
log(`Ошибка применения ${this.name}: Значение контраста должно быть числом в диапазоне 0-63!`);
}
return firmwareData;
}
}
,
class Mod_NegativeDisplay extends FirmwareMod {
constructor() {
super("Экран в негативе", "Инвертирует цвета экрана.", 0);
}
apply(firmwareData) {
const offset = 0xb808;
const oldData = hexString("a6");
const newData = hexString("a7");
if (compareSection(firmwareData, oldData, offset)) {
firmwareData = replaceSection(firmwareData, newData, offset);
log(`Успешно применён: ${this.name}.`);
}
else {
log(`Ошибка применения ${this.name}: Неожиданные данные! Патч либо уже был применён, либо несовместимая версия прошивки.`);
}
return firmwareData;
}
}
,
class Mod_FontBigDigits extends FirmwareMod {
constructor() {
super("Модифицированный шрифт (большие цифры)", "Заменяет шрифт на один из выбранных: ", 0);
const fontPreviewDiv = document.createElement("div");
fontPreviewDiv.classList.add("mt-2");
this.previewCanvas = document.createElement("canvas");
this.previewCanvas.classList.add("mr-3", "border", "shadow-sm");
this.previewCanvas.width = 143;
this.previewCanvas.height = 16;
fontPreviewDiv.appendChild(this.previewCanvas);
this.modSpecificDiv.appendChild(fontPreviewDiv);
this.selectVCR = addRadioButton(this.modSpecificDiv, "Шрифт как в старых видеомагнитофонах/телевизорах", "selectVCRBigDigits", "selectFontBigDigits");
this.selectVCR.value = "0000F8FC0E0686C6E66EFCF80000001F3F7667636160703F1F0000000000181CFEFE00000000000000000060607F7F60600000000000181C8E86868686CEFC780000007E7F6361616161616060000000181C0E06868686CEFC7800000018387060616161733F1E00000080C0E070381CFEFE00000000000707060606067F7F06060000007E7E6666666666E6C68600000018387060606060703F1F000000F8FC8E868686868E1C180000001F3F7161616161733F1E000000060606060686C6E67E3E000000000000007F7F0100000000000078FCCE86868686CEFC780000001E3F7361616161733F1E00000078FCCE868686868EFCF800000018387161616161713F1F000000008080808080808080000000000001010101010101010000";
this.selectFuturistic = addRadioButton(this.modSpecificDiv, "Футуристичный шрифт (от DO7OO)", "selectFuturisticBigDigits", "selectFontBigDigits");
this.selectFuturistic.value = "00FEFF01010101018181FFFF00007F7F40404040407F7F7F7F000000000000008080FFFF0000000000000000007F7F7F7F00000000018181818181818181FFFE00007F7F7F7F404040404040400000818181818181818181FFFE0000404040404040407F7F7F7F00007FFF80808080808080FFFF0000000000000000007F7F7F7F0000FEFF8181818181818181810000404040404040407F7F7F7F0000FEFF81818181818181818100007F7F7F7F40404040407F7F0000010101010101018181FFFE0000000000000000007F7F7F7F0000FEFF81818181818181FFFF00007F7F40404040407F7F7F7F0000FEFF81818181818181FFFF0000000000000000007F7F7F7F000000808080808080808080000000000303030303030303030000";
this.selectTerminus = addRadioButton(this.modSpecificDiv, "Шрифт Terminus от @mbg", "selectTerminusBigDigits", "selectFontBigDigits");
this.selectTerminus.value = "0000FCFEFE0686C6E6FEFEFC0000003F7F7F676361607F7F3F0000000000181CFEFEFE000000000000000060607F7F7F6060000000001C1E1E06060686FEFE7C0000006070787C6E67636160600000000C0E0E86868686FEFE7C000000307070616161617F7F3E00000080C0E070381C0EFEFEFE0000000F0F0F0C0C0C0C7F7F7F000000FEFEFEC6C6C6C6C6C686000000307070606060607F7F3F000000F8FCFEC6C6C6C6C6C6800000003F7F7F606060607F7F3F0000000E0E0E060686E6FE7E1E000000000000007C7F7F0300000000007CFEFE86868686FEFE7C0000003F7F7F616161617F7F3F000000FCFEFE06060606FEFEFC000000016363636363637F3F1F000000008080808080808080000000000001010101010101010000";
this.selectCustom = addRadioButton(this.modSpecificDiv, "Свой шрифт", "selectCustomBigDigits", "selectFontBigDigits");
this.selectCustom.value = "00C0F0F83C0C0C0C0C1CF8F0E000071F3F7860606060703F1F0F000000003030FCFCFC000000000000000000007F7F7F00000000001038381C0C0C0C0CFCF8F0000070787C7C6E66676763616000001018189C8C8C8C8CCCF8F870003030307161616161713F3F1E0000000080C0E07038FCFCFC00001C1E1F1F191818187F7F7F180000FCFCCCCCCCCCCCCCCC8C0C000018307060606060717B3F1F00C0F0F8389C8C8C8C8C9C3830000F1F3F736161616173333F1E000C0C0C0C0C0C0C8CECFC3C1C0000004060787C1F0703000000000078F8DC8C8C8C8CDCF87800001E3F3F7361616161733F3F1E00F0F8B81C0C0C0C0C1CB8F0E0001133776766666676333F1F070000808080808080808080000000000303030303030303030000";
const customFontCardDiv = document.createElement("div");
customFontCardDiv.classList.add("d-none", "card", "md-3");
const customFontDiv = document.createElement("div");
customFontDiv.classList.add("card-body");
const explanationCustomFontFile = document.createElement("p");
explanationCustomFontFile.innerText = "Выберите файл изображения со шрифтом, размер картинки в идеале 143 на 16 пикселей. Если у вас нет картинки - можете воспользоваться полем для ввода шестнадцатиричного кода шрифта вручную.";
customFontDiv.appendChild(explanationCustomFontFile);
const fileInputDiv = document.createElement("div");
fileInputDiv.classList.add("custom-file", "mt-2");
this.customFileInput = document.createElement("input");
this.customFileInput.className = "custom-file-input";
this.customFileInput.type = "file";
this.customFileInput.accept = "image/bmp,image/jpeg,image/png";
this.customFileLabel = document.createElement("label");
this.customFileLabel.className = "custom-file-label";
this.customFileLabel.dataset.browse = "Обзор";
this.customFileLabel.innerText = "Выберите картинку";
this.customFileLabel.for = "customFileInput";
fileInputDiv.appendChild(this.customFileInput);
fileInputDiv.appendChild(this.customFileLabel);
this.canvas = document.createElement("canvas");
this.canvas.classList.add("mt-3", "mr-3", "border", "shadow-sm");
this.canvas.width = 143;
this.canvas.height = 16;
this.canvas2 = this.canvas.cloneNode();
fileInputDiv.appendChild(this.canvas);
fileInputDiv.appendChild(this.canvas2);
customFontDiv.appendChild(fileInputDiv);
const explanationCustomFontText = document.createElement("p");
explanationCustomFontText.innerText = "Итоговый код шрифта в виде шестнадцатиричной строки. По умолчанию здесь код стандартного шрифта. При ручной вставке символы \"\\x\", при наличии, будут удалены автоматически.";
customFontDiv.appendChild(explanationCustomFontText);
this.customFontData = document.createElement("textarea");
this.customFontData.classList.add("w-100", "form-control");
this.customFontData.rows = 8;
// this.customFontData.maxLength = 572;
this.customFontData.placeholder = "Тут должен быть шестнадцатиричный код шрифта, перезагрузите страницу, чтобы сбросить!";
this.customFontData.value = this.selectCustom.value;
customFontDiv.appendChild(this.customFontData);
customFontCardDiv.appendChild(customFontDiv);
this.modSpecificDiv.appendChild(customFontCardDiv);
this.customFileInput.addEventListener("change", (event) => {
const file = this.customFileInput.files[0];
this.customFileLabel.textContent = file.name;
const reader = new FileReader();
reader.onload = () => {
const img = new Image();
img.onload = () => {
const canvas = this.canvas;
const ctx = canvas.getContext('2d');
ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height).data;
function getPixel(x, y) {
const index = y * canvas.width + x;
const i = index * 4;
return imageData[i] + imageData[i + 1] + imageData[i + 2] > 128 * 3 ? 0 : 1;
}
// run canvas content through getPixel and output to canvas2
const canvas2 = this.canvas2;
const ctx2 = canvas2.getContext('2d');
const imageData2 = ctx2.getImageData(0, 0, canvas2.width, canvas2.height);
for (let y = 0; y < canvas2.height; y++) {
for (let x = 0; x < canvas2.width; x++) {
const index = y * canvas2.width + x;
const i = index * 4;
const pixel = !getPixel(x, y);
imageData2.data[i] = pixel * 255;
imageData2.data[i + 1] = pixel * 255;
imageData2.data[i + 2] = pixel * 255;
imageData2.data[i + 3] = 255;
}
}
ctx2.putImageData(imageData2, 0, 0);
const outputArray = new Uint8Array((canvas2.width * canvas2.height)/8);
let j = 0;
for (let xs = 0; xs < canvas2.width; xs += 13) {
let y = 0;
for (let x = xs; x < (xs + 13); x++) {
let byte = 0;
for (let i = 0; i < 8; i++) {
byte |= getPixel(x, y + i) << i;
}
outputArray[j++] = byte;
}
y = 8;
for (let x = xs; x < (xs + 13); x++) {
let byte = 0;
for (let i = 0; i < 8; i++) {
byte |= getPixel(x, y + i) << i;
}
outputArray[j++] = byte;
}
}
this.customFontData.value = uint8ArrayToHexString(outputArray).toUpperCase();
this.selectCustom.value = this.customFontData.value;
drawFont(this.previewCanvas, font8to16(hexString(this.selectCustom.value), 13));
};
img.src = reader.result;
};
reader.readAsDataURL(file);
});
this.customFontData.addEventListener("input", (event) => {
const reg = /\\x/g;
this.selectCustom.value = event.target.value.replace(reg, "");
event.target.value = this.selectCustom.value;
drawFont(this.previewCanvas, font8to16(hexString(this.selectCustom.value), 13));
});
this.selectCustom.parentElement.parentElement.addEventListener("change", (event) => {
customFontCardDiv.classList.toggle("d-none", !this.selectCustom.checked);
if (event.target.name == "selectFontBigDigits") {
drawFont(this.previewCanvas, font8to16(hexString(event.target.value), 13));
}
});
this.selectTerminus.checked = true;
drawFont(this.previewCanvas, font8to16(hexString(this.selectTerminus.value), 13));
}
apply(firmwareData) {
const offset = 0xd576;
if (this.selectVCR.checked) {
firmwareData = replaceSection(firmwareData, hexString(this.selectVCR.value), offset);
}
else if (this.selectFuturistic.checked) {
firmwareData = replaceSection(firmwareData, hexString(this.selectFuturistic.value), offset);
}
else if (this.selectTerminus.checked) {
firmwareData = replaceSection(firmwareData, hexString(this.selectTerminus.value), offset);
}
else if (this.selectCustom.checked) {
firmwareData = replaceSection(firmwareData, hexString(this.selectCustom.value), offset);
}
log(`Успешно применён: ${this.name}.`);
return firmwareData;
}
}
,
class Mod_FontSmallDigits extends FirmwareMod {
constructor() {
super("Модифицированный шрифт (маленькие цифры)", "Заменяет шрифт на один из выбранных: ", 0);
const fontPreviewDiv = document.createElement("div");
fontPreviewDiv.classList.add("mt-2");
this.previewCanvas = document.createElement("canvas");
this.previewCanvas.classList.add("mr-3", "border", "shadow-sm");
this.previewCanvas.width = 84;
this.previewCanvas.height = 8;
fontPreviewDiv.appendChild(this.previewCanvas);
this.modSpecificDiv.appendChild(fontPreviewDiv);
this.selectFuturistic = addRadioButton(this.modSpecificDiv, "Футуристичный шрифт (от DO7OO)", "selectFuturisticSmallDigits", "selectFontSmallDigits");
this.selectFuturistic.value = "007E414141797F00000000787F000079794949494E0049494949797E0007080808787F004E4949497979007E79494949790001010101797E007E494949797F000E090909797F0008080808080000000000000000";
this.selectTerminus = addRadioButton(this.modSpecificDiv, "Шрифт Terminus от @mbg", "selectTerminusSmallDigits", "selectFontSmallDigits");
this.selectTerminus.value = "003E5149453E000000427F400000004661514946000022414949360000181412117F0000274545453900003E45454538000001016119070000364949493600000E5151513E000808080808000000000000000000";
this.selectCustom = addRadioButton(this.modSpecificDiv, "Свой шрифт", "selectCustomSmallDigits", "selectFontSmallDigits");
this.selectCustom.value = "003E414141413E0000427F4000000062515149494600224149494D3200181412117F1000274545454539003E494949493000017109050300003649494949360046494949291E0008080808080000000000000000";
const customFontCardDiv = document.createElement("div");
customFontCardDiv.classList.add("d-none", "card", "md-3");
const customFontDiv = document.createElement("div");
customFontDiv.classList.add("card-body");
const explanationCustomFontFile = document.createElement("p");
explanationCustomFontFile.innerText = "Выберите файл изображения со шрифтом, размер картинки в идеале 84 на 8 пикселей. Если у вас нет картинки - можете воспользоваться полем для ввода шестнадцатиричного кода шрифта вручную.";
customFontDiv.appendChild(explanationCustomFontFile);
const fileInputDiv = document.createElement("div");
fileInputDiv.classList.add("custom-file", "mt-2");
this.customFileInput = document.createElement("input");
this.customFileInput.className = "custom-file-input";
this.customFileInput.type = "file";
this.customFileInput.accept = "image/bmp,image/jpeg,image/png";
this.customFileLabel = document.createElement("label");
this.customFileLabel.className = "custom-file-label";
this.customFileLabel.dataset.browse = "Обзор";
this.customFileLabel.innerText = "Выберите картинку";
this.customFileLabel.for = "customFileInput";
fileInputDiv.appendChild(this.customFileInput);
fileInputDiv.appendChild(this.customFileLabel);
this.canvas = document.createElement("canvas");
this.canvas.classList.add("mt-3", "mr-3", "border", "shadow-sm");
this.canvas.width = 84;
this.canvas.height = 8;
this.canvas2 = this.canvas.cloneNode();
fileInputDiv.appendChild(this.canvas);
fileInputDiv.appendChild(this.canvas2);
customFontDiv.appendChild(fileInputDiv);
const explanationCustomFontText = document.createElement("p");
explanationCustomFontText.innerText = "Итоговый код шрифта в виде шестнадцатиричной строки. По умолчанию здесь код стандартного шрифта. При ручной вставке символы \"\\x\", при наличии, будут удалены автоматически.";
customFontDiv.appendChild(explanationCustomFontText);
this.customFontData = document.createElement("textarea");
this.customFontData.classList.add("w-100", "form-control");
this.customFontData.rows = 3;
// this.customFontData.maxLength = 168;
this.customFontData.placeholder = "Тут должен быть шестнадцатиричный код шрифта, перезагрузите страницу, чтобы сбросить!";
this.customFontData.value = this.selectCustom.value;
customFontDiv.appendChild(this.customFontData);
customFontCardDiv.appendChild(customFontDiv);
this.modSpecificDiv.appendChild(customFontCardDiv);
this.customFileInput.addEventListener("change", (event) => {
const file = this.customFileInput.files[0];
this.customFileLabel.textContent = file.name;
const reader = new FileReader();
reader.onload = () => {
const img = new Image();
img.onload = () => {
const canvas = this.canvas;
const ctx = canvas.getContext('2d');
ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height).data;
function getPixel(x, y) {
const index = y * canvas.width + x;
const i = index * 4;
return imageData[i] + imageData[i + 1] + imageData[i + 2] > 128 * 3 ? 0 : 1;
}
// run canvas content through getPixel and output to canvas2
const canvas2 = this.canvas2;
const ctx2 = canvas2.getContext('2d');
const imageData2 = ctx2.getImageData(0, 0, canvas2.width, canvas2.height);
for (let y = 0; y < canvas2.height; y++) {
for (let x = 0; x < canvas2.width; x++) {
const index = y * canvas2.width + x;
const i = index * 4;
const pixel = !getPixel(x, y);
imageData2.data[i] = pixel * 255;
imageData2.data[i + 1] = pixel * 255;
imageData2.data[i + 2] = pixel * 255;
imageData2.data[i + 3] = 255;
}
}
ctx2.putImageData(imageData2, 0, 0);
const outputArray = new Uint8Array((canvas2.width * canvas2.height)/8);
let j = 0;
for (let x = 0; x < canvas2.width; x++) {
let byte = 0;
for (let i = 0; i < 8; i++) {
byte |= getPixel(x, i) << i;
}
outputArray[j++] = byte;
}
this.customFontData.value = uint8ArrayToHexString(outputArray).toUpperCase();
this.selectCustom.value = this.customFontData.value;
drawFont(this.previewCanvas, hexString(this.selectCustom.value));
};
img.src = reader.result;
};
reader.readAsDataURL(file);
});
this.customFontData.addEventListener("input", (event) => {
const reg = /\\x/g;
this.selectCustom.value = event.target.value.replace(reg, "");
event.target.value = this.selectCustom.value;
drawFont(this.previewCanvas, hexString(this.selectCustom.value));
});
this.selectCustom.parentElement.parentElement.addEventListener("change", (event) => {
customFontCardDiv.classList.toggle("d-none", !this.selectCustom.checked);
if (event.target.name == "selectFontSmallDigits") {
drawFont(this.previewCanvas, hexString(event.target.value));
}
});
this.selectTerminus.checked = true;
drawFont(this.previewCanvas, hexString(this.selectTerminus.value));
}
apply(firmwareData) {
const offset = 0xd694;
if (this.selectFuturistic.checked) {
firmwareData = replaceSection(firmwareData, hexString(this.selectFuturistic.value), offset);
}
else if (this.selectTerminus.checked) {
firmwareData = replaceSection(firmwareData, hexString(this.selectTerminus.value), offset);
}
else if (this.selectCustom.checked) {
firmwareData = replaceSection(firmwareData, hexString(this.selectCustom.value), offset);
}
log(`Успешно применён: ${this.name}.`);
return firmwareData;
}
}
,
class Mod_FontLetters extends FirmwareMod {
constructor() {
super("Модифицированный шрифт (буквы)", "Заменяет шрифт на один из выбранных: ", 0);
const fontPreviewDiv = document.createElement("div");
fontPreviewDiv.classList.add("mt-2");
this.previewCanvas = document.createElement("canvas");
this.previewCanvas.classList.add("mr-3", "border", "shadow-sm");
this.previewCanvas.width = 760;
this.previewCanvas.height = 16;
fontPreviewDiv.appendChild(this.previewCanvas);
this.modSpecificDiv.appendChild(fontPreviewDiv);
this.selectTunas1337 = addRadioButton(this.modSpecificDiv, "Шрифт от Tunas1337", "selectTunas1337Letters", "selectFontLetters");
this.selectTunas1337.value = "00000000000000000000000000000000000000FCFC0000000000000D0D00000000007C00007C0C0000000000000000000020E03820F8200000010F0109070100000070C88E88100000040C08380907007088887800C0B00000040200070808000080FCC43C000000000708090B0607000000063E000000000000000000000000000000E0100C0000000000071820000000000418F0000000000060300F00000000404080F0404000000002010003000000808080F0808000000000000700000000000000000000000000004C3C0800000080808080808000000000000000000000000000000000000000000C0C00000000000000C03804000000380601000000E018C8C808F0000007081111180F0000001008F8000000001010101F10100000001008080818F00000101814121110000010080808D830000008101111120E000000C0E010F8000000060504041F04000000F8C8C8C808000008101010180F0000E010C8C8C808000007091010100F0000080808C8E818000000001C070000000000F8080808F000000E111111110E0000F018080818F0000001131212190F0000000060600000000000000C0C00000000000060600000000000004C3C0800000000C020201008000000000101020400002020202020200000010101010101000008103020C0C000000402020100000000000C84C42C18000000000D0C000000E01008888890E0000F1023242422070000C03818E00000001C030202030F1000F8F88888887000001F1F1010100F0600E030080808180000070C101010180800F80808081870C0001F101010180E030000F8888888880000001F10101010000000F8888888880800001F000000000000E03008080818000007081010111F0000F880808080F800001F000000001F000000000808F8080000000010101F1000000008080808F8000008181010180F0000F8F880C0301800001F1F0101030C100000F8000000000000001F101010101000F8788000E0F800001F000303001F0000F818E08000F800001F0000030C1F0000E01808081870C00007181010180E0300F8F8080808F060001F1F010101000000E01808081870C00007181030504E4300F8F8080808F000001F1F01030718000020F888880810000008181011110F0400080808F8080808000000001F00000000F800000000F8000007181010180F000038E000008078080000031E1807000000F80080C00000F8001F1807011E1F01000830C08070180000100C0301061800000018608000C03800000000011F000000080808C868180000181C1311101010000000F8080808000000007F40404000000038C000000000000000010638400000080808F8000000004040407F0000000000807030C00000000001000000010000000000000000000040404040404040000000081000000000000000000000000000404040408000000C121212121F0000F8804040408000001F081010100F02000080404040400000070810101010000080C0404080F800000F181010081F000000804040408000000F0A1212121302004040E0F84848000000001F1F0000000000C04040C04040006997949492D16000F880404040C000001F000000001F0000004040D8D80000000000001F1F0000000000404040D8D8000000808080FF3F00F8F80000804000001F1F020304181000000008F8000000000000001F10100000C0404080404080001F00001F00001F0000C080404040C000001F000000001F0080C04040408000000F181010100F0200C080404040800000FF081010100F020080C0404040C000000F18101008FF000000C0804040400000001F01000000000080C040404000000008111212120C00004040F0404040000000000F1010101000C000000000C000000F181010081F0000C000000000C0000000031C18060100C0800000800000C0001F1807031C1C030040C0000080400000100807070D100000C000000000C0400080834C300E01000040404040C0C000001018161311100000000000F8080800000002037D40400000000000FC00000000000000FF00000000080808F8000000004040407F0000000000808000008000000100000101010000";
this.selectTerminus = addRadioButton(this.modSpecificDiv, "Шрифт Terminus от @mbg", "selectTerminusLetters", "selectFontLetters");
this.selectTerminus.value = "00000000000000000000000000000000000000F8F80000000000001B1B000000001E3E00003E1E00000000000000000040F0F040F0F04000041F1F041F1F0400E0F0101C1C30200008191171711F0E006060000080C06000180C06030118180000B0F8C878B080000F1F10110F1F100000203E1E0000000000000000000000000000E0F0180800000000070F1810000000000818F0E00000000010180F070000000040C080C040000001050703070501000000C0C0000000000101070701010000000000000000000000203C1C00000000000000000000000101010101010100000000000000000000000018180000000000000080C06000180C060301000000F0F80888C8F8F0000F1F1311101F0F00002030F8F80000000010101F1F1010003038080888F87000181C1613111010003038888888F870000C1C1010101F0F000080C06030F8F80003030202021F1F00F8F888888888080008181010101F0F00E0F09888888800000F1F1010101F0F0008080808C8F8380000001C1F0300000070F8888888F870000F1F1010101F0F00F0F8080808F8F00000111111190F070000000060600000000000000C0C00000000000060600000000000101C0C000000000080C060301000000103060C1810008080808080808000040404040404040000103060C08000000010180C060301007078080888F870000000001B1B000000E0F0109090F0E0000F1F101717170300F0F8080808F8F0001F1F0101011F1F00F8F8888888F870001F1F1010101F0F00F0F80808083830000F1F1010101C0C00F8F8080818F0E0001F1F1010180F0700F8F88888880808001F1F101010101000F8F88888880808001F1F000000000000F0F80808083830000F1F1011111F0F00F8F8808080F8F8001F1F0000001F1F00000008F8F80800000000101F1F10000000000008F8F808000C1C10101F0F0000F8F8C060301808001F1F03060C181000F8F80000000000001F1F101010101000F8F830E030F8F8001F1F0000001F1F00F8F8C08000F8F8001F1F0001031F1F00F0F8080808F8F0000F1F1010101F0F00F8F8080808F8F0001F1F010101010000F0F8080808F8F0000F1F1018183F2F00F8F8080808F8F0001F1F03070D19100070F88888889810000C1C1010101F0F00000808F8F80808000000001F1F000000F8F8000000F8F8000F1F1010101F0F00F8F8000000F8F80000071F181F070000F8F8000000F8F8001F1F0C070C1F1F001878E080E0781800181E0701071E18000078F88080F878000000001F1F00000008080888C87838001C1E1311101010000000F8F80808000000001F1F1010000070E0C0800000000000000103070E1C0000000808F8F80000000010101F1F000010180C060C1810000000000000000000000000000000000040404040404040400000060E0800000000000000000000000040404040C080000E1F1111111F1F00F8F8404040C080001F1F1010101F0F0080C0404040C080000F1F10101018080080C0404040F8F8000F1F1010101F1F0080C0404040C080000F1F1212121303004040F0F84848080000001F1F0000000080C0404040C0C0000F9F909090FF7F00F8F8404040C080001F1F0000001F1F00000040D8D80000000000101F1F1000000000000040D8D8000060E08080FF7F00F8F8000080C040001F1F02070D181000000008F8F80000000000101F1F100000C0C040C040C080001F1F001F001F1F00C0C0404040C080001F1F0000001F1F0080C0404040C080000F1F1010101F0F00C0C0404040C08000FFFF1010101F0F0080C0404040C0C0000F1F101010FFFF00C0C0C040404040001F1F00000000000080C040404040400011131212121E0C004040F8F84040000000000F1F10101000C0C0000000C0C0000F1F1010101F1F00C0C0000000C0C00001071E181E070100C0C0000000C0C0000F1F101F101F0F00C0C0000000C0C000181D0702071D1800C0C0000000C0C0000F9F909090FF7F0040404040C0C04000181C161311101000000080F0780808000000000F1F10100000000078780000000000001F1F00000000080878F08000000010101F0F00000010180818101808000000000000000000";
this.selectCustom = addRadioButton(this.modSpecificDiv, "Свой шрифт", "selectCustomLetters", "selectFontLetters");
this.selectCustom.value = "00000000000000000000000000000000000070F8F87000000000001B1B000000001E3E00003E1E00000000000000000040F0F040F0F04000041F1F041F1F040070F8888F8F983000060C0838380F07006060000080C06000180C06030118180000B0F8C878B080000F1F10110F1F100000203E1E0000000000000000000000000000E0F0180800000000070F1810000000000818F0E00000000010180F0700000040C08080C040000105070303070501000000C0C0000000000101070701010000000000000000000000203C1C00000000000000000000000101010101010100000000000000000000000018180000000000000080C06000180C060301000000F0F8088848F8F0000F1F1211101F0F00002030F8F80000000010101F1F10100010180888C87830001C1E1311101818001018888888F8700008181010101F0F0080C06030F8F80000010101111F1F1100F8F888888888080008181010111F0F00E0F09888888000000F1F1010101F0F001818080888F8780000001E1F0100000070F8888888F870000F1F1010101F0F0070F8888888F8F00000101010180F070000000060600000000000000C0C00000000000060600000000000101C0C000000000080C060301000000103060C1810008080808080808000040404040404040000103060C08000000010180C0603010030380888C87830000000001B1B000000E0F0109090F0E0000F1F101717170300C0E0301830E0C0001F1F0101011F1F0008F8F88888F87000101F1F10101F0F00E0F0180808183000070F181010180C0008F8F80818F0E000101F1F10180F070008F8F888C8183800101F1F1011181C0008F8F888C8183800101F1F1001000000E0F0180808183000070F1811110F1F00F8F8808080F8F8001F1F0000001F1F00000008F8F80800000000101F1F10000000000008F8F808000E1E10101F0F000008F8F880E0781800101F1F01031E1C0008F8F80800000000101F1F1010181C00F8F870E070F8F8001F1F0000001F1F00F8F870E0C0F8F8001F1F0000011F1F00E0F0180818F0E000070F1810180F070008F8F88888F87000101F1F1000000000F0F8080808F8F0000F1F101C787F4F0008F8F88888F87000101F1F00011F1E003078C888883830000C1C1010111F0E00003818F8F81838000000101F1F100000F8F8000000F8F8000F1F1010101F0F00F8F8000000F8F80003070C180C070300F8F8000000F8F800071F1C071C1F07001878E080E0781800181E0701071E18000078F88080F878000000101F1F10000038180888C87838001C1E131110181C000000F8F80808000000001F1F1010000070E0C0800000000000000103070E1C0000000808F8F80000000010101F1F000010180E070E1810000000000000000000000000000000000040404040404040400000070F08000000000000000000000000404040C08000000E1F11110F1F100008F8F840C0800000101F0F10101F0F0080C0404040C080000F1F1010101808000080C048F8F800000F1F10100F1F100080C0404040C080000F1F11111119090080F0F88818300000101F1F100000000080C0404080C040004FDF9090FF7F000008F8F88040C08000101F1F00001F1F00000040D8D80000000000101F1F1000000000000040D8D8000060E08080FF7F0008F8F80080C04000101F1F03071C1800000008F8F80000000000101F1F100000C0C0C080C0C080001F1F001F001F1F0040C0804040C08000001F1F00001F1F0080C0404040C080000F1F1010101F0F0040C0804040C0800080FFFF90101F0F0080C0404080C040000F1F1090FFFF800040C080C040C08000101F1F100000010080C0404040C0800008191312161C08004040F0F84040000000000F1F10180800C0C00000C0C000000F1F10100F1F100000C0C00000C0C00000070F18180F0700C0C0000000C0C0000F1F180E181F0F0040C0800080C0400010180F070F181000C0C0000000C0C0008F9F9090D07F3F00C0C04040C0C04000181C161311181800008080F0780808000000000F1F10100000000078780000000000001F1F00000000080878F08080000010101F0F00000010180818101808000000000000000000";
const customFontCardDiv = document.createElement("div");
customFontCardDiv.classList.add("d-none", "card", "md-3");
const customFontDiv = document.createElement("div");
customFontDiv.classList.add("card-body");
const explanationCustomFontFile = document.createElement("p");
explanationCustomFontFile.innerText = "Выберите файл изображения со шрифтом, размер картинки в идеале 760 на 16 пикселей. Если у вас нет картинки - можете воспользоваться полем для ввода шестнадцатиричного кода шрифта вручную.";
customFontDiv.appendChild(explanationCustomFontFile);
const fileInputDiv = document.createElement("div");
fileInputDiv.classList.add("custom-file", "mt-2");
this.customFileInput = document.createElement("input");
this.customFileInput.className = "custom-file-input";
this.customFileInput.type = "file";
this.customFileInput.accept = "image/bmp,image/jpeg,image/png";
this.customFileLabel = document.createElement("label");
this.customFileLabel.className = "custom-file-label";
this.customFileLabel.dataset.browse = "Обзор";
this.customFileLabel.innerText = "Выберите картинку";
this.customFileLabel.for = "customFileInput";
fileInputDiv.appendChild(this.customFileInput);
fileInputDiv.appendChild(this.customFileLabel);
this.canvas = document.createElement("canvas");
this.canvas.classList.add("mt-3", "mr-3", "border", "shadow-sm");
this.canvas.width = 760;
this.canvas.height = 16;
this.canvas2 = this.canvas.cloneNode();
fileInputDiv.appendChild(this.canvas);
fileInputDiv.appendChild(this.canvas2);
customFontDiv.appendChild(fileInputDiv);
const explanationCustomFontText = document.createElement("p");
explanationCustomFontText.innerText = "Итоговый код шрифта в виде шестнадцатиричной строки. По умолчанию здесь код стандартного шрифта. При ручной вставке символы \"\\x\", при наличии, будут удалены автоматически.";
customFontDiv.appendChild(explanationCustomFontText);
this.customFontData = document.createElement("textarea");
this.customFontData.classList.add("w-100", "form-control");
this.customFontData.rows = 8;
// this.customFontData.maxLength = 3040;
this.customFontData.placeholder = "Тут должен быть шестнадцатиричный код шрифта, перезагрузите страницу, чтобы сбросить!";
this.customFontData.value = this.selectCustom.value;
customFontDiv.appendChild(this.customFontData);
customFontCardDiv.appendChild(customFontDiv);
this.modSpecificDiv.appendChild(customFontCardDiv);
this.customFileInput.addEventListener("change", (event) => {
const file = this.customFileInput.files[0];
this.customFileLabel.textContent = file.name;
const reader = new FileReader();
reader.onload = () => {
const img = new Image();
img.onload = () => {
const canvas = this.canvas;
const ctx = canvas.getContext('2d');
ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height).data;
function getPixel(x, y) {
const index = y * canvas.width + x;
const i = index * 4;
return imageData[i] + imageData[i + 1] + imageData[i + 2] > 128 * 3 ? 0 : 1;
}
// run canvas content through getPixel and output to canvas2
const canvas2 = this.canvas2;
const ctx2 = canvas2.getContext('2d');
const imageData2 = ctx2.getImageData(0, 0, canvas2.width, canvas2.height);
for (let y = 0; y < canvas2.height; y++) {
for (let x = 0; x < canvas2.width; x++) {
const index = y * canvas2.width + x;
const i = index * 4;
const pixel = !getPixel(x, y);
imageData2.data[i] = pixel * 255;
imageData2.data[i + 1] = pixel * 255;
imageData2.data[i + 2] = pixel * 255;
imageData2.data[i + 3] = 255;
}
}
ctx2.putImageData(imageData2, 0, 0);
const outputArray = new Uint8Array((canvas2.width * canvas2.height)/8);
let j = 0;
for (let xs = 0; xs < canvas2.width; xs += 8) {
let y = 0;
for (let x = xs; x < (xs + 8); x++) {
let byte = 0;
for (let i = 0; i < 8; i++) {
byte |= getPixel(x, y + i) << i;
}
outputArray[j++] = byte;
}
y = 8;
for (let x = xs; x < (xs + 8); x++) {
let byte = 0;
for (let i = 0; i < 8; i++) {
byte |= getPixel(x, y + i) << i;
}
outputArray[j++] = byte;
}
}
this.customFontData.value = uint8ArrayToHexString(outputArray).toUpperCase();
this.selectCustom.value = this.customFontData.value;
drawFont(this.previewCanvas, font8to16(hexString(this.selectCustom.value), 8));
};
img.src = reader.result;
};
reader.readAsDataURL(file);
});
this.customFontData.addEventListener("input", (event) => {
const reg = /\\x/g;
this.selectCustom.value = event.target.value.replace(reg, "");
event.target.value = this.selectCustom.value;
drawFont(this.previewCanvas, font8to16(hexString(this.selectCustom.value), 8));
});
this.selectCustom.parentElement.parentElement.addEventListener("change", (event) => {
customFontCardDiv.classList.toggle("d-none", !this.selectCustom.checked);
if (event.target.name == "selectFontLetters") {
drawFont(this.previewCanvas, font8to16(hexString(event.target.value), 8));
}
});
this.selectTerminus.checked = true;
drawFont(this.previewCanvas, font8to16(hexString(this.selectTerminus.value), 8));
}
apply(firmwareData) {
const offset = 0xd6e1;
if (this.selectTunas1337.checked) {
firmwareData = replaceSection(firmwareData, hexString(this.selectTunas1337.value), offset);
}
else if (this.selectTerminus.checked) {
firmwareData = replaceSection(firmwareData, hexString(this.selectTerminus.value), offset);
}
else if (this.selectCustom.checked) {
firmwareData = replaceSection(firmwareData, hexString(this.selectCustom.value), offset);
}
log(`Успешно применён: ${this.name}.`);
return firmwareData;
}
}
,
/*
class Mod_CustomBootscreen extends FirmwareMod {
constructor() {
super("Свой логотип", "Заменяет логотип, который отображается 2 секунды при включении рации. Настройка текста при включении в меню игнорируется, логотип отображается всегда. Картинки автоматически урезаются по пустому месту сверху и снизу. Делайте узкий логотип, если необходимо сэкономить место.", "до 1024");
this.selectTrollface = addRadioButton(this.modSpecificDiv, "Троллфейс (933 Байта)", "selectTrollface", "selectBootscreen");
this.selectQ = addRadioButton(this.modSpecificDiv, "Лого Quansheng Q (929 Байт)", "selectQ", "selectBootscreen");
this.selectUVMOD = addRadioButton(this.modSpecificDiv, "Логотип UVMOD (214 Байт)", "selectUVMOD", "selectBootscreen");
this.selectNOKIA = addRadioButton(this.modSpecificDiv, "Логотип NOKIA (507 Байт)", "selectNOKIA", "selectBootscreen");
this.selectSuperMarioBros = addRadioButton(this.modSpecificDiv, "Логотип Super Mario (943 Байта)", "selectSuperMarioBros", "selectBootscreen");
this.selectCustomFile = addRadioButton(this.modSpecificDiv, "Собственная картинка (будет сконвертирована и обрезана автоматически, идеальный размер 128x64)", "selectCustom", "selectBootscreen");
this.selectTrollface.checked = true;
const fileInputDiv = document.createElement("div");
fileInputDiv.classList.add("custom-file", "mt-2", "d-none");
this.customFileInput = document.createElement("input");
this.customFileInput.className = "custom-file-input";
this.customFileInput.type = "file";
this.customFileInput.accept = "image/bmp,image/jpeg,image/png";
this.customFileLabel = document.createElement("label");
this.customFileLabel.className = "custom-file-label";
this.customFileLabel.dataset.browse = "Обзор";
this.customFileLabel.innerText = "Выберите картинку";
this.customFileLabel.for = "customFileInput";
fileInputDiv.appendChild(this.customFileInput);
fileInputDiv.appendChild(this.customFileLabel);
this.canvas = document.createElement("canvas");
this.canvas.classList.add("mt-3", "mr-3", "border", "shadow-sm");
this.canvas.width = 128;
this.canvas.height = 64;
this.canvas2 = this.canvas.cloneNode();
fileInputDiv.appendChild(this.canvas);
fileInputDiv.appendChild(this.canvas2);
this.modSpecificDiv.appendChild(fileInputDiv);
this.selectCustomFile.parentElement.parentElement.addEventListener("change", () => {
fileInputDiv.classList.toggle("d-none", !this.selectCustomFile.checked);
});
this.customImageData = new Uint8Array(1024);
this.customFileInput.onchange = () => {
const file = this.customFileInput.files[0];
this.customFileLabel.textContent = file.name;
const reader = new FileReader();
reader.onload = () => {
const img = new Image();
img.onload = () => {
const canvas = this.canvas;
const ctx = canvas.getContext('2d');
ctx.drawImage(img, 0, 0, 128, 64);
const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height).data;
function getPixel(x, y) {
const index = y * 128 + x;
const i = index * 4;
return imageData[i] + imageData[i + 1] + imageData[i + 2] > 128 * 3 ? 0 : 1;
}
// run canvas content through getPixel and output to canvas2
const canvas2 = this.canvas2;
const ctx2 = canvas2.getContext('2d');
const imageData2 = ctx2.getImageData(0, 0, canvas2.width, canvas2.height);
for (let y = 0; y < 64; y++) {
for (let x = 0; x < 128; x++) {
const index = y * 128 + x;
const i = index * 4;
const pixel = !getPixel(x, y);
imageData2.data[i] = pixel * 255;
imageData2.data[i + 1] = pixel * 255;
imageData2.data[i + 2] = pixel * 255;
imageData2.data[i + 3] = 255;
}
}
ctx2.putImageData(imageData2, 0, 0);
const outputArray = new Uint8Array(1024);
// getPixel(i) outputs the pixel value for any x y coordinate. 0 = black, 1 = white.
// the outputArray is 1024 bytes, where each byte is 8 pixels IN VERTICAL ORDER.
let i = 0;
for (let y = 0; y < 64; y += 8) {
for (let x = 0; x < 128; x++) {
let byte = 0;
for (let i = 0; i < 8; i++) {
byte |= getPixel(x, y + i) << i;
}
outputArray[i++] = byte;
}
}
this.customImageData.set(outputArray);
};
img.src = reader.result;
};
reader.readAsDataURL(file);
};
}
apply(firmwareData) {
const offset1 = 0x9bac;
const offset2 = 0xd264;
let imageData = null;
// images have to be 1024 bytes exactly, where each byte is 8 pixels. 128x64 pixels = 1024 bytes
// this mod optimizes the image data by removing empty lines from top and bottom. leave lots of empty space on top and bottom for the smallest size.
if (this.selectTrollface.checked) {
imageData = hexString("00000000000000000000000000000000000000000000000000000000000000000000008080c040602020b0b090909818383838282c2c2c2cacac8c8c0c1c1c545454541414148484242404440c8c0c0c0c0c0c08183070e08000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080c0fc06030101000000110800040000000000000414000000000000000000000800808080c0c0c2c2c2c0c1c5808a0405081204000000000000030f3ce08000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f0f89c26132984d4c4c44040c08084060785850d0f0f0f0e0efcfc18080000000000000e1f3319190c0c0c0707377767c7c58d8f8ec0ca6064743030901414363666c383060c8c1870c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000073fffc02228400080f07efec08383030321001038183c764383818080000020303030346404647c1880888880c0c860606070b0f018180c0c86c6e2fb7e0c0c0800391f80400f80e07f0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ffe00000fffffff3f8ffe3c3e3fedec6c6c4ccccfcfccdcdccc4c4fcfec6c6c6c2c3c3e3e3fff9f1707838381c1c0e7fffc7c373390d07030000000000c071180e0603010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0ff000000000f3f777fdfc7dfffe7879fffe787070f3fff070707070783ff8383818181c1c0c0c77f78303018980c4e0703a1804000a080c06030381c06030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ff870000001020404004888090918101010101018181818101010101014141111111212108101484c8ca606534321a19090c0406020301010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000103060c1810303020206060606060606020202030303010101818080c0c0c0c0c040606020301010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
}
else if (this.selectQ.checked) {
imageData = hexString("0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008080c0c0c0e0e0c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008080c0e0f0f0f8fcfefefeffffff7f7f3f3f1f1f1f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080c0f0f8fcfeffffffff7f3f1f0f0f0703030180c0c0e0f0f0f8f8f8fcf880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080e0f8feffffffffff3f1f0703010080c0e0f0f8fcfeffff7f7f3f1f1f0f0707070301818080c0c0c0c0c0e0c0e0c0e0c0c0c0808000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000081e3f3f3f3f3f3f0f0300000000f0fcfeffffffff3f1f0703010080c0e0f0f8fcfcfeff7f3f3f3f1f1f1f1f1f1f1f3f7ffffffffffffffffcf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080f0fcffffffffffffff07010000000000000000000080c0e0f8ffffffffff7f3f0f01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f3f7ffffffffffffffffefefcfcfcfcfcfefeffffffff9f9f8f870303000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010101030103030307070f0f0f1f1f1f1f1f0f07030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
}
else if (this.selectUVMOD.checked) {
imageData = hexString("000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFF000000000000FFFFFF00000000FFFFFF000000000000FFFFFF00000000FFFFFF7CF8F0F87CFFFFFF00000000FCFEFF0F070707070FFFFEFC00000000FFFFFF07070707070FFFFEFC00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003F7FFFF0E0E0E0E0F0FF7F3F000000000F1F3F7CF8F0F0F87C3F1F0F00000000FFFFFF0001010100FFFFFF000000003F7FFFF0E0E0E0E0F0FF7F3F00000000FFFFFFE0E0E0E0E0F0FF7F3F0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
}
else if (this.selectNOKIA.checked) {
imageData = hexString("0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008080808080808080808000000000000000000000008080808080800000000000008080808080808080808080808080808080000000000000808080808080000000000000000000008080808080808080000080808080808000000000000000000000000080808080808080000000000000000000000000000000000000000000ffffffffffff0f1f3ffffffefcf8e0c08000000000ffffffffffff0000fcfeffffffff0f0f0f0f0f0f0f0f0f0f0f0f0f0ffffffffefc0000ffffffffffff8080c0e0f0f8fc7c7e3f1f0f0f07030101000000ffffffffffff0000000000000080e0f8fcffff7f1f0f3f7ffffffcf8e08000000000000000000000000000000000ffffffffffff000000000103070f1f3ffffffefcf8ffffffffffff00003f7ffffffffff0f0f0f0f0f0f0f0f0f0f0f0f0f0ffffff7f3f0000ffffffffffff00010303070f1f3f7f7efcf8f8f0e0c0c0800000ffffffffffff000080e0f8fcffffff3f3f3f3d3c3c3c3c3c3d3f3f3ffffffffcf8e080000000000000000000000001010101010100000000000000000000000101010101010101010100000000000001010101010101010101010101010101010000000000000101010101010000000000000000000000010101010101010100010101010101000101010101010100000000000000000000000000000001010101010101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
}
else if (this.selectSuperMarioBros.checked) {
imageData = hexString("00000000000000000000000000000000000000000000000000000000000000000000808080800000000000000000000000000000000000808080800000C06020B0505058589810302060C080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080C06E7FE18001030E1C70C0800080406030101818FE030101010181091323468D081020608000817600000001071E78E0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080E03C7781037FCC848683820202040000030FF880008080C04041476CD8A7934BF7070183432B2E2CFC6CDD860C30E0800000000007FFC61C30E0800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010704081839694FC1808043000000000080C061317FC380000000000000000103C6C0808F9084DFDDC7C0C0E02131111B1CE0000000010F060CF8E7FCC00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000103FEC4060E1A336180000000031F63CF8E0E167EFEBF6F575F5FFF0703030303000F080804F2320909010182FE080C040300FF3F000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000073C70C080C04063769C188C4466534B4C4850737272F2931888E898980808081C163464F4941E020101000080E0381F03000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000103060C18367C4783E0C0000000000909020000000103000083FF0302020200000001030EF8180C0601000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001010302060C0C0C08080C0C0E18180C0704040C0C0C0C0C040406030100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
}
else if (this.selectCustomFile.checked) {
imageData = this.customImageData;
// log(uint8ArrayToHexString(imageData));
}
if (imageData.length !== 1024) throw new Error("Размер области с изображением должен быть ровно 1024 байта.");
// this uses the shellcode from custom_bootscreen_narrow
let shellcode = hexString("30B5002206490748F6F72AFB064A07490748F6F713FB01F0ADFD01F06FFD30BD0004000084060020CCCCCCCCBBBBBBBBAAAAAAAA");
// remove empty lines from top
let offsetLines = 0;
for (let i = 0; i < 64; i++) {
if (imageData.slice(i * 16, i * 16 + 16).every(pixel => pixel === 0)) {
offsetLines++;
} else {
break;
}
}
imageData = imageData.slice(offsetLines * 16);
// truncate all zero bytes from the end of the image data
let endIndex = imageData.length;
while (endIndex > 0 && imageData[endIndex - 1] === 0) {
endIndex--;
}
imageData = imageData.subarray(0, endIndex);
// now we can patch the shellcode with the right values
const shellcodeDataView = new DataView(shellcode.buffer);
shellcodeDataView.setUint32(1 * -4 + shellcode.length, 0x20000684 + offsetLines * 16, true); // set destination address inside displaybuffer shifted by the amount of removed empty lines
shellcodeDataView.setUint32(2 * -4 + shellcode.length, firmwareData.length, true); // set source address to the end of the firmware where the image will be stored
shellcodeDataView.setUint32(3 * -4 + shellcode.length, imageData.length, true); // set length of the image data
firmwareData = replaceSection(firmwareData, shellcode, offset1);
firmwareData = replaceSection(firmwareData, hexString("0001"), offset2); // patch bootscreen duration to 2 seconds
firmwareData = replaceSection(firmwareData, imageData, firmwareData.length);
log(`Успешно применён: ${this.name}. Использовано ${imageData.length} байт(а) дополнительно.`);
return firmwareData;
}
}
,
*/
class Mod_SkipBootscreen extends FirmwareMod {
constructor() {
super("Пропуск приветствия", "Пропускает экран приветствия и сразу отображает главный экран при включении.", 0);
}
apply(firmwareData) {
const offset = 0xd25a;
const newData = hexString("00bf00bff8f7b7fb00f002f8");
firmwareData = replaceSection(firmwareData, newData, offset);
log(`Успешно применён: ${this.name}.`);
return firmwareData;
}
}
,
class Mod_BacklightDuration extends FirmwareMod {
constructor() {
super("Множитель длительности подсветки", "Увеличивает длительность подсветки, указанную в настройках, в два, четыре или восемь раз. Например, если указать в настройках 5 и множитель два, то подсветка будет работать 10 секунд.", 0);
this.select1 = addRadioButton(this.modSpecificDiv, "1x (1 - 1 секунда, 5 - 5 секунд)", "select1", "selectBacklightDuration");
this.select2 = addRadioButton(this.modSpecificDiv, "2x (1 - 2 секунды, 5 - 10 секунд)", "select2", "selectBacklightDuration");
this.select4 = addRadioButton(this.modSpecificDiv, "4x (1 - 4 секунды, 5 - 20 секунд)", "select4", "selectBacklightDuration");
this.select8 = addRadioButton(this.modSpecificDiv, "8x (1 - 8 секунд, 5 - 40 секунд)", "select8", "selectBacklightDuration");
this.select2.checked = true;
}
apply(firmwareData) {
const offset = 0x59e6;
const buffer = new ArrayBuffer(4);
const dataView = new DataView(buffer);
if (this.select1.checked) {
dataView.setUint32(0, 64, true);
}
else if (this.select2.checked) {
dataView.setUint32(0, 128, true);
}
else if (this.select4.checked) {
dataView.setUint32(0, 192, true);
}
else if (this.select8.checked) {
dataView.setUint32(0, 256, true);
}
const newData = new Uint8Array(buffer);
firmwareData = replaceSection(firmwareData, newData, offset);
log(`Успешно применён: ${this.name}.`);
return firmwareData;
}
}
,
class Mod_MenuStrings extends FirmwareMod {
constructor() {
super("Пункты меню", "Изменяет текст в пунктах меню.", 0);
this.selectNGCMenuStr = addRadioButton(this.modSpecificDiv, "Модификация пунктов меню от Валентина Воронина", "selectNGCMenuStr", "selectMenuStr");
this.selectCustMenuStr = addRadioButton(this.modSpecificDiv, "Свои пункты меню. В этом JSON объекте содержатся названия всех пунктов меню со смещением и максимальным размером. Изменять можно только название пункта, длина не должна превышать указанный размер, алфавит только латиница. Для удобства можно воспользоваться сервисом jsoneditoronline.org или аналогичным.", "selectCustMenuStr", "selectMenuStr");
this.selectNGCMenuStr.checked = true;
// the b l o c k
const strings = [
{
"offset": 56470,
"description": "squelch",
"size": 6,
"string": "SQLCH"
},
{
"offset": 56477,
"description": "step",
"size": 6,
"string": "STEP"
},
{
"offset": 56484,
"description": "txpower",
"size": 6,
"string": "TXPWR"
},
{
"offset": 56491,
"description": "r dcs",
"size": 6,
"string": "R_DCS"
},
{
"offset": 56498,
"description": "r ctcs",
"size": 6,
"string": "R_CTCS"
},
{
"offset": 56505,
"description": "t dcs",
"size": 6,
"string": "T_DCS"
},
{
"offset": 56512,
"description": "t ctcs",
"size": 6,
"string": "T_CTCS"
},
{
"offset": 56519,
"description": "tx shift direction",
"size": 6,
"string": "SHFT-D"
},
{
"offset": 56526,
"description": "tx shift offset",
"size": 6,
"string": "OFFSET"
},
{
"offset": 56533,
"description": "wide/narrow",
"size": 6,
"string": "BNDWDH"
},
{
"offset": 56540,
"description": "scramble",
"size": 6,
"string": "SCRMBL"
},