diff --git a/ROADMAP.md b/ROADMAP.md index 2dd53af4a..190e91c87 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -702,7 +702,7 @@ folder, `src/decompnet/consoles//`; a new console adds a column (CONTRIBUTIN | Feature | N64 | PS1 | PS2 | PSP | GameCube · Wii | Windows PC | DS | Public decomps | | :-- | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | | Loader/buffer tracing, named contracts and small wrappers | ✓ MIPS / named PI DMA | ✓ MIPS static | ✓ MIPS EE EABI | ✓ shared MIPS reader | — original image adapter | — original image adapter | — original image adapter | — original image adapter | -| Automatic texture banks (CI4/CI8, mixed CI8 palettes, RGBA32, RGBA16 mipmaps, RNC 1/2, named four-block banks, embedded ZIP packs, textures loaded by uncompressed display lists, I64 images in a chunked-RNC filesystem, model textures in a deflated asset table, UVTX files in a UV FORM filesystem, a texture table of back-reference-packed textures with inferred widths, display-list textures and sprites in a table of relocatable VPK0 files; a fork's own splat image segments and JSON asset lists) | ✓ ROM | — native formats planned | — native formats planned | — native formats planned | — image adapter | — image adapter | — image adapter | ✓ forks with the game file (N64 checked) | +| Automatic texture banks (CI4/CI8, mixed CI8 palettes, RGBA32, RGBA16 mipmaps, RNC 1/2, named four-block banks, embedded ZIP packs, textures loaded by uncompressed display lists, I64 images in a chunked-RNC filesystem, model textures in a deflated asset table, UVTX files in a UV FORM filesystem, a texture table of back-reference-packed textures with inferred widths, display-list textures and sprites in a table of relocatable VPK0 files, image packs and model bitmaps in a party-game series' main filesystem; a fork's own splat image segments and JSON asset lists) | ✓ ROM | — native formats planned | — native formats planned | — native formats planned | — image adapter | — image adapter | — image adapter | ✓ forks with the game file (N64 checked) | | Audio browser, filters, sortable samples and explicit WAV preparation | ✓ ROM | ✓ ROM | ✓ ROM | ✓ ROM | — original image adapter | — original image adapter | — original image adapter | — original image adapter | | Texture gallery, filters and distinct address / loader reference links | ✓ ROM | ✓ ROM | ✓ ROM | ✓ ROM | — original image adapter | — original image adapter | — original image adapter | ✓ forks with the game file (N64 checked) | | Native directory roles: animation, collision, placements, grid, sequences and demos | ✓ validated schema / linked records | — native formats planned | — native formats planned | — native formats planned | — original image adapter | — original image adapter | — original image adapter | — original image adapter | @@ -1947,7 +1947,9 @@ Phases: chunked-RNC filesystem (I64 images) and a platformer sequel's deflated model table. Done in 0.5.0: the UV FORM filesystem of a flight game and a beetle racer (UVTX files drawn by their own display lists). Done in 0.6.0: a demolition game's texture table and its six codecs (widths inferred, 96% agree with its decompilation). Done in - 0.7.0: a fighting game's relocatable file table (VPK0, pointer chains, display lists and sprites). + 0.7.0: a fighting game's relocatable file table (VPK0, pointer chains, display lists and sprites). Done in 0.8.0: + a party-game series' main filesystem (three packings, image packs, FORM model bitmaps). +- That series' HVQ-compressed backgrounds are not decoded yet. - That fighting game's material textures (MObjSub, sized by the code that draws them) are not shown yet. - That demolition game's widths could come from the code that draws each texture instead of being inferred. - UVTX files whose palette is another texture file (which one comes from the level) are not shown yet. diff --git a/pyproject.toml b/pyproject.toml index 6dee27554..bfc3a345f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ dependencies = [ # the repair families, RetroReversing/decomp-repair: a tagged archive, so installing needs no git "decomprepair @ https://github.com/RetroReversing/decomp-repair/archive/refs/tags/v0.4.0.tar.gz", # the asset recognisers (N64 textures, sound banks, models, fonts; RNC), RetroReversing/decomp-assets - "decompassets @ https://github.com/RetroReversing/decomp-assets/archive/refs/tags/v0.7.0.tar.gz", + "decompassets @ https://github.com/RetroReversing/decomp-assets/archive/refs/tags/v0.8.0.tar.gz", "httpx>=0.28", "uvicorn>=0.30", "ninja>=1.11", # builds GameCube/Wii (dtk) and other ninja-based decomp projects diff --git a/src/decompnet/forks/project.py b/src/decompnet/forks/project.py index ea60112df..13184da07 100644 --- a/src/decompnet/forks/project.py +++ b/src/decompnet/forks/project.py @@ -403,9 +403,11 @@ def segments_for(self, image: Path, version: str | None, config: dict | None = N if config is None: return [], 0 try: + size = image.stat().st_size + # A config may name an empty overlay (its next segment starts where it does): it maps nothing. segments = [dict(name=s.name, rom_start=s.rom_start, rom_end=s.rom_end, vram=s.vram) - for s in segments_from_config_data(config)] - except (TypeError, ValueError, KeyError): + for s in segments_from_config_data(config) if 0 <= s.rom_start < s.rom_end <= size] + except (OSError, TypeError, ValueError, KeyError): return [], 0 gp = config["options"].get("gp_value") return segments, gp if isinstance(gp, int) else 0 diff --git a/tests/test_rom_explorer.py b/tests/test_rom_explorer.py index 4b572025f..16fc85221 100644 --- a/tests/test_rom_explorer.py +++ b/tests/test_rom_explorer.py @@ -315,6 +315,18 @@ def test_a_fork_config_that_splits_another_image_maps_no_segments(fork): assert all(not r['mappings'] for r in rom_explorer.listing(net,'game')['regions']) +def test_a_fork_config_with_an_empty_code_segment_still_explores(fork): + """An overlay whose next segment starts where it does maps nothing, and doesn't stop the scan.""" + net,pid,root=fork + (root/'game.yaml').write_text('options:\n target_path: game.z64\nsegments:\n' + ' - {name: main, type: code, start: 0x1000, vram: 0x80000400}\n' + ' - {name: empty, type: code, start: 0x1100, vram: 0x80100000}\n - [0x1100]\n') + with net.progress.view(): + rom_explorer.run(net,'game',Log()) + mapped={m['segment'] for r in rom_explorer.listing(net,'game')['regions'] for m in r['mappings']} + assert mapped=={'main'} + + def test_a_fork_without_the_recorded_game_is_explained(fork): net,pid,root=fork (root/'game.z64').write_bytes(bytes(0x1300)) diff --git a/uv.lock b/uv.lock index 1aead1003..d9ff0923b 100644 --- a/uv.lock +++ b/uv.lock @@ -291,9 +291,9 @@ wheels = [ [[package]] name = "decompassets" -version = "0.7.0" -source = { url = "https://github.com/RetroReversing/decomp-assets/archive/refs/tags/v0.7.0.tar.gz" } -sdist = { hash = "sha256:0c89099361f05c21adcb70161b22baba7c8d575e7ee07d05b57e936aa916d1f4" } +version = "0.8.0" +source = { url = "https://github.com/RetroReversing/decomp-assets/archive/refs/tags/v0.8.0.tar.gz" } +sdist = { hash = "sha256:e6f9fe4ae0c83d376df8fb6788566c9a74c18aaed72c882552a7beeb7644febe" } [[package]] name = "decompnet" @@ -329,7 +329,7 @@ dev = [ [package.metadata] requires-dist = [ { name = "capstone", specifier = ">=5.0.9" }, - { name = "decompassets", url = "https://github.com/RetroReversing/decomp-assets/archive/refs/tags/v0.7.0.tar.gz" }, + { name = "decompassets", url = "https://github.com/RetroReversing/decomp-assets/archive/refs/tags/v0.8.0.tar.gz" }, { name = "decomprepair", url = "https://github.com/RetroReversing/decomp-repair/archive/refs/tags/v0.4.0.tar.gz" }, { name = "httpx", specifier = ">=0.28" }, { name = "mcp", specifier = ">=2.3.0" },