Skip to content

screenshots: use subdirectories for the date and include the title ID#1488

Open
ioistired wants to merge 5 commits intoLumaTeam:masterfrom
ioistired:screenshot-filename-improvements
Open

screenshots: use subdirectories for the date and include the title ID#1488
ioistired wants to merge 5 commits intoLumaTeam:masterfrom
ioistired:screenshot-filename-improvements

Conversation

@ioistired
Copy link
Copy Markdown
Contributor

Using subdirectories allows for easier retrieval over FTP,
as it reduces the amount of entries in the screenshots directory.

Including the title ID lets users search for all screenshots they have of a
certain game, or organize their screenshots by software instead of by date.

Using subdirectories allows for easier retrieval over FTP,
as it reduces the amount of entries in the screenshots directory.

Including the title ID lets users search for all screenshots they have of a
certain game, or organize their screenshots by software instead of by date.

FS_ProgramInfo programInfo;
u32 unused;
res = PMDBG_GetCurrentAppInfo(&programInfo, &unused, &unused);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized there's a bug in this approach: screenshots taken of the home menu while software is suspended, and screenshots taken of applets while software is suspended, will result in the wrong title ID written. Is that an issue?

@Shadow322
Copy link
Copy Markdown

add location too? like if i have boot.firm on ctrnand it will make SS in nand not sd card we need a setting to chose SS location

@ioistired
Copy link
Copy Markdown
Contributor Author

That's beyond the scope of this pull request. The original code saves to SD.

@Shadow322
Copy link
Copy Markdown

That's beyond the scope of this pull request. The original code saves to SD.

Nope it does as I stated

@ioistired
Copy link
Copy Markdown
Contributor Author

Oh I misread you. What part of my changes breaks the current behavior?

#define WRITE_SCREENSHOT(screenName, screenWidth, top, left) do { \
sprintf( \
filename, \
"%s/%04lu-%02lu-%02lu_%02lu-%02lu-%02lu.%03llu_%016llx_%s.bmp", \
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checkpoint uses the lower 4 bytes (8 nybbles) of the program's title ID. Should I do the same here?

@ioistired
Copy link
Copy Markdown
Contributor Author

@Shadow322 I tested it on NAND and it does indeed save to ctr:/rw/luma/screenshots/yyyy/mm/dd/ when the SD card is unavailable. I think a user-configurable toggle to choose where to save is beyond the scope of this pull request.

You'll notice this line is unchanged from the original code:

archiveId = isSdMode ? ARCHIVE_SDMC : ARCHIVE_NAND_RW;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants