Skip to content

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

License

Notifications You must be signed in to change notification settings

XorTroll/editwl

Repository files navigation

editwl

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

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.

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.

Supported formats

  • BMG

  • DS(i) ROMs

  • NARC archives (or CARC/ARC)

  • DWC utility archives ("utility.bin")

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

UI

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

CLI

  • BMG: editwl-bin bmg

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

      • Example: editwl-bin bmg list --in=data.bmg
    • 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
    • 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
    • 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
  • ROM: editwl-bin rom

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

      • Example: editwl-bin rom info -r game.nds
    • 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
    • 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
    • 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
    • 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
    • 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
    • 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
  • 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

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.

Building

libnedit

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

editwl-bin

This project is built using make, CMake and Qt:

mkdir build
cd build
cmake ..
make

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-bin

  • More commands

  • More modules

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

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published