-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CD-ROM image listing from directories #229
Conversation
Also incorporates the ".cue" and ".rom_loaded" checks. Intention is to re-use this during dynamic image scanning.
The goal here is to help support alternate image fetch strategies by making the function responsible for advancing the image, rather than callers manipulating image_index directly.
The initial code just looks for its presence, actual value will be re-read during image scanning.
It would make more sense to use getName() on the current image. However, during testing this always seemed to return '\0' as the filename, even without close() being invoked. Not certain if this is a bug or something I was doing wrong. If that can be sorted out this variable can be removed to save a chunk of SRAM.
scsiDiskResetImages() does a memset to 0 during reinit so default values need to be handled here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far, I left a few comments but nothing critical.
I didn't test it yet.
This also uses some additional buffers to make the code easier to follow (hopefully) and help protect against excessively long paths.
The feedback thus far is much appreciated, thank you! |
I've tested this across several platforms and image switching (both from operating systems and external buttons) seems to be working properly. I did not test with huge numbers of images so that may expose some additional problems. Otherwise should be ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The panic()
function fails to build for GD32. Otherwise looks good to me.
I'll see about enabling github workflow builds for external pull requests, which would catch problems like this more easily.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ready to merge :)
Excellent, thanks to both of you. Merged. :) |
Proposal to resolve #218 by adding an .ini file option called 'ImgDir' to read images out of a directory at runtime. This implementation follows the approach @PetteriAimonen outlined in the associated issue. It should also give a structure for supporting ini-free configuration in the future.
Basic image iteration works, including ejection events. However, there are parts (like directory naming) that are incomplete and testing has not yet been completed on different operating systems. If this approach seems workable, I'll continue to develop this and mark it as ready for merging once issues are fixed.