Open
Conversation
…rage of the attribute filter param; this was using the last byte of d_fname[14] before, which meant it could be overwritten by software that clears d_fname (like e.g. BUGABOO)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Acsi2stm apparently uses a slightly incompatible DTA structure - it expects TOS applications to not write into the documented
char dt_fname[14]member, since it "hides" the attribute filter value in it's last byte.Unfortunately there are corner cases where applications write into, or even completely clear
dt_fname(case in point e.g. BUGABOO which clearsdt_fnamecompletely), expecting this (as per docs) to be a 14 char name buffer and thus effectively overwriting the internal filter attribute state, which in turn breaks trailing fsnext()s.To keep Acsi2stms internal data confined to the 21 bytes of reserved space that TOS uses, I hamfistedly changed the mediaId from 32 to 16 bits. This might not be enough for conflict-free media changes, that's why I'm a bit vary if this is a good approach or not. My low-level SD card experience is practically zero, so take this as "It works here"(tm), but ymmv (and implementing a non-native 24 or 26 bit data type seemed to me like too much complexity spread throughout the code).