Skip to content
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

Merged
merged 16 commits into from
Jun 2, 2023

Conversation

saybur
Copy link
Contributor

@saybur saybur commented May 31, 2023

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.

saybur added 9 commits May 29, 2023 11:13
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.
Copy link
Collaborator

@PetteriAimonen PetteriAimonen left a 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.

src/ZuluSCSI_disk.cpp Outdated Show resolved Hide resolved
src/ZuluSCSI_disk.cpp Show resolved Hide resolved
src/ZuluSCSI_disk.h Outdated Show resolved Hide resolved
src/ZuluSCSI_disk.cpp Outdated Show resolved Hide resolved
src/ZuluSCSI_disk.h Outdated Show resolved Hide resolved
@saybur
Copy link
Contributor Author

saybur commented Jun 1, 2023

The feedback thus far is much appreciated, thank you!

@saybur
Copy link
Contributor Author

saybur commented Jun 2, 2023

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.

@saybur saybur marked this pull request as ready for review June 2, 2023 01:57
Copy link
Collaborator

@PetteriAimonen PetteriAimonen left a 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.

src/ZuluSCSI_disk.cpp Outdated Show resolved Hide resolved
Copy link
Collaborator

@PetteriAimonen PetteriAimonen left a comment

Choose a reason for hiding this comment

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

Ready to merge :)

@aperezbios aperezbios merged commit 3a2de5f into ZuluSCSI:main Jun 2, 2023
@aperezbios
Copy link
Collaborator

Excellent, thanks to both of you. Merged. :)

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.

Feature request: reduced INI editing when adding CD images
3 participants