Giter VIP home page Giter VIP logo

bnrtool's Introduction

bnrtool

bnrtool is a tool that can extract and create Nintendo GameCube Banner (.bnr) files.

Table of Contents

Info

Nintendo GameCube Banner files (.bnr) represent the image and text you'd see when the disc side of the cube menu. They are in every disc as a file entry "opening.bnr", "peningUS.bnr", "openingEU.bnr", and/or "openingJP.bnr".

bnrtool can extract and create these files.

This tool has two modes: export and import.

  • In export mode, it can extract a BNR file to a TGA image and TXT document.
  • In import mode, it can create a BNR file from a TGA image and TXT document in either BNR1 or BNR2 format.

bnrtool does not handle game disc files, it only works on BNR files alone. You can use Dolphin (you can get it here) to extract the BNR file itself to work on it. For repacking the game disc file after modifying the BNR, there are many tools but I recommend nodtool which you can find here.

bnrtool extracts the image into TGA image in "Original TGA Format" with 32bit BGRA colors with 1 bit alpha and no coordinate flipping bits set aswell as a width and height of 96 by 32. It expects this in import mode aswell. If you use a "New TGA Format" TGA for import mode, the footer in this format will be ignored.

bnrtool extracts the comment(s) into a TXT document split into blocks of 5 lines. For BNR1, it's 1 block. For BNR2, it's 6 blocks. In BNR1, the block can be of any language. For BNR2, each block represents a language in this order: Comment #1 - English, Comment #2 - German, Comment #3 - French, Comment #4 - Spanish, Comment #5 - Italian, and Comment #6 - Dutch. For both BNR1 and BNR2, comment blocks consists of 5 lines each. The first line is the game title in short form (32 characters max, single line). The second line is the game maker (company) in short form (32 characters max, single line). The third line is the game title in long form (64 characters max, single line). The fourth line is the game maker (company) in long form (64 characters max, single line). Finally, the fifth line is the game comment ( description) (128 characters max, 2 lines max). Empty lines are accepted.

Building

Simply run ./compile.sh at root directory of project. This script uses GCC to compile the sources. It also computes the md5, sha1, and sha256 hash of the compiled result afterwards using md5sum, sha1sum, and sha256sum. You can pass asan as the first argument to the script to build a debug build with AddressSanitizer (this isn't supported on a Windows build). For building for Windows, run this script with MYS2's MinGW x64 or run .\compile.bat.

Credits

  • Custom Mario Kart Wiiki for it's documentation of the image formats of Nintendo GameCube's GX graphics system here.
  • Truevision Inc.'s documentation on the Targa (TGA) image format here.
  • FileFormat's documentation on the Targe (TGA) image format here.
  • Paul Bourke's documentation on the Targe (TGA) image format here.
  • Dan Cross's implementation of strsep here. "All of the C code on this page is public domain and may be used without concern for licenses.".
  • Yet Another Gamecube Documentation for it's documentation of BNR here.
  • SweetScape's 010 Editor for BNR format research here.

License

MIT License

Copyright (c) 2022 Yonder

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

bnrtool's People

Contributors

xchellx avatar

Stargazers

 avatar

Watchers

 avatar

bnrtool's Issues

Well its true

You gonna provide me with a fix. This is masked so well its not funny

Virus

Yea this is a very well put togethervirus

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.