Skip to content

Document bitstream and related functions#371

Merged
UsernameFodder merged 4 commits intoUsernameFodder:masterfrom
Chesyon:bitstreams
Apr 7, 2026
Merged

Document bitstream and related functions#371
UsernameFodder merged 4 commits intoUsernameFodder:masterfrom
Chesyon:bitstreams

Conversation

@Chesyon
Copy link
Copy Markdown
Contributor

@Chesyon Chesyon commented Apr 2, 2026

This idea of bitstreams has actually already been known since at least 2013 (see "Byte Storage"). Save file storage is optimized down to the bit level, so there's no unused bits. It does this using bitstreams, which are responsible for reading/writing data from/to a buffer, and keeping track of location down to a bit level. Perhaps that's not the best way to explain it, but just take a look at CopyBitsToStream and CopyBitsFromStream, and you'll see what I mean. The code at the previous Project Pokemon link also demonstrates this functionality.
Anyway, it seems most compression of information for the save file is done through bitstreams, including a bunch of functions from Irdkwia's notes that I've updated accordingly. There are dozens more of these where I still need to figure out what they do, so expect those in a future PR.

Chesyon and others added 2 commits April 7, 2026 13:54
Co-authored-by: UsernameFodder <93669634+UsernameFodder@users.noreply.github.com>
Co-authored-by: UsernameFodder <93669634+UsernameFodder@users.noreply.github.com>
@UsernameFodder UsernameFodder merged commit c523bb9 into UsernameFodder:master Apr 7, 2026
12 checks passed
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.

2 participants