@@ -238,39 +238,39 @@ namespace tsl {
238
238
*/
239
239
static Result captureScreen () {
240
240
/* Allocate buffer for jpeg. */
241
- size_t buffer_size = 0x7D000 ;
242
- u8 *buffer = new u8 [buffer_size ];
243
- ScopeGuard buffer_guard ([buffer] { delete[] buffer; });
241
+ size_t bufferSize = 0x7D000 ;
242
+ u8 *buffer = new u8 [bufferSize ];
243
+ ScopeGuard bufferGuard ([buffer] { delete[] buffer; });
244
244
245
245
/* Capture current screen. */
246
246
u64 size;
247
247
struct {
248
248
u32 a;
249
249
u64 b;
250
250
} in = {0 , 10000000000 };
251
+
251
252
R_TRY (serviceDispatchInOut (capsscGetServiceSession (), 1204 , in, size,
252
- .buffer_attrs = {SfBufferAttr_HipcMapTransferAllowsNonSecure | SfBufferAttr_HipcMapAlias | SfBufferAttr_Out},
253
- .buffers = { { buffer, buffer_size } },
253
+ .buffer_attrs = { SfBufferAttr_HipcMapTransferAllowsNonSecure | SfBufferAttr_HipcMapAlias | SfBufferAttr_Out },
254
+ .buffers = { { buffer, bufferSize } },
254
255
));
255
256
256
257
/* Open Sd card filesystem. */
257
258
FsFileSystem sdmc;
258
259
R_TRY (fsOpenSdCardFileSystem (&sdmc));
259
- ScopeGuard sdmc_guard ([&sdmc] { fsFsClose (&sdmc); });
260
+ ScopeGuard sdmcGuard ([&sdmc] { fsFsClose (&sdmc); });
260
261
261
262
/* Allocate path buffer. */
262
263
char *pathBuffer = new char [FS_MAX_PATH];
263
- ScopeGuard path_guard ([pathBuffer] { delete[] pathBuffer; });
264
+ ScopeGuard pathGuard ([pathBuffer] { delete[] pathBuffer; });
264
265
265
266
/* Get unique filepath. */
266
- u64 timestamp=0 ;
267
- Result rc = timeGetCurrentTime (TimeType_Default, ×tamp);
268
- if (R_SUCCEEDED (rc)) std::snprintf (pathBuffer, FS_MAX_PATH, " /libtesla_%ld.jpg" , timestamp);
269
- else std::strcpy (pathBuffer, " /libtesla_screenshot.jpg" );
267
+ u64 timestamp = svcGetSystemTick ();
268
+ std::snprintf (pathBuffer, FS_MAX_PATH, " /libtesla_%ld.jpg" , timestamp);
270
269
271
270
/* Create file, open and write to it. */
272
271
fsFsDeleteFile (&sdmc, pathBuffer);
273
272
R_TRY (fsFsCreateFile (&sdmc, pathBuffer, size, 0 ));
273
+
274
274
FsFile file;
275
275
R_TRY (fsFsOpenFile (&sdmc, pathBuffer, FsOpenMode_Write, &file));
276
276
fsFileWrite (&file, 0 , buffer, size, FsWriteOption_Flush);
@@ -3677,7 +3677,6 @@ extern "C" {
3677
3677
void __appInit (void ) {
3678
3678
tsl::hlp::doWithSmSession ([]{
3679
3679
ASSERT_FATAL (capsscInitialize ());
3680
- ASSERT_FATAL (timeInitialize ());
3681
3680
ASSERT_FATAL (fsInitialize ());
3682
3681
ASSERT_FATAL (hidInitialize ()); // Controller inputs and Touch
3683
3682
ASSERT_FATAL (plInitialize (PlServiceType_System)); // Font data. Use pl:s to prevent qlaunch/overlaydisp session exhaustion
@@ -3693,7 +3692,6 @@ extern "C" {
3693
3692
*/
3694
3693
void __appExit (void ) {
3695
3694
capsscExit ();
3696
- timeExit ();
3697
3695
fsExit ();
3698
3696
hidExit ();
3699
3697
plExit ();
0 commit comments