@dolphindepot/bnr-cli
v0.1.0
Published
CLI tool to create and inspect Nintendo GameCube opening.bnr files
Downloads
137
Readme
@dolphindepot/bnr-cli
CLI tool to create and inspect Nintendo GameCube opening.bnr files.
Every GameCube disc contains an opening.bnr file with a 96x32 banner image and text metadata (game title, developer, description) shown by the system menu. Two formats exist:
- BNR1 - US/JP region, single language
- BNR2 - Europe (PAL), six languages (EN, DE, FR, ES, IT, NL)
Install
npm install -g @dolphindepot/bnr-cliOr run without installing:
npx --yes @dolphindepot/bnr-cli <command>Usage
Decode a .bnr file
Extract the banner image as PNG and text metadata as JSON:
bnr decode opening.bnr
# writes opening.png + opening.json
bnr decode opening.bnr -o output/
# writes output/opening.png + output/opening.jsonOutput JSON for BNR1:
{
"type": "BNR1",
"text": {
"gameNameShort": "My Game",
"developerNameShort": "Dev",
"gameTitle": "My Game: Full Title",
"developerName": "Developer Studio",
"description": "A short game description."
}
}Output JSON for BNR2:
{
"type": "BNR2",
"texts": [
{ "gameTitle": "My Game", "description": "English description", "..." : "..." },
{ "gameTitle": "Mein Spiel", "description": "Deutsche Beschreibung", "...": "..." },
"... (FR, ES, IT, NL)"
]
}Encode a .bnr file
From CLI arguments
bnr encode \
--image banner.png \
--title "My Game" \
--short-title "MyGame" \
--developer "Dev Studio" \
--short-developer "Dev" \
--description "A cool homebrew game." \
-o opening.bnrFrom a JSON file
bnr encode --meta game.json -o opening.bnrWhere game.json looks like:
{
"type": "BNR1",
"image": "banner.png",
"text": {
"gameTitle": "My Game",
"gameNameShort": "MyGame",
"developerName": "Dev Studio",
"developerNameShort": "Dev",
"description": "A cool homebrew game."
}
}CLI arguments override JSON values:
bnr encode --meta game.json --title "New Title" -o opening.bnrBNR2 with per-language text
Use language-suffixed flags (-en, -de, -fr, -es, -it, -nl) to set text per language. Unsuffixed flags set the base for all languages:
bnr encode --type BNR2 --image banner.png \
--title "My Game" \
--developer "Dev Studio" \
--description "English description" \
--description-de "Deutsche Beschreibung" \
--description-fr "Description en francais" \
-o opening.bnrOr provide all translations in JSON:
{
"type": "BNR2",
"image": "banner.png",
"texts": [
{ "gameTitle": "My Game", "description": "English", "...": "..." },
{ "gameTitle": "Mein Spiel", "description": "Deutsch", "...": "..." },
{ "gameTitle": "Mon Jeu", "description": "Francais", "...": "..." },
{ "gameTitle": "Mi Juego", "description": "Espanol", "...": "..." },
{ "gameTitle": "Il Mio Gioco", "description": "Italiano", "...": "..." },
{ "gameTitle": "Mijn Spel", "description": "Nederlands", "...": "..." }
]
}Newlines
Use \n in CLI arguments for line breaks:
bnr encode --description "Line one\nLine two" --image banner.png -o opening.bnrIn JSON files, standard JSON escaping works as expected.
CI usage
Generate opening.bnr as part of your build pipeline:
- run: npx --yes @dolphindepot/bnr-cli encode --meta game.json -o opening.bnr