{"id":43572659,"url":"https://github.com/zorchenhimer/go-nes","last_synced_at":"2026-02-03T22:37:38.346Z","repository":{"id":57562217,"uuid":"200312198","full_name":"zorchenhimer/go-nes","owner":"zorchenhimer","description":"A library and some utilities to help with NES development","archived":false,"fork":false,"pushed_at":"2024-02-24T04:02:26.000Z","size":186,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-05-02T01:44:59.251Z","etag":null,"topics":["famicom","library","nes","nintendo","rom-files","utility"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zorchenhimer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-03T00:11:41.000Z","updated_at":"2024-05-02T01:44:59.252Z","dependencies_parsed_at":"2023-02-12T19:32:05.955Z","dependency_job_id":null,"html_url":"https://github.com/zorchenhimer/go-nes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zorchenhimer/go-nes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zorchenhimer%2Fgo-nes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zorchenhimer%2Fgo-nes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zorchenhimer%2Fgo-nes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zorchenhimer%2Fgo-nes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zorchenhimer","download_url":"https://codeload.github.com/zorchenhimer/go-nes/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zorchenhimer%2Fgo-nes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29060578,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T22:28:58.191Z","status":"ssl_error","status_checked_at":"2026-02-03T22:28:56.515Z","response_time":96,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["famicom","library","nes","nintendo","rom-files","utility"],"created_at":"2026-02-03T22:37:37.605Z","updated_at":"2026-02-03T22:37:38.332Z","avatar_url":"https://github.com/zorchenhimer.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Library and utilities for working with NES data and ROMS\n\nA library for working with NES CHR data and ROM files.\n\n## chrutil\n\nUtility to work with CHR files and related data.\n\n- Converting bitmaps to the CHR format\n- Converting CHR files to PNG\n- Selecting which tiles to export (Range or individual IDs)\n- Tile de-duplication (with ID mappings exported)\n- Multiple input bitmaps into a single CHR\n- Multiple inputs to multiple outputs\n- 8x16 sprite mode (per-input file)\n- Target start ID for given input\n- Allow CHR files as input for concatenation\n- Output as binary CHR file or assembly source\n- Destination tile ID override\n\n### Custom rolled flag parsing (only chrutil)\n\nThree main sections (or \"targets\") of data: default, global, and per-input.\n\nDefault is defined at compile-time, while the global and per-input are defined\nat runtime.\n\nAll command line options have a target, with the default (first) target\n\"global\".  Retrieving a value for a target will first look in the current\ntarget scope, fall back to the global target if nothing was found, then finally\nfall back to the default target.\n\nEach target should have a reference to the higher target scope.  The default\ntarget will not have a reference anywhere as all options will be expected to\nhave been defined in the default target scope.\n\n### Multiple input files\n\nThe order of commands and input files matters.  Options given before an input\nfile are global for all input files, unless overwritten later.\n\n    $ chrutil input_a.bmp input_b.bmp --b-option\n    $ chrutil input_a.bmp --a-option input_b.bmp\n    $ chrutil input_a.bmp --a-option input_b.bmp --b-option\n\n    $ chrutil \\\n        --global-option \\\n        input_a.bmp \\\n        input_b.bmp --b-option\n\n    $ chrutil \\\n        --global-option \\\n        input_a.bmp --global-override-for-a \\\n        input_b.bmp --b-option\n\nFor this command, `main.chr` will not contain the data from `input_b.bmp`.\n\n    $ chrutil \\\n        --output main.chr \\\n        input_a.bmp \\\n        input_b.bmp --output only_b.chr \\\n        input_c.bmp\n\nOptions are per-input file or global.  If an option is defined once globally\nand once for an input file, the global value is overwritten with the input\nfile's value.\n\nIf an option is given more than once for the same scope the last value will be\nused.\n\n### Multiple input and output files\n\nMultiple input files with the same output file will be combined into that\noutput file.\n\n    $ chrutil \\\n        input_a.bmp --output ab.chr \\\n        input_b.bmp --output ab.chr \\\n        input_c.bmp --output cd.chr \\\n        input_d.bmp --output cd.chr\n\n### Selecting which tiles to export\n\nEither a range or a list of tile IDs.  Accept either decimal or hex ($##)\nnotation.\n\n    $ chrutil --tile-ids 2-14\n    $ chrutil --tile-ids 2,4,8,10\n\n    $ chrutil --tile-ids $02-$0D\n    $ chrutil --tile-ids $02,$04,$08,$0A\n\n### CHR as input\n\nThis will append `font.chr` to the end of `main.chr` after `input_a.bmp` has\nbeen converted and written.\n\n    $ chrutil \\\n        --output main.chr \\\n        input_a.bmp \\\n        font.chr\n\nThis will append the converted `input_a.bmp` CHR data to the end of `main.chr`\nafter `font.chr`.\n\n    $ chrutil \\\n        --output main.chr \\\n        font.chr \\\n        input_a.bmp\n\n## fontutil\n\nTakes a font in an image and removes blank tiles.  This can also output ca65\nremapping commands so ascii typed in source files will be able to use the\ngenerated font without any modification.\n\n    fontutil --input font.bmp --output converted.chr \\\n             --remap character-remappings.i \\\n             --widths character-widths.i \\\n             --space-width 5 \\\n             --input-offset 0 \\\n             --input-length 0\n\n`--input` and `--output` are the only required options.\n\nAn `--input-length` of zero disables the length check and will process all the\ncharacters in the font.\n\n## metatiles\n\nConvert metatiles in an image to tile-reduced CHR data and metadata that can be\nused to re-construct the metatiles.  The positional arguments are required, all\nthe others are optional.\n\n    $ metatiles input.bmp output.chr metadata.i\n    $ metatiles input.bmp output.chr metadata.i \\\n                --tile-size 2x2 \\\n                --count 2 \\\n                --offeset 1 \\\n                --pad 16\n\n`--tile-size` defaults to 2x2.  This option accepts a single number (square\nmetatile) or a WxH value.\n\n`--count` will process only the given number of metatiles.  A value of `0` will\nprocess all metatiles found in the input file.\n\n`--offset` will start processing metatiles after the given number of metatiles\n(not individual 8x8 tiles).\n\n`--pad` will pad the output CHR to contain at least the given number of 8x8\ntiles.\n\n### Output Metadata\n\nThis data is used to reconstruct the metatiles from individual 8x8 pixel tiles.\nThe data consists of two tables.  The first is a list of addresses (pointers)\nto data for each metatile.\n\nThe data for each mitatile consists of a few vaules:\n\n    ; width, height\n    .byte 2, 2\n    ; palette, total tiles (W*H)\n    .byte 0, 4\n    ; list of tile IDs\n    .byte 128, 129, 128, 129\n\n## romutil\n\nUtility to work directly with ROM files.\n\n- Unpack ROM into PRG and CHR\n- Option to split PRG and CHR into banks\n- Pack ROM from unpacked data\n- ROM info printout (header info, hashes, etc)\n\n### Command line\n\nGeneral command format.\n\n    $ romutil \u003ccommand\u003e \u003cinput\u003e [options]\n\nUnpack a ROM into PRG and CHR binary files and a `header.json` file.\n\n    $ romutil unpack input.nes\n\nRe-pack an unpacked ROM.\n\n    $ romutil pack unpacked_data_directory/\n\nPrint mapper info and CRC32 hashes\n\n    $ romutil info input.nes\n\n## sbutil\n\nAn (unfinished) utility to pack and unpack StudyBox rom files.\n\n## text2chr\n\nCreate a tile-reduced text image.  Letters are assumed to be variable width.\n\n    $ text2chr --font font.bmp --metadata text.i --input \"Hello world\" --chr output.chr\n\nThe file `font.bmp` is the font to use for the conversion and the text to\nconvert is provided with the `--input` option.  Metadata is written to\n`text.i` and CHR data to `output.chr`.  The metadata consists of a data\nlength (one byte) followed by that number tile IDs.\n\n## usage\n\nCreate an image showing the usage of a ROM.\n\n    $ usage --chr-size 8 input.nes output.png\n\nThe output image is made up of columns of data.  Each column represents 16k and\nis 16 bytes wide.  Each pixel in the image is a single bit in the ROM.\n\nCHR data is also written out to a set of images.  By default, the images are\nsplit into 8k chunks.  Valid sizes are: 8, 4, 2, 1, \u0026 0.  A value of \"0\" will\nnot split the CHR data into chunks and will write a single image.\n\nCurrently, the output filenames for the CHR data conforms to \"chr_%04d.png\".\nThis will be configurable, eventually.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzorchenhimer%2Fgo-nes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzorchenhimer%2Fgo-nes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzorchenhimer%2Fgo-nes/lists"}