Skip to content

Commit

Permalink
Updated README with all formats
Browse files Browse the repository at this point in the history
- The table in the README contains all formats, including up-to-date
  info on whether each can be read/written for dread/SR or is missing
- made blsnd files readable by both games
  • Loading branch information
steven11sjf committed Jul 13, 2024
1 parent dc45bec commit bbc70c0
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 11 deletions.
79 changes: 70 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,76 @@
# Mercury Engine Data Structures
Construct type definitions for Mercury Engine

| Format | Samus Returns (Read) | Samus Returns (Write) | Dread (Read) | Dread (Write) |
| -------- |----------------------| --------------------- | ------------ | ------------- |
| PKG | ✓ | ✓ | ✓ | ✓ |
| BMSAD | ✓ | ✓ | ✓ | ✓ |
| BMSSD | ✓ | ✓ | ✓ | ✓ |
| BRFLD | Missing | Missing | ✓ | ✓ |
| BMSLD | ✓ | ✓ | Missing | Missing |
| BMSCC | ✓ | ✓ | ✓ | ✓ |
| BRSA | Missing | Missing | ✓ | ✓ |
| Format | Samus Returns (Read) | Samus Returns (Write) | Dread (Read) | Dread (Write) |
|-----------|----------------------|-----------------------|--------------|---------------|
| BAPD | Missing | Missing | ✗ | ✗ |
| BCCAM | ✗ | ✗ | ✗ | ✗ |
| BCLGT | ✗ | ✗ | Missing | Missing |
| BCMDL | ✗ | ✗ | ✓ | ✗ |
| BCPTL | ✗ | ✗ | ✗ | ✗ |
| BCSKLA | ✗ | ✗ | ✗ | ✗ |
| BCTEX | ✗ | ✗ | ✓ | ✗ |
| BCURV | Missing | Missing | ✗ | ✗ |
| BCUT | ✗ | ✗ | Missing | Missing |
| BCWAV | ✗ | ✗ | Missing | Missing |
| BFGRP | Missing | Missing | ✗ | ✗ |
| BFONT | ✗ | ✗ | ✗ | ✗ |
| BFSAR | Missing | Missing | ✗ | ✗ |
| BFSTM | Missing | Missing | ✗ | ✗ |
| BGSNDS | Missing | Missing | ✗ | ✗ |
| BLDEF | Missing | Missing | ✓ | ✓ |
| BLSND | ✓ | ✓ | ✓ | ✓ |
| BLUT | Missing | Missing | ✗ | ✗ |
| BMBLS | Missing | Missing | ✓ | ✓ |
| BMDEFS | ✗ | ✗ | ✗ | ✗ |
| BMMAP | Missing | Missing | ✓ | ✓ |
| BMMDEF | Missing | Missing | ✓ | ✓ |
| BMSAD | ✓ | ✓ | ✓ | ✓ |
| BMSAS | Missing | Missing | ✓ | ✓ |
| BMSAT | ✗ | ✗ | ✗ | ✗ |
| BMSBK | ✓ | ✓ | Missing | Missing |
| BMSCC | ✓ | ✓ | ✓ | ✓ |
| BMSCD | ✓ | ✓ | ✓ | ✓ |
| BMSCP | Missing | Missing | ✓ | ✓ |
| BMSCU | ✗ | ✗ | ✓ | ✓ |
| BMSEM | ✗ | ✗ | Missing | Missing |
| BMSES | ✓ | ✓ | Missing | Missing |
| BMSEV | ✗ | ✗ | Missing | Missing |
| BMSLD | ✓ | ✓ | Missing | Missing |
| BMSLGROUP | Missing | Missing | ✓ | ✓ |
| BMSLINK | Missing | Missing | ✓ | ✓ |
| BMSMD | ✓ | ✓ | Missing | Missing |
| BMSMSD | ✓ | ✓ | Missing | Missing |
| BMSNAV | ✗ | ✗ | ✓ | ✓ |
| BMSND | ✗ | ✗ | Missing | Missing |
| BMSSA | ✗ | ✗ | Missing | Missing |
| BMSSD | ✗ | ✗ | ✓ | ✓ |
| BMSSH | Missing | Missing | ✗ | ✗ |
| BMSSK | Missing | Missing | ✓ | ✓ |
| BMSSS | Missing | Missing | ✓ | ✓ |
| BMSSTOC | Missing | Missing | ✗ | ✗ |
| BMTRE | ✗ | ✗ | ✓ | ✓ |
| BMTUN | ✓ | ✓ | Missing | Missing |
| BNVIB | Missing | Missing | ✗ | ✗ |
| BPSI | ✗ | ✗ | ✗ | ✗ |
| BPTDAT | Missing | Missing | ✗ | ✗ |
| BPTDEF | Missing | Missing | ✗ | ✗ |
| BREM | Missing | Missing | ✓ | ✓ |
| BRES | Missing | Missing | ✓ | ✓ |
| BREV | Missing | Missing | ✓ | ✓ |
| BRFLD | Missing | Missing | ✓ | ✓ |
| BRSA | Missing | Missing | ✓ | ✓ |
| BRSPD | Missing | Missing | ✗ | ✗ |
| BSHDAT | ✗ | ✗ | ✗ | ✗ |
| BSMAT | Missing | Missing | ✓ | ✓ |
| BTUNDA | Missing | Missing | ✓ | ✓ |
| BUCT | ✗ | ✗ | ✗ | ✗ |
| INI | Missing | Missing | ✓ | ✓ |
| LC | ✓ | ✓ | ✓ | ✓ |
| PKG | ✓ | ✓ | ✓ | ✓ |
| TOC | ✓ | ✓ | ✓ | ✓ |
| TXT | ✓ | ✓ | ✓ | ✓ |
| WEBM | Missing | Missing | ✗ | ✗ |


## Example Usage
Expand Down
9 changes: 7 additions & 2 deletions src/mercury_engine_data_structures/formats/blsnd.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,22 @@
Const,
Construct,
Hex,
IfThenElse,
Int32ul,
Struct,
)

from mercury_engine_data_structures.common_types import StrId, make_vector
from mercury_engine_data_structures.formats import BaseResource
from mercury_engine_data_structures.game_check import Game
from mercury_engine_data_structures.game_check import Game, current_game_at_most

BLSND = Struct(
"_magic" / Const(b"LSND"),
"version" / Const(0x000B0001, Hex(Int32ul)),
"version" / IfThenElse(
current_game_at_most(Game.SAMUS_RETURNS),
Const(0x000B0001, Hex(Int32ul)),
Const(0x000C0001, Hex(Int32ul))
),
"unk" / Int32ul,
"sound_limits" / make_vector(Struct(
"name" / StrId,
Expand Down

0 comments on commit bbc70c0

Please sign in to comment.