You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sys-botbaseplus/source/main.cpp
+35-40Lines changed: 35 additions & 40 deletions
Original file line number
Diff line number
Diff line change
@@ -85,15 +85,6 @@ extern "C"
85
85
setsysExit();
86
86
}
87
87
}
88
-
rc = fsInitialize();
89
-
if (R_FAILED(rc))
90
-
fatalThrow(rc);
91
-
rc = fsdevMountSdmc();
92
-
if (R_FAILED(rc))
93
-
fatalThrow(rc);
94
-
rc = timeInitialize();
95
-
if (R_FAILED(rc))
96
-
fatalThrow(rc);
97
88
rc = pmdmntInitialize();
98
89
if (R_FAILED(rc))
99
90
{
@@ -119,21 +110,14 @@ extern "C"
119
110
rc = viInitialize(ViServiceType_Default);
120
111
if (R_FAILED(rc))
121
112
fatalThrow(rc);
122
-
rc = lblInitialize();
123
-
if (R_FAILED(rc))
124
-
fatalThrow(rc);
125
113
}
126
114
127
115
void__appExit(void)
128
116
{
129
-
fsdevUnmountAll();
130
-
fsExit();
131
117
smExit();
132
118
audoutExit();
133
-
timeExit();
134
119
socketExit();
135
120
viExit();
136
-
lblExit();
137
121
}
138
122
}
139
123
@@ -171,7 +155,7 @@ int argmain(int argc, char **argv)
171
155
if (argc == 0)
172
156
return0;
173
157
174
-
//peek <address in hex or dec> <amount of bytes in hex or dec>
158
+
//peek <address in hex or dec> <amount of bytes in hex or dec>
175
159
if (!strcmp(argv[0], "peek"))
176
160
{
177
161
if (argc != 3)
@@ -264,7 +248,7 @@ int argmain(int argc, char **argv)
264
248
Commands::peekMulti(offsets, sizes, itemCount);
265
249
}
266
250
267
-
//poke <address in hex or dec> <amount of bytes in hex or dec> <data in hex or dec>
251
+
//poke <address in hex or dec> <amount of bytes in hex or dec> <data in hex or dec>
268
252
if (!strcmp(argv[0], "poke"))
269
253
{
270
254
if (argc != 3)
@@ -305,7 +289,7 @@ int argmain(int argc, char **argv)
305
289
free(data);
306
290
}
307
291
308
-
//click <buttontype>
292
+
//click <buttontype>
309
293
if (!strcmp(argv[0], "click"))
310
294
{
311
295
if (argc != 2)
@@ -314,7 +298,7 @@ int argmain(int argc, char **argv)
314
298
Commands::click(key);
315
299
}
316
300
317
-
//hold <buttontype>
301
+
//hold <buttontype>
318
302
if (!strcmp(argv[0], "press"))
319
303
{
320
304
if (argc != 2)
@@ -323,7 +307,7 @@ int argmain(int argc, char **argv)
323
307
Commands::press(key);
324
308
}
325
309
326
-
//release <buttontype>
310
+
//release <buttontype>
327
311
if (!strcmp(argv[0], "release"))
328
312
{
329
313
if (argc != 2)
@@ -332,7 +316,7 @@ int argmain(int argc, char **argv)
332
316
Commands::release(key);
333
317
}
334
318
335
-
//setStick <left or right stick> <x value> <y value>
319
+
//setStick <left or right stick> <x value> <y value>
336
320
if (!strcmp(argv[0], "setStick"))
337
321
{
338
322
if (argc != 4)
@@ -354,7 +338,7 @@ int argmain(int argc, char **argv)
354
338
355
339
int dxVal = strtol(argv[2], NULL, 0);
356
340
if (dxVal > JOYSTICK_MAX)
357
-
dxVal = JOYSTICK_MAX; //0x7FFF
341
+
dxVal = JOYSTICK_MAX; //0x7FFF
358
342
if (dxVal < JOYSTICK_MIN)
359
343
dxVal = JOYSTICK_MIN; //-0x8000
360
344
int dyVal = strtol(argv[3], NULL, 0);
@@ -366,13 +350,13 @@ int argmain(int argc, char **argv)
366
350
Commands::setStickState(side, dxVal, dyVal);
367
351
}
368
352
369
-
//detachController
353
+
//detachController
370
354
if (!strcmp(argv[0], "detachController"))
371
355
{
372
356
Commands::detachController();
373
357
}
374
358
375
-
//configure <mainLoopSleepTime or buttonClickSleepTime> <time in ms>
359
+
//configure <mainLoopSleepTime or buttonClickSleepTime> <time in ms>
376
360
if (!strcmp(argv[0], "configure"))
377
361
{
378
362
if (argc != 3)
@@ -442,7 +426,7 @@ int argmain(int argc, char **argv)
442
426
443
427
if (!strcmp(argv[0], "getSystemLanguage"))
444
428
{
445
-
//thanks zaksa
429
+
//thanks zaksa
446
430
setInitialize();
447
431
u64 languageCode = 0;
448
432
SetLanguage language = SetLanguage_ENUS;
@@ -471,7 +455,7 @@ int argmain(int argc, char **argv)
471
455
472
456
if (!strcmp(argv[0], "pixelPeek"))
473
457
{
474
-
//errors with 0x668CE, unless debugunit flag is patched
458
+
//errors with 0x668CE, unless debugunit flag is patched
475
459
u64 bSize = 0x7D000;
476
460
char *buf = (char *)malloc(bSize);
477
461
u64 outSize = 0;
@@ -676,7 +660,7 @@ int argmain(int argc, char **argv)
676
660
if (!strcmp(argv[0], "freezeUnpause"))
677
661
freeze_thr_state = Freeze::Active;
678
662
679
-
//touch followed by arrayof: <x in the range 0-1280> <y in the range 0-720>. Array is sequential taps, not different fingers. Functions in its own thread, but will not allow the call again while running. tapcount * pollRate * 2
663
+
//touch followed by arrayof: <x in the range 0-1280> <y in the range 0-720>. Array is sequential taps, not different fingers. Functions in its own thread, but will not allow the call again while running. tapcount * pollRate * 2
680
664
if (!strcmp(argv[0], "touch"))
681
665
{
682
666
if (argc < 3 || argc % 2 == 0)
@@ -695,7 +679,7 @@ int argmain(int argc, char **argv)
//touchHold <x in the range 0-1280> <y in the range 0-720> <time in milliseconds (must be at least 15ms)>. Functions in its own thread, but will not allow the call again while running. pollRate + holdtime
682
+
//touchHold <x in the range 0-1280> <y in the range 0-720> <time in milliseconds (must be at least 15ms)>. Functions in its own thread, but will not allow the call again while running. pollRate + holdtime
699
683
if (!strcmp(argv[0], "touchHold"))
700
684
{
701
685
if (argc != 4)
@@ -709,7 +693,7 @@ int argmain(int argc, char **argv)
709
693
makeTouch(state, 1, time * 1e+6L, false);
710
694
}
711
695
712
-
//touchDraw followed by arrayof: <x in the range 0-1280> <y in the range 0-720>. Array is vectors of where finger moves to, then removes the finger. Functions in its own thread, but will not allow the call again while running. (vectorcount * pollRate * 2) + pollRate
696
+
//touchDraw followed by arrayof: <x in the range 0-1280> <y in the range 0-720>. Array is vectors of where finger moves to, then removes the finger. Functions in its own thread, but will not allow the call again while running. (vectorcount * pollRate * 2) + pollRate
713
697
if (!strcmp(argv[0], "touchDraw"))
714
698
{
715
699
if (argc < 3 || argc % 2 == 0)
@@ -731,8 +715,8 @@ int argmain(int argc, char **argv)
731
715
if (!strcmp(argv[0], "touchCancel"))
732
716
touchToken = 1;
733
717
734
-
//key followed by arrayof: <HidKeyboardKey> to be pressed in sequential order
735
-
//thank you Red (hp3721) for this functionality
718
+
//key followed by arrayof: <HidKeyboardKey> to be pressed in sequential order
719
+
//thank you Red (hp3721) for this functionality
736
720
if (!strcmp(argv[0], "key"))
737
721
{
738
722
if (argc < 2)
@@ -747,13 +731,13 @@ int argmain(int argc, char **argv)
747
731
if (key < 4 || key > 231)
748
732
continue;
749
733
keystates[i].keys[key / 64] = 1UL << key;
750
-
keystates[i].modifiers = 1024UL; //numlock
734
+
keystates[i].modifiers = 1024UL; //numlock
751
735
}
752
736
753
737
makeKeys(keystates, count);
754
738
}
755
739
756
-
//keyMod followed by arrayof: <HidKeyboardKey> <HidKeyboardModifier>(without the bitfield shift) to be pressed in sequential order
740
+
//keyMod followed by arrayof: <HidKeyboardKey> <HidKeyboardModifier>(without the bitfield shift) to be pressed in sequential order
757
741
if (!strcmp(argv[0], "keyMod"))
758
742
{
759
743
if (argc < 3 || argc % 2 == 0)
@@ -774,7 +758,7 @@ int argmain(int argc, char **argv)
774
758
makeKeys(keystates, count);
775
759
}
776
760
777
-
//keyMulti followed by arrayof: <HidKeyboardKey> to be pressed at the same time.
761
+
//keyMulti followed by arrayof: <HidKeyboardKey> to be pressed at the same time.
778
762
if (!strcmp(argv[0], "keyMulti"))
779
763
{
780
764
if (argc < 2)
@@ -794,7 +778,7 @@ int argmain(int argc, char **argv)
794
778
makeKeys(keystate, 1);
795
779
}
796
780
797
-
//turns off the screen (display)
781
+
//turns off the screen (display)
798
782
if (!strcmp(argv[0], "screenOff"))
799
783
{
800
784
ViDisplay temp_display;
@@ -806,11 +790,18 @@ int argmain(int argc, char **argv)
806
790
rc = viSetDisplayPowerState(&temp_display, ViPowerState_NotScanning); // not scanning keeps the screen on but does not push new pixels to the display. Battery save is non-negligible and should be used where possible
807
791
svcSleepThread(1e+6l);
808
792
viCloseDisplay(&temp_display);
793
+
794
+
rc = lblInitialize();
795
+
if (R_FAILED(rc))
796
+
fatalThrow(rc);
797
+
lblSwitchBacklightOff(1ul);
798
+
lblExit();
799
+
809
800
lblSwitchBacklightOff(1ul);
810
801
}
811
802
}
812
803
813
-
//turns on the screen (display)
804
+
//turns on the screen (display)
814
805
if (!strcmp(argv[0], "screenOn"))
815
806
{
816
807
ViDisplay temp_display;
@@ -822,7 +813,12 @@ int argmain(int argc, char **argv)
0 commit comments