Improvements to firmware checks when "System Files are in Content Directory" is enabled#16170
Conversation
|
Would it be possible to add a line after your new note that says "looking in /path/to/system"? |
f351892 to
d916cbb
Compare
|
Good stuff. Might be even better if they would stand out more with some other prefix than the same |
d916cbb to
d21adbe
Compare
|
@sonninnos Are you satisfied with the PR in its current state? |
|
LGTM. |
d21adbe to
ce00792
Compare
|
Really minor update to use uint8_t flags = content_get_flags();
bool content_is_inited = flags & CONTENT_ST_FLAG_IS_INITED;instead of: content_state_t *p_content = content_state_get_ptr();
bool content_is_inited = p_content->flags & CONTENT_ST_FLAG_IS_INITED;It doesn't change anything to the result but I think it's a bit more readable and it's also more consistent with the rest of the code in |
LibretroAdmin
left a comment
There was a problem hiding this comment.
I left some feedback on things I'd like to see addressed
| strlcpy(tmp_path, fullpath, sizeof(tmp_path)); | ||
| path_basedir(tmp_path); | ||
|
|
||
| /* Removes trailing slash */ |
There was a problem hiding this comment.
OK, you can do one of two possible improvements here:
- (Solution 1) Either make it so that you only do strlen(tmp_path) once, having it do it two times like this is wasteful
- (Solution 2) (Preferred but you will have to see how achievable this is) Not having to use the strlen at all and being able to figure out the size some other way beforehand. But this might not be achievable in which case you can go for solution 1.
There was a problem hiding this comment.
PR updated, I couldn't find a way without strlen so I went for solution 1, hope this is OK.
…ectory" is enabled
ce00792 to
4185277
Compare
…ectory" is enabled (libretro#16170)




Description
With this PR if
System Files are in Content Directoryis enabled:A line will now be shown in the core infos, below "Firmware":
If content is NOT loaded, firmware files in the core infos will be checked in the "system" folder as usual.
If content is loaded, firmware files in the core infos will now be checked in the content folder (see how "scph5501.bin" is now missing compared to the previous screenshot):
Logs will now output the content directory as "SYSTEM_DIRECTORY" instead of the global "system" folder. So for example instead of seeing:
you'll see:
edit: Core infos will now show the current directory being checked for firmware files.
Also, the regular system dir path is returned without a trailing slash so I added a check for when
System Files are in Content Directoryis enabled to remove it (becausepath_basedir()returns a trailing slash). I don't think it was breaking anything before so if this seems superfluous I'll remove it.Related Issues
Closes #15272
Reviewers
No clue, but please review :D I need some dev brains to make sure I didn't break anything and that I didn't miss/overlook anything.
Tested multiple scenarios on both Windows and Linux and, AFAICT, it works fine but I'd like to be 200% sure :p