Nintendo 64 ROM utility written in Go.

rom64


Nintendo 64 ROM utility written in Go.

Commands

  • ls - List information about all ROMs in a directory
  • info - Show information about a single ROM
  • convert - Convert a ROM file to the native (Z64, Big-endian) format
  • validate - Validate the ROM's SHA-1 checksum against a list of known-good ROM dumps.

rom64 ls

List ROM files in a given directory. By default, output is in a human-readable table.

Options

  • -f, --format Defaults to table but can also be text, json, csv, tab
  • -c, --columns Defaults to most useful columns. Can be a comma-separated list, or specified multiple times.

Available columns

Column ID Description
cic CIC chip type. example: 6102
crc1 CRC1 checksum of ROM internals. Also known as 'CRC HI'
crc2 CRC2 checksum of ROM internals. Also known as 'CRC LO'
file_format File format code. One of: z64, v64, n64
file_format_desc File format description. example: Big-endian
file_name File name on disk
file_size_mbits File size in megabits. Always a whole number. example: 256
file_size_mbytes File size in megabytes. Always a whole number. example: 32
image_name Image name / game title embedded in the ROM.
md5 MD5 hash/checksum of the file on disk. Lower-case hexadecimal.
region Region description of the ROM derived from the ROM ID.
rom_id ROM ID / serial. example: NSME for Super Mario 64 (USA)
sha1 SHA-1 hash/checksum of the file on disk. Lower-case hexadecimal.
version Version of the ROM. One of: 1.0, 1.1, 1.2, or 1.3.
video_system Video system derived from the ROM region. NTSC or PAL.
$ rom64 ls ~/Downloads/n64 -c image_name,file_format_desc,rom_id,region,video_system,cic,file_size_mbits,md5,file_name
+----------------------+--------------+--------+--------+-------+------+-----------+----------------------------------+-----------------------------------------------------------+
|      Image Name      | File Format  | Rom ID | Region | Video | CIC  | Size (Mb) |               MD5                |                         File Name                         |
+----------------------+--------------+--------+--------+-------+------+-----------+----------------------------------+-----------------------------------------------------------+
| 1080 SNOWBOARDING    | Big-endian   | NTEA   | JP/US  | NTSC  | 6103 |       128 | fa27089c425dbab99f19245c5c997613 | 1080 Snowboarding (Japan, USA) (En,Ja).z64                |
| BANJO TOOIE          | Big-endian   | NB7E   | US     | NTSC  | 6105 |       256 | 40e98faa24ac3ebe1d25cb5e5ddf49e4 | Banjo-Tooie (USA).z64                                     |
| CONKER BFD           | Big-endian   | NFUE   | US     | NTSC  | 6105 |       512 | 00e2920665f2329b95797a7eaabc2390 | Conker's Bad Fur Day (USA).z64                            |
| Diddy Kong Racing    | Big-endian   | NDYE   | US     | NTSC  | 6103 |        96 | b31f8cca50f31acc9b999ed5b779d6ed | Diddy Kong Racing (USA) (En,Fr) (Rev A).z64               |
| DONKEY KONG 64       | Big-endian   | NDOE   | US     | NTSC  | 6105 |       256 | 9ec41abf2519fc386cadd0731f6e868c | Donkey Kong 64 (USA).z64                                  |
| F1 WORLD GRAND PRIX2 | Byte-swapped | NF2P   | EU     | PAL   | 6102 |        96 | 2eb7766279c6b84d912c80aaa725bb6d | F-1 World Grand Prix II (Europe) (En,Fr,De,Es).n64        |
| F-ZERO X             | Big-endian   | NFZP   | EU     | PAL   | 6106 |       128 | ee79a8fe287b5dcaea584439363342fc | F-ZERO X (E) [!].z64                                      |
| F-ZERO X             | Byte-swapped | NFZP   | EU     | PAL   | 6106 |       128 | 7b2d9e24e6535be213ba036efe618e31 | F-Zero X (Europe).n64                                     |
| F-ZERO X             | Big-endian   | NFZP   | EU     | PAL   | 6106 |       128 | ee79a8fe287b5dcaea584439363342fc | F-Zero X (Europe).z64                                     |
| F-ZERO X             | Big-endian   | CFZE   | US     | NTSC  | 6106 |       128 | 753437d0d8ada1d12f3f9cf0f0a5171f | F-Zero X (USA).z64                                        |
| GOLDENEYE            | Byte-swapped | NGEE   | US     | NTSC  | 6102 |       128 | 08becb418039bcaf948dff73b9fe177b | Goldeneye.v64                                             |
| HSV ADVENTURE RACING | Byte-swapped | NNSX   | EU     | PAL   | 6102 |       128 | 1d8f8ca47fe02d1950e7a9725822414e | HSV Adventure Racing! (Australia).n64                     |
| HSV ADVENTURE RACING | Big-endian   | NNSX   | EU     | PAL   | 6102 |       128 | 26f7d8f4640ebdfa823f84e5f89d62bf | HSV Adventure Racing! (Australia).z64                     |
| JET FORCE GEMINI     | Big-endian   | NJFE   | US     | NTSC  | 6105 |       256 | 772cc6eab2620d2d3cdc17bbc26c4f68 | Jet Force Gemini (USA).z64                                |
| Killer Instinct Gold | Big-endian   | NKIE   | US     | NTSC  | 6102 |        96 | dd0a82fcc10397afb37f12bb7f94e67a | Killer Instinct Gold (USA) (Rev B).z64                    |
| ZELDA MAJORA'S MASK  | Big-endian   | NZSE   | US     | NTSC  | 6105 |       256 | 2a0a8acb61538235bc1094d297fb6556 | Legend of Zelda, The - Majora's Mask (USA).z64            |
| THE LEGEND OF ZELDA  | Big-endian   | CZLE   | US     | NTSC  | 6105 |       256 | 57a9719ad547c516342e1a15d5c28c3d | Legend of Zelda, The - Ocarina of Time (U) (V1.2) [!].z64 |
| THE LEGEND OF ZELDA  | Big-endian   | CZLE   | US     | NTSC  | 6105 |       256 | 57a9719ad547c516342e1a15d5c28c3d | Legend of Zelda, The - Ocarina of Time (USA) (Rev B).z64  |
| STARFOX64            | Big-endian   | NFXP   | EU     | PAL   | 7102 |        96 | 884ccca35cbeedb8ed288326f9662100 | Lylat Wars (E) (M3) [!].z64                               |
| STARFOX64            | Byte-swapped | NFXP   | EU     | PAL   | 7102 |        96 | 204a14c2ac815afee74b58ef9394708d | Lylat Wars (Europe) (En,Fr,De).n64                        |
| STARFOX64            | Big-endian   | NFXP   | EU     | PAL   | 7102 |        96 | 884ccca35cbeedb8ed288326f9662100 | Lylat Wars (Europe) (En,Fr,De).z64                        |
| Mega Man 64          | Big-endian   | NM6E   | US     | NTSC  | 6102 |       256 | 3620674acb51e436d5150738ac1c0969 | Mega Man 64 (USA).z64                                     |
| PAPER MARIO          | Big-endian   | NMQE   | US     | NTSC  | 6103 |       320 | a722f8161ff489943191330bf8416496 | Paper Mario (USA).z64                                     |
| Perfect Dark         | Big-endian   | NPDE   | US     | NTSC  | 6105 |       256 | e03b088b6ac9e0080440efed07c1e40f | Perfect Dark (USA) (Rev A).z64                            |
| Pilot Wings64        | Big-endian   | NPWE   | US     | NTSC  | 6102 |        64 | 8b346182730ceaffe5e2ccf6d223c5ef | Pilotwings 64 (USA).z64                                   |
| STARFOX64            | Big-endian   | NFXE   | US     | NTSC  | 6101 |        96 | 741a94eee093c4c8684e66b89f8685e8 | Star Fox 64 (USA) (Rev A).z64                             |
| Rogue Squadron       | Big-endian   | NRSE   | US     | NTSC  | 6102 |       128 | 47cac4e2a6309458342f21a9018ffbf0 | Star Wars - Rogue Squadron (USA) (Rev A).z64              |
| SUPER MARIO 64       | Big-endian   | NSME   | US     | NTSC  | 6102 |        64 | 20b854b239203baf6c961b850a4a51a2 | Super Mario 64 (USA).z64                                  |
| SUPERMARIO64         | Byte-swapped | NSMJ   | JP     | NTSC  | 6102 |        64 | f3a6e533de52fb84d4e2dfae6167c8b1 | Super Mario 64 - Shindou Edition (J) [!].n64              |
| SUPERMARIO64         | Big-endian   | NSMJ   | JP     | NTSC  | 6102 |        64 | 2d727c3278aa232d94f2fb45aec4d303 | Super Mario 64 - Shindou Edition (J) [!].z64              |
| SMASH BROTHERS       | Byte-swapped | NALE   | US     | NTSC  | 6103 |       128 | 3c4e65d9b7bf55338496108f04da7f41 | Super Smash Bros. (USA).n64                               |
| SMASH BROTHERS       | Big-endian   | NALE   | US     | NTSC  | 6103 |       128 | f7c52568a31aadf26e14dc2b6416b2ed | Super Smash Bros. (USA).z64                               |
| TSUMI TO BATSU       | Byte-swapped | NGUJ   | JP     | NTSC  | 6102 |       256 | 3b8638452b46deba9edffbcd6cdb6966 | Tsumi to Batsu - Hoshi no Keishousha (Japan).n64          |
| TSUMI TO BATSU       | Big-endian   | NGUJ   | JP     | NTSC  | 6102 |       256 | a0657bc99e169153fd46aeccfde748f3 | Tsumi to Batsu - Hoshi no Keishousha (Japan).z64          |
| WAVE RACE 64         | Big-endian   | NWRE   | US     | NTSC  | 6102 |        64 | 2048a640c12d1cf2052ba1629937d2ff | Wave Race 64 (USA) (Rev A).z64                            |
+----------------------+--------------+--------+--------+-------+------+-----------+----------------------------------+-----------------------------------------------------------+

rom64 info

Show information about a single file.

Also supports the same output options as ls

$ rom64 info ~/Downloads/n64/Conker\'s\ Bad\ Fur\ Day\ \(USA\).z64
File:
  Name:    Conker's Bad Fur Day (USA).z64
  Size:    64 MB
  Format:  z64 (Big-endian)
  MD5:     00e2920665f2329b95797a7eaabc2390
  SHA1:    4cbadd3c4e0729dec46af64ad018050eada4f47a

ROM:
  ID:        NFUE
  Title:     CONKER BFD
  Media:     Cartridge
  Region:    US
  Video:     NTSC
  Version:   1.0
  CIC:       6105
  CRC 1:     30C7AC50
  CRC 2:     7704072D

Same ROM but with --output json

{
  "crc_1": "30C7AC50",
  "crc_2": "7704072D",
  "image_name": "CONKER BFD",
  "media_format": {
    "code": "N",
    "description": "Cartridge"
  },
  "cartridge_id": "FU",
  "region": {
    "code": "E",
    "description": "US"
  },
  "version": 0,
  "cic": "6105",
  "file": {
    "path": "/home/mroach/Downloads/n64/Conker's Bad Fur Day (USA).z64",
    "name": "Conker's Bad Fur Day (USA).z64",
    "format": {
      "code": "z64",
      "description": "Big-endian"
    },
    "size": 64,
    "md5": "00e2920665f2329b95797a7eaabc2390",
    "sha1": "4cbadd3c4e0729dec46af64ad018050eada4f47a"
  },
  "video_system": "NTSC"
}

rom64 convert

Converts a ROM from a non-native format to the native big-endian Z64 format.

After conversion, the new ROM's SHA-1 checksum is validated against a known list of good checksums, same as in the validate command.

rom64 validate

Computes the ROM file's SHA-1 checksum and validates it against a list of known-good checksums from a "datfile".

Checksums only work on files in the native Big-endian (Z64) format.

The binary includes a recent version of the datile from dat-o-matic. If you want to use your own, specify it with the --datfile flag.

$ rom64 validate ~/Downloads/n64/Tsumi\ to\ Batsu\ -\ Hoshi\ no\ Keishousha\ \(Japan\).z64
Found 1 datfile entries for ROM serial 'NGUJ'
  SHA-1 MATCH  581297B9D5C3A4C33169AE0AAE218C742CD9CBCF Tsumi to Batsu - Hoshi no Keishousha (Japan).z64

Buidling

  1. Install Go for your platform.
  2. Fetch module dependencies: go get -d .
  3. make all

Development

This project follows Semantic Versioning.

Git commit message should use Conventional Commits to have a clearly readable history to the point where changelogs/release notes can be generated automatically.

Comments
  • [Bug] SHA-1 and MD5 hashes are never calculated

    [Bug] SHA-1 and MD5 hashes are never calculated

    For some reason no ROM that I try with ROM64 seems to calculate the SHA-1 or MD5 hash. It just says "not calculated".

    This happened with big-endian, byte-swapped, and little-endian ROMs.

    All of the tested ROMs were No-Intro verified, or checked using romjudgeand work on emulators and flash carts.

    Side note, the text output puts the CRC1 and CRC2 twice in the outputted text, which is redundant I believe.

  • [Feature request] When a file is an

    [Feature request] When a file is an "unknown ROM format", display more information to the user

    When a file is an "unknown ROM format", I think it should display more information to the user so they know which file is having the issue if they have a large ROM folder.

    It could be anything really, like the file name, or the SHA-1 or MD5 hash, or something else identifiable that ROM64 already knows.

    Scanning a folder with potentially hundreds or thousands of ROM files and getting "Unknown ROM format. Invalid file?" for every file isn't very helpful when that is displayed many many times and you don't know which files are causing the message to appear.

    Thanks! 😄

  • [Feature Request] Add an option to the rename rom to datomatic match

    [Feature Request] Add an option to the rename rom to datomatic match

    Just found this tool and it's really cool.

    One option I'm missing, for example while running the validate command, is to rename the rom file to match the filename found in the dat file. This will help a lot while "normalizing" a rom library. A more detailed description of the flow would be:

    1. Validate the rom against the datfile
    2. If a match is found check if the rename option is enabled
    3. if the rename option is enabled check if the current rom filename matches the one from the datfile match.
    4. If the filename doesn't match, rename the current rom file to match the one from the datfile.

    e.g: rom64 validate --rename

    Same option could be available for the convert command as well.

    What do you think?

    Thanks

  • Fix incorrect flag

    Fix incorrect flag

    I spent way too long figuring this out, heh.

    Remove mentions of the -f flag and replace with the new (I'm assuming) -o flag.

    This should confuse users less.

    The output is actually mentioned later in the README, but I was misunderstanding.

    Hopefully this helps. 😀

  • Calculate CRC1 and CRC2

    Calculate CRC1 and CRC2

    The tool already extracts the CRC1 and CRC2 from the ROM header. Now also calculate it to check if it's valid.

    • https://github.com/Random06457/N64ShellPreview/blob/master/N64ShellPreview/N64Checksum.cs
  • Known good ROM checksum database

    Known good ROM checksum database

    Background

    There are nice lists of known good ROM dumps with MD5 and/or SHA1 hashes.

    For example dat-o-matic has a great dump in XML format that includes two pieces of information we'd need:

    • ROM ID
    • MD5

    Tasks

    (Maybe break this up into several tasks)

    • Download the .dat file
    • At build time, read the data file into go source code so that we don't have to distribute any files with the binary
    • Allow a CLI flag to read a dat file from somewhere else so that uses can use their own and/or and updated list
    • Add a check command to validate the hash of a single ROM
    • In ls, add a --check flag to validate each ROM
    • After a convert, automatically run a check to make sure we didn't botch the conversion somehow.
  • Patch reconcilier

    Patch reconcilier

    This is a feature mainly for the Everdrive 64. It wants patches in ED64/patches named {CRC1}.{ips,aps}. List patches, find associated games in the ROMS dir, and then show:

    • Patches without ROMs
    • ROMs without patches
    • Patch <=> ROM pairings
  • Configure Renovate

    Configure Renovate

    Mend Renovate

    Welcome to Renovate! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

    🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.


    Detected Package Files

    • .github/workflows/lint.yml (github-actions)
    • go.mod (gomod)

    Configuration

    🔡 Renovate has detected a custom config for this PR. Feel free to ask for help if you have any doubts and would like it reviewed.

    Important: Now that this branch is edited, Renovate can't rebase it from the base branch any more. If you make changes to the base branch that could impact this onboarding PR, please merge them manually.

    What to Expect

    With your current configuration, Renovate will create 4 Pull Requests:

    chore(deps): update module go to 1.19
    • Schedule: ["at any time"]
    • Branch name: renovate/go-1.x
    • Merge into: master
    • Upgrade go to 1.19
    fix(deps): update module github.com/spf13/cobra to v1.6.1
    • Schedule: ["at any time"]
    • Branch name: renovate/github.com-spf13-cobra-1.x
    • Merge into: master
    • Upgrade github.com/spf13/cobra to v1.6.1
    chore(deps): update actions/checkout action to v3
    • Schedule: ["at any time"]
    • Branch name: renovate/actions-checkout-3.x
    • Merge into: master
    • Upgrade actions/checkout to v3
    chore(deps): update golangci/golangci-lint-action action to v3
    • Schedule: ["at any time"]
    • Branch name: renovate/golangci-golangci-lint-action-3.x
    • Merge into: master
    • Upgrade golangci/golangci-lint-action to v3

    🚸 Branch creation will be limited to maximum 2 per hour, so it doesn't swamp any CI resources or spam the project. See docs for prhourlylimit for details.


    ❓ Got questions? Check out Renovate's Docs, particularly the Getting Started section. If you need any further assistance then you can also request help here.


    This PR has been generated by Mend Renovate. View repository job log here.

Robust & Easy to use struct mapper and utility methods for Go

go-model Robust & Easy to use model mapper and utility methods for Go struct. Typical methods increase productivity and make Go development more fun ?

Dec 30, 2022
gopkg is a universal utility collection for Go, it complements offerings such as Boost, Better std, Cloud tools.

gopkg is a universal utility collection for Go, it complements offerings such as Boost, Better std, Cloud tools. Table of Contents Introduction

Jan 5, 2023
Utility to add network config file in apk

Utility to add network config file in apk. Which bypass the proxy intercept restriction for user installed burpsuit CA certificate.

Aug 19, 2022
Small utility to allow simpler, quicker testing of parsing files in crowdsec

cs_parser_test Small utility to allow simpler, quicker testing of parsing files in crowdsec Usage $ sudo cs_parser_test -t syslog /var/log/mail.log N

Jul 13, 2021
sigbypass4xx is a utility to automate well-know techniques used to bypass access control restrictions.

sigbypass4xx sigbypass4xx is a utility to automate well-know techniques used to bypass access control restrictions. Resources Usage Installation From

Nov 9, 2022
Utility functions for work with the Kubernetes Go-Client

go-k8s-utils This repository contains utils for the work with Kubernetes, in specific with the go-client library. Testing This package contains utils

Dec 14, 2022
Scylla-octopus is a backup and maintenance utility for scylladb.

scylla-octopus: a scylladb backup utility Scylla-octopus is a backup and maintenance utility for scylladb. It attempts to reproduce some functionality

Oct 19, 2022
A Go utility to convert Go example tests into jupyter notebooks.

go2colab Scientists (my main project's users) love jupyter notebook tutorials pkg.dev.go's runnable playground doesn't support file IO but I love exam

Jul 10, 2022
Simple utility to get/set the PWM duty cycle and to measure the RPM for a fan connected to the 4-pin header on the CM4IO.

cm4iofan Simple utility to get/set the PWM duty cycle and to measure the RPM for a fan connected to the 4-pin header on the CM4IO. Requirements Enable

Mar 31, 2022
Envoy utility to process envoy config for fast development and debugging.

envoyconf-tools Envoy is a proxy, really awesome and we are devs who often use it, face errors and struggle to debug it, when envoy config's source is

Oct 31, 2021
A utility library to do files/io/bytes processing/parsing in file-system or network.

goreader A utility library to do files/io/bytes processing/parsing in file-system or network. These features are really common to be implemented for a

Nov 1, 2021
Utility to restrict which package is allowed to import another package.

go-import-rules Utility to restrict which package is allowed to import another package. This tool will read import-rules.yaml or import-rules.yml in t

Jan 7, 2022
The utility that created for easily database and their tables rolling up

The utility that created for easily database and their tables rolling up

Nov 6, 2021
A funny utility to manage your PS1 variable.
A funny utility to manage your PS1 variable.

PSOne Introduction Are you a Veteran Unix Admin? If so, you probably know the charm of the PS1 environment variable. For a deep focus I suggest you to

Oct 23, 2022
A small utility to extract your Telegram contacts as VCF file.

Telegram to VCF A small utility to extract your Telegram contacts as VCF file. Usage At first build this application or use the precompiled binaries o

Nov 16, 2022
A utility to generate SPDX-compliant Bill of Materials manifests

Kubernetes Template Project The Kubernetes Template Project is a template for starting new projects in the GitHub organizations owned by Kubernetes. A

Jan 1, 2023
Some utility functions for generic types in Go.

GOUF - Utility Functions for generic types Go team released Go 1.18 beta recently with support for Generics(a.k.a type parameters). This package provi

Apr 13, 2022
Utility library that uses Go generics mechanism

golang-generics-util Utility library that explores Go generics (1.18) xsync Sync

Dec 11, 2022
Protoc-gen-fieldmask - Generate FieldMask utility functions for protobuf

protoc-gen-fieldmask Generate FieldMask utility functions for protobuf Generated

Aug 20, 2022