Commit Graph

21 Commits

Author SHA1 Message Date
cmounce c442701d5d WIP new parser: parse stats 2026-02-13 16:14:46 -08:00
cmounce 962fbcd5ad WIP text parser: parse board terrain 2026-02-11 02:35:10 -08:00
cmounce 8ee51b14b6 WIP New parser 2026-01-31 12:02:06 -08:00
cmounce b8c20f4f8c Change bind indexes to be NonZero<i16> 2026-01-28 14:57:32 -08:00
cmounce dc349e8b95 Move stuff around to prep for future crates
Eventually, I want to take the code for working with the official binary
formats and split it out into a standalone library. The code for parsing
my unofficial text formats would then use that library as a dependency.

I might also spin off the text format code into its own library someday.
It might be useful to have a common text format.

This commit is just anticipatory prep work; I'm definitely not ready to
split this into a bunch of different crates today! I want to firm up the
data structures and the text format first.
2026-01-28 14:57:32 -08:00
cmounce 6899e11aad Add reciprocal marker to board exit comments 2026-01-28 14:57:32 -08:00
cmounce c58658f0b5 Use NonZero type to represent board edge exits
These are the only board indexes in the ZZT file format that cannot
reference the title screen; 0 is reserved to mean "no connection".
This change encodes that in the type system.
2026-01-28 14:57:32 -08:00
cmounce 0419de7ec8 Add comments after bind indexes, board indexes 2026-01-28 14:57:32 -08:00
cmounce a05805b30c Combine enter_x/enter_y into a single param
This matches what we do for stat coordinates and step values.
2026-01-28 14:57:32 -08:00
cmounce 3a886ee86a Revise format for keys, add test for headers 2026-01-28 14:57:32 -08:00
cmounce 7f0f6421d3 Use single params for stat coordinates, step vals
- Combine `x` and `y` into `at`
- Combine `x_step` and `y_step` into `step`
2026-01-28 14:57:32 -08:00
cmounce f59851e2be Use element names, hex colors for under 2026-01-28 14:57:32 -08:00
cmounce 6d3de543fd Only number board headers inside world files 2026-01-28 14:57:32 -08:00
cmounce fe80d9e349 Fix up empty line padding in the text format
- Two blank lines separate major parts (world header, boards)
- Other groups always separated by a single blank line

The intent is to visually cluster together the top-level parts of the
text format, in the hopes of making it more readable.
2026-01-28 14:57:32 -08:00
cmounce 1db3aa84c2 Allow boards, stats to be reordered 2026-01-28 14:57:32 -08:00
cmounce d1a1801ef8 Fix parsing of # comments in text 2026-01-23 03:38:09 -08:00
cmounce 4f6f8fbc1a Set better defaults for a few values 2026-01-22 23:58:10 -08:00
cmounce 00c2873839 Add snapshot tests for roundtrip conversions
The example data is far from perfect, and there's a bunch of small stuff
I want to tweak about the text format. But now the tests exist, which is
a strict improvement from before!
2026-01-22 23:58:10 -08:00
cmounce 3e152b39a8 Initial parser for parsing text into ZZT/BRD files
I ran some limited tests, and the important data seems to survive
roundtrip conversions. It's a bit tricky to measure because conversion
to text strips out/normalizes some data, such as garbage bytes in the
unused portions of Pascal strings.
2026-01-21 02:24:33 -08:00
cmounce a9af6859f3 Add initial text format for .ZZT/.BRD 2026-01-21 01:16:43 -08:00
cmounce 8da41f5fe4 Adapt ZZT world/board parsing from Marzipan 2026-01-20 18:07:11 -08:00