Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

editwl

libeditwl

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.

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. This should not be problematic on any modern system, but it's always worth noting ;)

Supported formats

  • BMG

  • DS(i) ROMs

  • NARC archives (or CARC/ARC)

  • DWC utility archives ("utility.bin")

editwl

editwl 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.

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.

GUI mode

  • 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).

CLI mode

  • BMG: editwl bmg

    • List messages: editwl bmg list -i/--in=<bmg-file> [-v/--verbose]

      • Example: editwl bmg list --in=data.bmg
    • Get (print) specific message: editwl bmg get -i/--in=<bmg-file> --idx=<msg-idx>

      • Example (get second message, thus index 1): editwl get -i file.bmg --idx=1
    • Create BMG: editwl bmg create -i/--in=<bmg-xml-file> -o/--out=<bmg-file>

      • Example: editwl bmg create --in=msgs.xml -o gen.bmg
    • Convert BMG (to XML): editwl bmg convert -i/--in=<bmg-file> -o/--out=<xml-file>

      • Example: editwl bmg convert -i data.bmg -o plain_data.xml
  • ROM: editwl rom

    • Show ROM information: editwl rom info -r/--rom=<rom-file>

      • Example: editwl rom info -r game.nds
    • Extract (binary) header: editwl rom extract-header -r/--rom=<rom-file> -o/--out=<header-bin-file>

      • Example: editwl rom extract-header --rom=rom.nds --out=header.bin
    • Extract (binary) overlay table: editwl rom extract-overlay-table -r/--rom=<rom-file> -p/--proc=<processor> -o/--out=<ovt-bin-file>

      • Example: editwl rom extract-overlay-table --rom=rom.nds --proc=arm9 --out=ovt.bin
    • Extract (binary) overlay tables: editwl rom extract-overlay-tables -r/--rom=<rom-file> -7/--out7=<ovt7-bin-file> -9/--out9=<ovt9-bin-file>

      • Example: editwl rom extract-overlay-tables --rom=rom.nds --out7=ovt7.bin -9 ovt9.bin
    • Extract (binary) code: editwl rom extract-code -r/--rom=<rom-file> -p/--proc=<processor> -o/--out=<code-bin-file>

      • Example: editwl rom extract-code --rom=rom.nds --proc=arm7 --out=arm7.bin
    • Extract (binary) codes: editwl rom extract-codes -r/--rom=<rom-file> -7/--out7=<code7-bin-file> -9/--out9=<code9-bin-file>

      • Example: editwl rom extract-codes --rom=rom.nds --out7=arm7.bin -9 arm9.bin
    • Replace (binary) code: editwl rom replace-code -r/--rom=<rom-file> -p/--proc=<processor> -i/--in=<code-bin-file> -o/--out=<new-rom-file>

      • Example: editwl rom replace-code --rom=rom.nds --proc=arm7 --in=arm7.bin --out=new.nds
    • Replace (binary) codes: editwl rom replace-codes -r/--rom=<rom-file> -7/--in7=<code7-bin-file> -9/--in9=<code9-bin-file> -o/--out=<new-rom-file>

      • Example: editwl rom replace-codes --rom=rom.nds -7 arm7.bin --in9=arm9.bin -o new.nds
    • Extract NitroFS filesystem: editwl rom extract-nitrofs -r/--rom=<rom-file> -o/--out=<nitrofs-extract-dir> [-v/--verbose]

      • Example: editwl rom extract-nitrofs --rom=rom.nds -o nitrofs_dir

      • The NitroFS files are stored inside <nitrofs-extract-dir>/root/..., and a XML file map is generated at <nitrofs-extract-dir>/nitrofs.xml containing a file name + file ID list. This is relevant to ensure proper replacement in the command below, since some games might access files based on file ID and not file name!

    • Replace NitroFS filesystem: editwl rom replace-nitrofs -r/--rom=<rom-file> -i/--in=<nitrofs-files-dir> -o/--out=<new-rom-file> [-v/--verbose]

      • Example: editwl rom replace-nitrofs --rom=rom.nds -i nitrofs_dir --out=new.nds -v

      • The command expects the file structure in <nitrofs-files-dir> to be the same as in the extraction command above.

This are brief descriptions of what each command does, check the help subcommand for each main subcommand for more info: editwl <cmd> -h/--help, like editwl bmg -h or editwl rom --help. Commands inside braces (like verbose) are optional.

Building

libeditwl

These libraries have basically no dependencies (other than the standard) and can easily be embedded in any C/C++ project.

editwl

This project is built using make, CMake and Qt. The current build system just requires you to run Make on the project directory:

make

Docs

Inside twl-docs, run MkDocs:

mkdocs build

For libeditwl code docs, run Doxygen on the repository root:

doxygen

TODO

libeditwl

  • 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

editwl

  • More commands

  • More GUI utilities

TODO: make this list more explicit!

Support

Any suggestions, ideas and contributions are always welcome ;)

Credits

About

C++ libraries and various tools for Nintendo DS(i) ROM formats and editing

Topics

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages