Repository navigation
Data layer: location maps, metatiles, exits and treasures in readable form - #131
Merged
Merged
Conversation
…records - tools/maps.py: the 201 Map_PropsPtrs packs (mapprops pieces) as text: the MapProps header, a hex grid per layer plane and a grid of the attribute triples, as LocLoad_UnkA33B and Map_UnpackTilePlanes read them; the assembler re-makes the runs (every repeat of two or more, up to 256, as all maps are written) and refuses what the reader would not read. Five maps whose stream ends early mark the cells the game takes from WRAM. The 73 whole-table metatile packs (LocGfx_Meta12Ptrs / Meta3Ptrs, metatiles pieces) as four SNES tilemap words per metatile, which the row and column writers send unchanged to the BG tilemaps. The build assembles both to build/maps/ and packs them back byte-exact; verify counts them as "maps". - ExitRom (814 x 7 B) and TreasureRom (249 x 4 B) become records, their counts from their offset tables' end entries. - tools/test_maps.py: round trips, every refusal (22 of 22 fail without their check), the manifest's pieces; in make test-tools and the no-ROM CI job.
- tools/maps.py: derive_named reads the 512 LocRom records' MapProps, Tileset12 and Tileset3 ($FF names none) and check() compares the packs they name with the manifest's mapprops and metatiles pieces, both ways, as graphics.derive_packed does for the packed graphics. The six whole packs no record names (Map_PropsPtrs 10, 30, 141, 172, LocGfx_Meta12Ptrs 54, LocGfx_Meta3Ptrs 3; UNNAMED) stay plain packed pieces. - maps: 197 maps and 71 metatile packs, 555,262 B (was 560,208); packed gains the 4,946 B; the whole ROM is still accounted for. - tools/test_maps.py: derive_named and the comparison on a synthetic ROM and survey, and check() itself on a synthetic ROM, without the ROM; each new check fails a test without it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rebuilds the location map data from readable text (
tools/maps.py). Verify counts it in a newmapscategory (555,262 B), never as source.Only packs a location record names are converted.
maps.derive_namedreads the 512 LocRom records: MapProps as 16 bits, and Tileset12/Tileset3 with$FF(LocRom_SetNone) naming nothing.check()asserts that the named set equals the converted set, asgraphics.derive_packeddoes.Map_PropsPtrs10, 30, 141 and 172,LocGfx_Meta12Ptrs54 andLocGfx_Meta3Ptrs3.Location maps: 197
Map_PropsPtrspacks (380,613 B packed, 995,296 B unpacked).LocLoad_UnkA33Breads the six-byte MapProps header.Map_UnpackTilePlanesthen reads:--------.Metatiles: 71 whole-table packs (174,649 B packed, 253,952 B unpacked).
Map_WriteRow1and the other writers send each metatile's four words unchanged to the BG tilemaps, so they are SNES tilemap words.TTT/Pwith its p, h and v flags.Exits and treasures are records:
ExitRom: 814 × 7 B.TreasureRom: 249 × 4 B, with Tile and Contents read 16-bit byField_CheckTileInFront.Kept as bytes:
Tests.
tools/test_maps.pyruns inmake test-toolsand in the no-ROM CI job. All 22 refusals and the named-set check have a test that fails without them.Merge with main. Main is merged in, including #130. Every gate passes with CHRONORET_REQUIRE_STRACE=1. The whole ROM is still accounted for (MATCH, VERIFIED).
An independent audit found it sound. Its one finding, the unnamed packs, is fixed here.