Skip to content

(Naive) fix for DTA incompatibility#102

Open
tin-nl wants to merge 1 commit intoretro16:5.1from
tin-nl:fix/dta-filter-attribute
Open

(Naive) fix for DTA incompatibility#102
tin-nl wants to merge 1 commit intoretro16:5.1from
tin-nl:fix/dta-filter-attribute

Conversation

@tin-nl
Copy link
Copy Markdown

@tin-nl tin-nl commented Jun 15, 2025

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 clears dt_fname completely), 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).

…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)
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.

1 participant