C++ libraries and PC tools for Nintendo DS(i) ROM formats/editing
libeditwl
libraries are the core component of this project. They consist on lightweight C++ libraries for DS(i) ROM format reading, writing, editing and more.
While the libraries are not properly documented yet, it can be helpful to check editwl-bin modules as examples.
Note that these libraries work by loading everything (entire ROMs/files/etc) into memory (similar to other existing DS(i) tools/libraries). In worst cases (loading big ROMs with compressed files), the code may allocate hundreds of MB to store everything.
-
BMG
-
DS(i) ROMs
-
NARC archives (or CARC/ARC)
-
DWC utility archives ("utility.bin")
editwl-bin
is (yet another) desktop Nintendo DS(i) ROM editor, made from scratch and inspired on already existing ones, aiming to mimic the best of them. It is modular, hence it may be extended with custom format modules.
This tool may be used as both a graphical editor (by opening it with no arguments or a single file argument, typically by drag-dropping the file in the executable from a UI file browser) or as a command-line tool, getting the best of both worlds.
Features:
-
BMG
-
Edit messages and other fields (file ID and so on), with a custom format to handle escaping
-
Save/load in a custom XML format for easier message editing (see docs).
-
-
BMG:
editwl-bin bmg
-
List messages:
editwl-bin bmg list -i/--in=<bmg-file> [-v/--verbose]
- Example:
editwl-bin bmg list --in=data.bmg
- Example:
-
Get (print) specific message:
editwl-bin bmg get -i/--in=<bmg-file> --idx=<msg-idx>
- Example (get second message, thus index
1
):editwl-bin get -i file.bmg --idx=1
- Example (get second message, thus index
-
Create BMG:
editwl-bin bmg create -i/--in=<bmg-xml-file> -o/--out=<bmg-file>
- Example:
editwl-bin bmg create --in=msgs.xml -o gen.bmg
- Example:
-
Convert BMG (to XML):
editwl-bin bmg convert -i/--in=<bmg-file> -o/--out=<xml-file>
- Example:
editwl-bin bmg convert -i data.bmg -o plain_data.xml
- Example:
-
-
ROM:
editwl-bin rom
-
Show ROM information:
editwl-bin rom info -r/--rom=<rom-file>
- Example:
editwl-bin rom info -r game.nds
- Example:
-
Extract (binary) header:
editwl-bin rom extract-header -r/--rom=<rom-file> -o/--out=<header-bin-file>
- Example:
editwl-bin rom extract-header --rom=rom.nds --out=header.bin
- Example:
-
Extract (binary) overlay table:
editwl-bin rom extract-overlay-table -r/--rom=<rom-file> -p/--proc=<processor> -o/--out=<ovt-bin-file>
- Example:
editwl-bin rom extract-overlay-table --rom=rom.nds --proc=arm9 --out=ovt.bin
- Example:
-
Extract (binary) overlay tables:
editwl-bin rom extract-overlay-tables -r/--rom=<rom-file> -7/--out7=<ovt7-bin-file> -9/--out9=<ovt9-bin-file>
- Example:
editwl-bin rom extract-overlay-tables --rom=rom.nds --out7=ovt7.bin -9 ovt9.bin
- Example:
-
Extract (binary) code:
editwl-bin rom extract-code -r/--rom=<rom-file> -p/--proc=<processor> -o/--out=<code-bin-file>
- Example:
editwl-bin rom extract-code --rom=rom.nds --proc=arm7 --out=arm7.bin
- Example:
-
Extract (binary) codes:
editwl-bin rom extract-codes -r/--rom=<rom-file> -7/--out7=<code7-bin-file> -9/--out9=<code9-bin-file>
- Example:
editwl-bin rom extract-codes --rom=rom.nds --out7=arm7.bin -9 arm9.bin
- Example:
-
Replace (binary) code:
editwl-bin rom replace-code -r/--rom=<rom-file> -p/--proc=<processor> -i/--in=<code-bin-file> -o/--out=<new-rom-file>
- Example:
editwl-bin rom replace-code --rom=rom.nds --proc=arm7 --in=arm7.bin --out=new.nds
- Example:
-
-
Replace (binary) codes:
editwl-bin rom replace-codes -r/--rom=<rom-file> -7/--in7=<code7-bin-file> -9/--in9=<code9-bin-file> -o/--out=<new-rom-file>
- Example:
editwl-bin rom replace-codes --rom=rom.nds -7 arm7.bin --in9=arm9.bin -o new.nds
- Example:
This are brief descriptions of what each command does, check the help subcommand for each main subcommand for more info: editwl-bin <cmd> -h/--help
, like editwl-bin bmg -h
or editwl-bin rom --help
.
These libraries have basically no dependencies (other than the standard) and can easily be embedded in any C/C++ project.
This project is built using make, CMake and Qt:
mkdir build
cd build
cmake ..
make
-
Migrate remaining code/formats from libnedit:
-
NCGR
-
NCLR
-
NSCR
-
SBNK
-
SDAT
-
SSEQ
-
STRM
-
SWAR
-
-
Implement saving texture as NCGR+NCLR+NSCR
-
Implement saving in utility.bin files
-
Support other formats within SDATs (STRM, SSEQ, etc.)
-
Models and model textures (NSBMD, NSBTX)
-
Support for remaining BMG message encodings
-
For multiple palette NCGR+NCLR textures, allow choosing the palette to load
-
Support ignored attributes in NSCR data (check the links credited below)
-
Support PMCP section in NCLRs
-
More that I could list here
-
More commands
-
More modules
TODO: make this list more explicit
Any suggestions, ideas and contributions are always welcome ;)
-
Some already existing PC ROM editors were really helpful in order to understand several file formats, and as the base for this PC editor: Every File Explorer, NSMBe5, MKDS Course Modifier and DS Sound Studio
-
The following web pages were also really helpful in order to understand several file formats:
-
The nintendo-lz Rust crate was really helpful in order to understand and implement LZ10/LZ11 compression formats in C++.
-
editwl-bin
uses args C++ libraries to parse command-line arguments.