Add useful feature to ld-decode to assist with testing and bug reporting #996
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a new command line switch to ld-decode: --write-test-ldf
If you have a decode with positional switches (like --start --length etc) and you want to get a snippet of the original .lds file for future tests or to reproduce decoding errors you would need to work pretty hard to create a cut-down .lds with just the interesting bit of (what could be) a massive .ldf file.
If you simply add --write-test-ldf my-test.ldf to the existing ld-decode command line, the decoder will output an .lds file containing just enough data to decode exactly the same fields (without needing any positional arguments). This is ready for attachment to a bug report.
This feature is really useful for creating .lds test files too since you can easily make .ldf files of interesting disc sections.
The PR includes both the feature and two CI/CD tests that test both PAL and NTSC decodes.