OpenSNES
Modern Open-Source SNES Development SDK
Loading...
Searching...
No Matches
Legacy tools

Before the opensnes-* family, the SDK shipped eight converters: gfx4snes and smconv (from PVSnesLib), tmx2snes, img2snes, font2snes, wav2brr, palplan and aseprite2snes. They are no longer shipped: each one's converter is linked into the tool that replaced it, which writes the same bytes. This page is for someone holding a project that used them: what each tool did, and the opensnes-* command that replaces it, option by option. A new project starts from The OpenSNES toolbox.

Moving an asset over is one settings file beside it (res/hero.png.toml, with a tool line and one table, The opensnes-* tools: conventions): the build then converts it on its own, and the old Makefile line goes. A project that still sets GFXSRC stops with a message naming the replacement; the .wav → .brr rule is gone too (a .wav.toml beside the sound replaces it). Music needs nothing: SOUNDBANK_SRC works as before, converted by opensnes-music — Impulse Tracker to soundbank.

gfx4snes

Converts an indexed PNG or BMP into tiles (.pic), a palette (.pal) and, with -m, a tilemap (.map); with -T it also writes a metasprite table. A background is now opensnes-tileset convert (opensnes-tileset — pictures to tilesets and tilemaps), a sprite sheet opensnes-sprite sheet (opensnes-sprite — sheets, metasprites and Aseprite clips).

gfx4snes opensnes-tileset convert / opensnes-sprite sheet
-i FILE the input, positional
-m (a background) opensnes-tileset convert writes the map
no -m (a sprite sheet) opensnes-sprite sheet
-s N --size N (tileset 8 or 16, sprite 8 to 64)
-u 4 / -u 16 / -u 256 --bpp 2 / --bpp 4 / --bpp 8
-o N --colors N
-p the palette is written by default; --no-palette skips it
-c FILE --palette FILE
-e N --palette-entry N
-a --rearrange (tileset)
-d --round
-b, -k, -z --blank, --pack, --lz
-f N, -g --offset N, --priority (tileset)
-y, -R, -F --pages, --no-reduce, --flip (tileset); -F is --flip on a sheet too
-M N --mode N (tileset; 7 writes the .pc7 / .mp7 pair)
-T -X W -Y H --metasprite W H (sprite)
-P N --priority N (sprite)
-t png\|bmp no equivalent: the format is read from the file
-W, -H, -S no equivalent
-q -q

In a Makefile, GFXSRC := hero.png becomes res/hero.png.toml with tool = "opensnes-sprite" and a [sheet] table (or opensnes-tileset and [convert] for a background).

tmx2snes

Converts a Tiled map exported as JSON, against the .map of its tileset, into the tilemap per layer (.m16), the tile tables (.t16, .b16) and the objects (.o16). Now opensnes-level convert (opensnes-level — Tiled levels to SNES map data).

tmx2snes opensnes-level convert
map.tmj (first argument) the input, positional
tileset.map (second argument) --tileset tileset.map
-e --entities (writes <stem>_entities.inc)
-Q --quadrant
-C --collision
-q -q

The explicit tmx2snes line of a Makefile becomes res/map.tmj.toml with tool = "opensnes-level" and a [convert] table naming the tileset; the build converts the level after its tileset.

img2snes

Quantizes RGB or RGBA art into an indexed PNG of a chosen number of colours, the input the picture tools need. Now opensnes-palette quantize (opensnes-palette — a project's palettes).

img2snes opensnes-palette quantize
-i FILE the input, positional
-o FILE no equivalent for the name: --out DIR writes <stem>_indexed.png there
-c N --colors N
--round-snes --round
-p ref.png --palette ref.png (or a .pal)
-s FACTOR --scale PERCENT (-s 2.0 is --scale 200)
-t N --align N
--batch several inputs on the command line
-q, -v -q, -v

font2snes

Packs a picture of the 96 glyphs of ASCII 32..127 into 2 bpp or 4 bpp text tiles. Now opensnes-text font (opensnes-text — bitmap fonts for the text module), which also writes a grey palette and the .inc that declares the tiles.

font2snes opensnes-text font
input.png output the input, positional; the outputs are named after it (--out DIR to place them)
-b N --bpp N
-c (a C header) no equivalent: the tiles are .incbin data declared by the .inc
-v -v

wav2brr

Encodes a PCM .wav into a .brr sample for the DSP. Now opensnes-sample encode (opensnes-sample — WAV to BRR samples), which writes the same bytes and a .h with the sample's sizes and loop point.

wav2brr opensnes-sample encode
input.wav [output.brr] the input, positional; the output is named after it (--out DIR to place it)
--loop START END --loop START END (--save keeps it in input.wav.toml)
-v -v; opensnes-sample inspect gives the figures

A looping sample no longer has to be built by hand: the loop lives in the settings file, and the build encodes it.

palplan

Plans a project's .pal files into the 8 background and 8 sprite palette slots of CGRAM and writes the PAL_<NAME>_CGRAM offsets. Now opensnes-palette plan (opensnes-palette — a project's palettes), which the build runs after the pictures' conversions.

palplan opensnes-palette plan
a manifest of name type file lines a settings file with a [plan] table: bg = [...], sprite = [...], in slot order; the name is the file's stem
-o FILE (the header) <stem>.inc, beside the settings file or in --out DIR
-b FILE (the CGRAM image) --cgram (cgram = true)
-t N --hints N
-q -q

aseprite2snes

Turns the JSON Aseprite writes with --data --list-tags into AnimClip tables, one per tag, for the anim module. Now opensnes-sprite anim (opensnes-sprite — sheets, metasprites and Aseprite clips).

aseprite2snes opensnes-sprite anim
export.json the input, positional
-o FILE (stdout by default) <stem>_anim.h, beside the input or in --out DIR
-p PREFIX --prefix NAME
-t STRIDE --stride N
-f FPS --fps N

smconv

Converted Impulse Tracker modules into a SNESMOD soundbank, or a standalone .spc. Replaced by opensnes-music (opensnes-music — Impulse Tracker to soundbank), which the build runs for SOUNDBANK_SRC.

smconv opensnes-music
smconv -s -o NAME -b N -n -p NAME a.it b.it opensnes-music bank a.it b.it --name NAME --bank N
smconv -s -f ... --same-size
smconv a.it (an .spc) opensnes-music spc a.it
smconv -V (RAM usage) opensnes-music inspect
-i (HiROM) the build relocates the origin, as before