I have some ideas for improving the encoder's command-line options.
it encodes the file as a set of independent banks, each in turn made up of pages that are swizzled together. Currently, you have hardcoded 64 blocks (4096 bytes) per page and 2 pages per bank, but I have ideas for options to change this. For example, a bank of four 2048-byte pages might be helpful for Super Mario Bros. 3
-style CHR rotation in an MMC3 cart with 32K CHR RAM. Or 1024-byte pages might be helpful when loading things that remain constant across all pages of a character's sprite animation, such as a projectile that remains on screen as the player switches to other CHR banks.
I'd also like an option to write out a header listing the offset to the start of each bank's compressed data. This is important for things like RHDE
, which need random access to 64-byte units (which would be 1 block in Bagel) to decode furniture graphics in the Furnish menu.
-h, --help show this help message and exit
--version show program's version number and exit
-d, --decompress decode the input file
-b, --bytes=SIZE put SIZE bytes (multiple of 64) per page
-I, --interleave=NUM interleave NUM pages together (requires -b)
--header write the block count, interleave size, and byte
offset to subsequent pages (or interleaved sets)
-o FILE, --output FILE
output to FILE instead of last positional arg
I'm willing to add these features myself. Do you have a public version control repository for Bagel? Or should I just attach diffs in replies to this topic?