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

Memory-friendly cartridge format #21

Merged
merged 7 commits into from
Sep 2, 2023
Merged

Memory-friendly cartridge format #21

merged 7 commits into from
Sep 2, 2023

Conversation

robotlolita
Copy link
Contributor

This should (hopefully!) be the last iteration of the cartridge format until stable release. For the previous iteration I was thinking of adding streaming support in LJT, but that turned out to make the format too complicated for my taste (LJT works better with small messages, just like Protobufs), so I'm backtracking on that and just making the format composed of blocks that are handled outside of LJT.

The new format has a rarely-changing statically-sized header which provides slices for the metadata and cartridge data portions, as well as the minimum kernel version required to decode it (this is useful to provide better error messages). It also includes signature blocks for the upcoming signed cartridges work. Decoding metadata can then be made fairly cheap by only reading the necessary amount of bytes in memory. And decoding files can be made memory friendly by not requiring the entire cartridge to be loaded in memory at once. Neither of those memory optimisations are done in this patch—they'll be a follow up work before stable release.

Cartridge v4 is still supported, but deprecated. Kart tooling is not going to be generating it anymore, but older cartridges will still be able to be loaded in the console.

@robotlolita robotlolita added c:kernel Changes to the Kate emulator kernel (requires strict audits!) c:tooling Changes to Kate's developer tooling/SDKs (relaxed audits) labels Sep 2, 2023
@robotlolita robotlolita merged commit a4b535d into main Sep 2, 2023
1 check passed
@robotlolita robotlolita deleted the patch/memory-format branch September 2, 2023 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c:kernel Changes to the Kate emulator kernel (requires strict audits!) c:tooling Changes to Kate's developer tooling/SDKs (relaxed audits)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant