1b6cee71dSXin LI 2b6cee71dSXin LI#------------------------------------------------------------------------------ 3*43a5ec4eSXin LI# $File: console,v 1.63 2021/04/26 15:56:00 christos Exp $ 4b6cee71dSXin LI# Console game magic 5b6cee71dSXin LI# Toby Deshane <hac@shoelace.digivill.net> 6b6cee71dSXin LI 73e41d09dSXin LI# ines: file(1) magic for Marat's iNES Nintendo Entertainment System ROM dump format 83e41d09dSXin LI# Updated by David Korth <gerbilsoft@gerbilsoft.com> 93e41d09dSXin LI# References: 1048c779cdSXin LI# - https://wiki.nesdev.com/w/index.php/INES 1148c779cdSXin LI# - https://wiki.nesdev.com/w/index.php/NES_2.0 1240427ccaSGordon Tetlow 1340427ccaSGordon Tetlow# Common header for iNES, NES 2.0, and Wii U iNES. 1440427ccaSGordon Tetlow0 name nes-rom-image-ines 153e41d09dSXin LI>7 byte&0x0C =0x8 (NES 2.0) 163e41d09dSXin LI>4 byte x \b: %ux16k PRG 1740427ccaSGordon Tetlow>5 byte x \b, %ux8k CHR 183e41d09dSXin LI>6 byte&0x08 =0x8 [4-Scr] 193e41d09dSXin LI>6 byte&0x09 =0x0 [H-mirror] 203e41d09dSXin LI>6 byte&0x09 =0x1 [V-mirror] 213e41d09dSXin LI>6 byte&0x02 =0x2 [SRAM] 223e41d09dSXin LI>6 byte&0x04 =0x4 [Trainer] 233e41d09dSXin LI>7 byte&0x03 =0x2 [PC10] 2440427ccaSGordon Tetlow>7 byte&0x03 =0x1 [VS] 253e41d09dSXin LI>>7 byte&0x0C =0x8 263e41d09dSXin LI# NES 2.0: VS PPU 273e41d09dSXin LI>>>13 byte&0x0F =0x0 \b, RP2C03B 283e41d09dSXin LI>>>13 byte&0x0F =0x1 \b, RP2C03G 293e41d09dSXin LI>>>13 byte&0x0F =0x2 \b, RP2C04-0001 303e41d09dSXin LI>>>13 byte&0x0F =0x3 \b, RP2C04-0002 313e41d09dSXin LI>>>13 byte&0x0F =0x4 \b, RP2C04-0003 323e41d09dSXin LI>>>13 byte&0x0F =0x5 \b, RP2C04-0004 333e41d09dSXin LI>>>13 byte&0x0F =0x6 \b, RP2C03B 343e41d09dSXin LI>>>13 byte&0x0F =0x7 \b, RP2C03C 353e41d09dSXin LI>>>13 byte&0x0F =0x8 \b, RP2C05-01 363e41d09dSXin LI>>>13 byte&0x0F =0x9 \b, RP2C05-02 373e41d09dSXin LI>>>13 byte&0x0F =0xA \b, RP2C05-03 383e41d09dSXin LI>>>13 byte&0x0F =0xB \b, RP2C05-04 393e41d09dSXin LI>>>13 byte&0x0F =0xC \b, RP2C05-05 403e41d09dSXin LI# TODO: VS protection hardware? 413e41d09dSXin LI>>7 byte x \b] 423e41d09dSXin LI# NES 2.0-specific flags. 433e41d09dSXin LI>7 byte&0x0C =0x8 443e41d09dSXin LI>>12 byte&0x03 =0x0 [NTSC] 453e41d09dSXin LI>>12 byte&0x03 =0x1 [PAL] 463e41d09dSXin LI>>12 byte&0x02 =0x2 [NTSC+PAL] 473e41d09dSXin LI 4840427ccaSGordon Tetlow# Standard iNES ROM header. 4940427ccaSGordon Tetlow0 string NES\x1A NES ROM image (iNES) 502dc4dbb9SEitan Adler!:mime application/x-nes-rom 5140427ccaSGordon Tetlow>0 use nes-rom-image-ines 5240427ccaSGordon Tetlow 5340427ccaSGordon Tetlow# Wii U Virtual Console iNES ROM header. 5440427ccaSGordon Tetlow0 belong 0x4E455300 NES ROM image (Wii U Virtual Console) 552dc4dbb9SEitan Adler!:mime application/x-nes-rom 5640427ccaSGordon Tetlow>0 use nes-rom-image-ines 5740427ccaSGordon Tetlow 583e41d09dSXin LI#------------------------------------------------------------------------------ 593e41d09dSXin LI# unif: file(1) magic for UNIF-format Nintendo Entertainment System ROM images 6048c779cdSXin LI# Reference: https://wiki.nesdev.com/w/index.php/UNIF 613e41d09dSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 623e41d09dSXin LI# 633e41d09dSXin LI# NOTE: The UNIF format uses chunks instead of a fixed header, 643e41d09dSXin LI# so most of the data isn't easily parseable. 653e41d09dSXin LI# 663e41d09dSXin LI0 string UNIF 6740427ccaSGordon Tetlow>4 lelong <16 NES ROM image (UNIF v%d format) 682dc4dbb9SEitan Adler!:mime application/x-nes-rom 69b6cee71dSXin LI 70b6cee71dSXin LI#------------------------------------------------------------------------------ 71282e23f0SXin LI# fds: file(1) magic for Famciom Disk System disk images 7248c779cdSXin LI# Reference: https://wiki.nesdev.com/w/index.php/Family_Computer_Disk_System#.FDS_format 73282e23f0SXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 74282e23f0SXin LI# TODO: Check "Disk info block" and get info from that in addition to the optional header. 75282e23f0SXin LI 76282e23f0SXin LI# Disk info block. (block 1) 77282e23f0SXin LI0 name nintendo-fds-disk-info-block 78282e23f0SXin LI>23 byte !1 FMC- 79282e23f0SXin LI>23 byte 1 FSC- 80282e23f0SXin LI>16 string x \b%.3s 8140427ccaSGordon Tetlow>15 byte x \b, mfr %02X 82282e23f0SXin LI>20 byte x (Rev.%02u) 83282e23f0SXin LI 84282e23f0SXin LI# Headered version. 85282e23f0SXin LI0 string FDS\x1A 8640427ccaSGordon Tetlow>0x11 string *NINTENDO-HVC* Famicom Disk System disk image: 872dc4dbb9SEitan Adler!:mime application/x-fds-disk 88282e23f0SXin LI>>0x10 use nintendo-fds-disk-info-block 89282e23f0SXin LI>4 byte 1 (%u side) 90282e23f0SXin LI>4 byte !1 (%u sides) 91282e23f0SXin LI 92282e23f0SXin LI# Unheadered version. 9340427ccaSGordon Tetlow1 string *NINTENDO-HVC* Famicom Disk System disk image: 942dc4dbb9SEitan Adler!:mime application/x-fds-disk 95282e23f0SXin LI>0 use nintendo-fds-disk-info-block 96282e23f0SXin LI 97282e23f0SXin LI#------------------------------------------------------------------------------ 9840427ccaSGordon Tetlow# tnes: file(1) magic for TNES-format Nintendo Entertainment System ROM images 9940427ccaSGordon Tetlow# Used by Nintendo 3DS NES Virtual Console games. 10040427ccaSGordon Tetlow# From: David Korth <gerbilsoft@gerbilsoft.com> 10140427ccaSGordon Tetlow# 10240427ccaSGordon Tetlow0 string TNES NES ROM image (Nintendo 3DS Virtual Console) 1032dc4dbb9SEitan Adler!:mime application/x-nes-rom 10440427ccaSGordon Tetlow>4 byte 100 \b: FDS, 10540427ccaSGordon Tetlow>>0x2010 use nintendo-fds-disk-info-block 10640427ccaSGordon Tetlow>4 byte !100 \b: TNES mapper %u 10740427ccaSGordon Tetlow>>5 byte x \b, %ux8k PRG 10840427ccaSGordon Tetlow>>6 byte x \b, %ux8k CHR 10940427ccaSGordon Tetlow>>7 byte&0x08 =1 [WRAM] 11040427ccaSGordon Tetlow>>8 byte&0x09 =1 [H-mirror] 11140427ccaSGordon Tetlow>>8 byte&0x09 =2 [V-mirror] 11240427ccaSGordon Tetlow>>8 byte&0x02 =3 [VRAM] 11340427ccaSGordon Tetlow 11440427ccaSGordon Tetlow#------------------------------------------------------------------------------ 115b6cee71dSXin LI# gameboy: file(1) magic for the Nintendo (Color) Gameboy raw ROM format 1163e41d09dSXin LI# Reference: http://gbdev.gg8.se/wiki/articles/The_Cartridge_Header 117b6cee71dSXin LI# 1183e41d09dSXin LI0x104 bequad 0xCEED6666CC0D000B Game Boy ROM image 1192dc4dbb9SEitan Adler# TODO: application/x-gameboy-color-rom for GBC. 1202dc4dbb9SEitan Adler!:mime application/x-gameboy-rom 1213e41d09dSXin LI>0x143 byte&0x80 0x80 1223e41d09dSXin LI>>0x134 string >\0 \b: "%.15s" 1233e41d09dSXin LI>0x143 byte&0x80 !0x80 1243e41d09dSXin LI>>0x134 string >\0 \b: "%.16s" 1253e41d09dSXin LI>0x14c byte x (Rev.%02u) 126b6cee71dSXin LI 1273e41d09dSXin LI# Machine type. (SGB, CGB, SGB+CGB) 128*43a5ec4eSXin LI# Old licensee code 0x33 is required for SGB, but not CGB. 1293e41d09dSXin LI>0x14b byte 0x33 1303e41d09dSXin LI>>0x146 byte 0x03 1313e41d09dSXin LI>>>0x143 byte&0x80 0x80 [SGB+CGB] 1323e41d09dSXin LI>>>0x143 byte&0x80 !0x80 [SGB] 1333e41d09dSXin LI>>0x146 byte !0x03 1343e41d09dSXin LI>>>0x143 byte&0xC0 0x80 [CGB] 1353e41d09dSXin LI>>>0x143 byte&0xC0 0xC0 [CGB ONLY] 1362dc4dbb9SEitan Adler>0x14b byte !0x33 137*43a5ec4eSXin LI>>0x143 byte&0xC0 0x80 [CGB] 138*43a5ec4eSXin LI>>0x143 byte&0xC0 0xC0 [CGB ONLY] 1393e41d09dSXin LI 1403e41d09dSXin LI# Mapper. 1413e41d09dSXin LI>0x147 byte 0x00 [ROM ONLY] 1423e41d09dSXin LI>0x147 byte 0x01 [MBC1] 1433e41d09dSXin LI>0x147 byte 0x02 [MBC1+RAM] 1443e41d09dSXin LI>0x147 byte 0x03 [MBC1+RAM+BATT] 1453e41d09dSXin LI>0x147 byte 0x05 [MBC2] 1463e41d09dSXin LI>0x147 byte 0x06 [MBC2+BATTERY] 1473e41d09dSXin LI>0x147 byte 0x08 [ROM+RAM] 1483e41d09dSXin LI>0x147 byte 0x09 [ROM+RAM+BATTERY] 1493e41d09dSXin LI>0x147 byte 0x0B [MMM01] 1503e41d09dSXin LI>0x147 byte 0x0C [MMM01+SRAM] 1513e41d09dSXin LI>0x147 byte 0x0D [MMM01+SRAM+BATT] 1523e41d09dSXin LI>0x147 byte 0x0F [MBC3+TIMER+BATT] 1533e41d09dSXin LI>0x147 byte 0x10 [MBC3+TIMER+RAM+BATT] 1543e41d09dSXin LI>0x147 byte 0x11 [MBC3] 1553e41d09dSXin LI>0x147 byte 0x12 [MBC3+RAM] 1563e41d09dSXin LI>0x147 byte 0x13 [MBC3+RAM+BATT] 1573e41d09dSXin LI>0x147 byte 0x19 [MBC5] 1583e41d09dSXin LI>0x147 byte 0x1A [MBC5+RAM] 1593e41d09dSXin LI>0x147 byte 0x1B [MBC5+RAM+BATT] 1603e41d09dSXin LI>0x147 byte 0x1C [MBC5+RUMBLE] 1613e41d09dSXin LI>0x147 byte 0x1D [MBC5+RUMBLE+SRAM] 1623e41d09dSXin LI>0x147 byte 0x1E [MBC5+RUMBLE+SRAM+BATT] 1633e41d09dSXin LI>0x147 byte 0xFC [Pocket Camera] 1643e41d09dSXin LI>0x147 byte 0xFD [Bandai TAMA5] 1653e41d09dSXin LI>0x147 byte 0xFE [Hudson HuC-3] 1663e41d09dSXin LI>0x147 byte 0xFF [Hudson HuC-1] 1673e41d09dSXin LI 1683e41d09dSXin LI# ROM size. 169b6cee71dSXin LI>0x148 byte 0 \b, ROM: 256Kbit 170b6cee71dSXin LI>0x148 byte 1 \b, ROM: 512Kbit 171b6cee71dSXin LI>0x148 byte 2 \b, ROM: 1Mbit 172b6cee71dSXin LI>0x148 byte 3 \b, ROM: 2Mbit 173b6cee71dSXin LI>0x148 byte 4 \b, ROM: 4Mbit 174b6cee71dSXin LI>0x148 byte 5 \b, ROM: 8Mbit 175b6cee71dSXin LI>0x148 byte 6 \b, ROM: 16Mbit 1763e41d09dSXin LI>0x148 byte 7 \b, ROM: 32Mbit 177b6cee71dSXin LI>0x148 byte 0x52 \b, ROM: 9Mbit 178b6cee71dSXin LI>0x148 byte 0x53 \b, ROM: 10Mbit 179b6cee71dSXin LI>0x148 byte 0x54 \b, ROM: 12Mbit 180b6cee71dSXin LI 1813e41d09dSXin LI# RAM size. 182b6cee71dSXin LI>0x149 byte 1 \b, RAM: 16Kbit 183b6cee71dSXin LI>0x149 byte 2 \b, RAM: 64Kbit 184*43a5ec4eSXin LI>0x149 byte 3 \b, RAM: 256Kbit 185b6cee71dSXin LI>0x149 byte 4 \b, RAM: 1Mbit 1863e41d09dSXin LI>0x149 byte 5 \b, RAM: 512Kbit 187b6cee71dSXin LI 188b6cee71dSXin LI#------------------------------------------------------------------------------ 1893e41d09dSXin LI# genesis: file(1) magic for various Sega Mega Drive / Genesis ROM image and disc formats 1903e41d09dSXin LI# Updated by David Korth <gerbilsoft@gerbilsoft.com> 1913e41d09dSXin LI# References: 19248c779cdSXin LI# - https://www.retrodev.com/segacd.html 1933e41d09dSXin LI# - http://devster.monkeeh.com/sega/32xguide1.txt 194b6cee71dSXin LI# 1953e41d09dSXin LI 1963e41d09dSXin LI# Common Sega Mega Drive header format. 1973e41d09dSXin LI# FIXME: Name fields are 48 bytes, but have spaces for padding instead of 00s. 1983e41d09dSXin LI0 name sega-mega-drive-header 1993e41d09dSXin LI# ROM title. (Use domestic if present; if not, use international.) 2003e41d09dSXin LI>0x120 byte >0x20 2013e41d09dSXin LI>>0x120 string >\0 \b: "%.16s" 2023e41d09dSXin LI>0x120 byte <0x21 2033e41d09dSXin LI>>0x150 string >\0 \b: "%.16s" 2043e41d09dSXin LI# Other information. 2053e41d09dSXin LI>0x180 string >\0 (%.14s 2063e41d09dSXin LI>>0x110 string >\0 \b, %.16s 2073e41d09dSXin LI>0x180 byte 0 2083e41d09dSXin LI>>0x110 string >\0 (%.16s 2093e41d09dSXin LI>0 byte x \b) 2103e41d09dSXin LI 2113e41d09dSXin LI# TODO: Check for 32X CD? 2123e41d09dSXin LI# Sega Mega CD disc images: 2048-byte sectors. 2133e41d09dSXin LI0 string SEGADISCSYSTEM\ \ Sega Mega CD disc image 2142dc4dbb9SEitan Adler!:mime application/x-sega-cd-rom 2153e41d09dSXin LI>0 use sega-mega-drive-header 2163e41d09dSXin LI>0 byte x \b, 2048-byte sectors 2173e41d09dSXin LI0 string SEGABOOTDISC\ \ \ \ Sega Mega CD disc image 2182dc4dbb9SEitan Adler!:mime application/x-sega-cd-rom 2193e41d09dSXin LI>0 use sega-mega-drive-header 2203e41d09dSXin LI>0 byte x \b, 2048-byte sectors 2213e41d09dSXin LI# Sega Mega CD disc images: 2352-byte sectors. 2223e41d09dSXin LI0x10 string SEGADISCSYSTEM\ \ Sega Mega CD disc image 2232dc4dbb9SEitan Adler!:mime application/x-sega-cd-rom 2243e41d09dSXin LI>0x10 use sega-mega-drive-header 2253e41d09dSXin LI>0 byte x \b, 2352-byte sectors 2263e41d09dSXin LI0x10 string SEGABOOTDISC\ \ \ \ Sega Mega CD disc image 2272dc4dbb9SEitan Adler!:mime application/x-sega-cd-rom 2283e41d09dSXin LI>0x10 use sega-mega-drive-header 2293e41d09dSXin LI>0 byte x \b, 2352-byte sectors 2303e41d09dSXin LI 2313e41d09dSXin LI# Sega Mega Drive, 32X, Pico, and Mega CD Boot ROM images. 2323e41d09dSXin LI0x100 string SEGA 2333e41d09dSXin LI>0x3C0 bequad 0x4D41525320434845 Sega 32X ROM image 2342dc4dbb9SEitan Adler!:mime application/x-genesis-32x-rom 2353e41d09dSXin LI>>0 use sega-mega-drive-header 2363e41d09dSXin LI>0x3C0 bequad !0x4D41525320434845 2373e41d09dSXin LI>>0x105 belong 0x5049434F Sega Pico ROM image 2382dc4dbb9SEitan Adler!:mime application/x-sega-pico-rom 2393e41d09dSXin LI>>>0 use sega-mega-drive-header 2403e41d09dSXin LI>>0x105 belong !0x5049434F 2413e41d09dSXin LI>>>0x180 beshort 0x4252 Sega Mega CD Boot ROM image 2422dc4dbb9SEitan Adler!:mime application/x-genesis-rom 2433e41d09dSXin LI>>>0x180 beshort !0x4252 Sega Mega Drive / Genesis ROM image 2442dc4dbb9SEitan Adler!:mime application/x-genesis-rom 2453e41d09dSXin LI>>>0 use sega-mega-drive-header 246b6cee71dSXin LI 247b6cee71dSXin LI#------------------------------------------------------------------------------ 248b6cee71dSXin LI# genesis: file(1) magic for the Super MegaDrive ROM dump format 249b6cee71dSXin LI# 2503e41d09dSXin LI 2513e41d09dSXin LI# NOTE: Due to interleaving, we can't display anything 2523e41d09dSXin LI# other than the copier header information. 2533e41d09dSXin LI0 name sega-genesis-smd-header 254b6cee71dSXin LI>0 byte x %dx16k blocks 255b6cee71dSXin LI>2 byte 0 \b, last in series or standalone 256b6cee71dSXin LI>2 byte >0 \b, split ROM 2573e41d09dSXin LI 2583e41d09dSXin LI# "Sega Genesis" header. 2593e41d09dSXin LI0x280 string EAGN 2603e41d09dSXin LI>8 beshort 0xAABB Sega Mega Drive / Genesis ROM image (SMD format): 2612dc4dbb9SEitan Adler!:mime application/x-genesis-rom 2623e41d09dSXin LI>>0 use sega-genesis-smd-header 2633e41d09dSXin LI 2643e41d09dSXin LI# "Sega Mega Drive" header. 2653e41d09dSXin LI0x280 string EAMG 2663e41d09dSXin LI>8 beshort 0xAABB Sega Mega Drive / Genesis ROM image (SMD format): 2672dc4dbb9SEitan Adler!:mime application/x-genesis-rom 2683e41d09dSXin LI>>0 use sega-genesis-smd-header 269b6cee71dSXin LI 270b6cee71dSXin LI#------------------------------------------------------------------------------ 2713e41d09dSXin LI# smsgg: file(1) magic for Sega Master System and Game Gear ROM images 2723e41d09dSXin LI# Detects all Game Gear and export Sega Master System ROM images, 2733e41d09dSXin LI# and some Japanese Sega Master System ROM images. 2743e41d09dSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 27548c779cdSXin LI# Reference: https://www.smspower.org/Development/ROMHeader 276b6cee71dSXin LI# 2773e41d09dSXin LI 2783e41d09dSXin LI# General SMS header rule. 2793e41d09dSXin LI# The SMS boot ROM checks the header at three locations. 2803e41d09dSXin LI0 name sega-master-system-rom-header 2813e41d09dSXin LI# Machine type. 2823e41d09dSXin LI>0x0F byte&0xF0 0x30 Sega Master System 2832dc4dbb9SEitan Adler!:mime application/x-sms-rom 2843e41d09dSXin LI>0x0F byte&0xF0 0x40 Sega Master System 2852dc4dbb9SEitan Adler!:mime application/x-sms-rom 2863e41d09dSXin LI>0x0F byte&0xF0 0x50 Sega Game Gear 2872dc4dbb9SEitan Adler!:mime application/x-gamegear-rom 2883e41d09dSXin LI>0x0F byte&0xF0 0x60 Sega Game Gear 2892dc4dbb9SEitan Adler!:mime application/x-gamegear-rom 2903e41d09dSXin LI>0x0F byte&0xF0 0x70 Sega Game Gear 2912dc4dbb9SEitan Adler!:mime application/x-gamegear-rom 2922dc4dbb9SEitan Adler>0x0F default x Sega Master System / Game Gear 2932dc4dbb9SEitan Adler!:mime application/x-sms-rom 2943e41d09dSXin LI>0 byte x ROM image: 2953e41d09dSXin LI# Product code. 2963e41d09dSXin LI>0x0E byte&0xF0 0x10 1 2973e41d09dSXin LI>0x0E byte&0xF0 0x20 2 2983e41d09dSXin LI>0x0E byte&0xF0 0x30 3 2993e41d09dSXin LI>0x0E byte&0xF0 0x40 4 3003e41d09dSXin LI>0x0E byte&0xF0 0x50 5 3013e41d09dSXin LI>0x0E byte&0xF0 0x60 6 3023e41d09dSXin LI>0x0E byte&0xF0 0x70 7 3033e41d09dSXin LI>0x0E byte&0xF0 0x80 8 3043e41d09dSXin LI>0x0E byte&0xF0 0x90 9 3053e41d09dSXin LI>0x0E byte&0xF0 0xA0 10 3063e41d09dSXin LI>0x0E byte&0xF0 0xB0 11 3073e41d09dSXin LI>0x0E byte&0xF0 0xC0 12 3083e41d09dSXin LI>0x0E byte&0xF0 0xD0 13 3093e41d09dSXin LI>0x0E byte&0xF0 0xE0 14 3103e41d09dSXin LI>0x0E byte&0xF0 0xF0 15 3113e41d09dSXin LI# If the product code is 5 digits, we'll need to backspace here. 3123e41d09dSXin LI>0x0E byte&0xF0 !0 3133e41d09dSXin LI>>0x0C leshort x \b%04x 3143e41d09dSXin LI>0x0E byte&0xF0 0 3153e41d09dSXin LI>>0x0C leshort x %04x 3163e41d09dSXin LI# Revision. 3173e41d09dSXin LI>0x0E byte&0x0F x (Rev.%02d) 3183e41d09dSXin LI# ROM size. (Used for the boot ROM checksum routine.) 3193e41d09dSXin LI>0x0F byte&0x0F 0x0A (8 KB) 3203e41d09dSXin LI>0x0F byte&0x0F 0x0B (16 KB) 3213e41d09dSXin LI>0x0F byte&0x0F 0x0C (32 KB) 3223e41d09dSXin LI>0x0F byte&0x0F 0x0D (48 KB) 3233e41d09dSXin LI>0x0F byte&0x0F 0x0E (64 KB) 3243e41d09dSXin LI>0x0F byte&0x0F 0x0F (128 KB) 3253e41d09dSXin LI>0x0F byte&0x0F 0x00 (256 KB) 3263e41d09dSXin LI>0x0F byte&0x0F 0x01 (512 KB) 3273e41d09dSXin LI>0x0F byte&0x0F 0x02 (1 MB) 3283e41d09dSXin LI 3293e41d09dSXin LI# SMS/GG header locations. 3303e41d09dSXin LI0x7FF0 string TMR\ SEGA 3313e41d09dSXin LI>0x7FF0 use sega-master-system-rom-header 3323e41d09dSXin LI0x3FF0 string TMR\ SEGA 3333e41d09dSXin LI>0x3FF0 use sega-master-system-rom-header 3343e41d09dSXin LI0x1FF0 string TMR\ SEGA 3353e41d09dSXin LI>0x1FF0 use sega-master-system-rom-header 336b6cee71dSXin LI 337b6cee71dSXin LI#------------------------------------------------------------------------------ 3383e41d09dSXin LI# saturn: file(1) magic for the Sega Saturn disc image format. 3393e41d09dSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 340b6cee71dSXin LI# 3413e41d09dSXin LI 3423e41d09dSXin LI# Common Sega Saturn disc header format. 3433e41d09dSXin LI# NOTE: Title is 112 bytes, but we're only showing 32 due to space padding. 3443e41d09dSXin LI# TODO: Release date, device information, region code, others? 3453e41d09dSXin LI0 name sega-saturn-disc-header 3463e41d09dSXin LI>0x60 string >\0 \b: "%.32s" 3473e41d09dSXin LI>0x20 string >\0 (%.10s 3483e41d09dSXin LI>>0x2A string >\0 \b, %.6s) 3493e41d09dSXin LI>>0x2A byte 0 \b) 3503e41d09dSXin LI 3513e41d09dSXin LI# 2048-byte sector version. 3523e41d09dSXin LI0 string SEGA\ SEGASATURN\ Sega Saturn disc image 3532dc4dbb9SEitan Adler!:mime application/x-saturn-rom 3543e41d09dSXin LI>0 use sega-saturn-disc-header 3553e41d09dSXin LI>0 byte x (2048-byte sectors) 3563e41d09dSXin LI# 2352-byte sector version. 3573e41d09dSXin LI0x10 string SEGA\ SEGASATURN\ Sega Saturn disc image 3582dc4dbb9SEitan Adler!:mime application/x-saturn-rom 3593e41d09dSXin LI>0x10 use sega-saturn-disc-header 3603e41d09dSXin LI>0 byte x (2352-byte sectors) 3613e41d09dSXin LI 3623e41d09dSXin LI#------------------------------------------------------------------------------ 3633e41d09dSXin LI# dreamcast: file(1) magic for the Sega Dreamcast disc image format. 3643e41d09dSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 36548c779cdSXin LI# Reference: https://mc.pp.se/dc/ip0000.bin.html 366b6cee71dSXin LI# 3673e41d09dSXin LI 3683e41d09dSXin LI# Common Sega Dreamcast disc header format. 3693e41d09dSXin LI# NOTE: Title is 128 bytes, but we're only showing 32 due to space padding. 3703e41d09dSXin LI# TODO: Release date, device information, region code, others? 3713e41d09dSXin LI0 name sega-dreamcast-disc-header 3723e41d09dSXin LI>0x80 string >\0 \b: "%.32s" 3733e41d09dSXin LI>0x40 string >\0 (%.10s 3743e41d09dSXin LI>>0x4A string >\0 \b, %.6s) 3753e41d09dSXin LI>>0x4A byte 0 \b) 3763e41d09dSXin LI 3773e41d09dSXin LI# 2048-byte sector version. 3783e41d09dSXin LI0 string SEGA\ SEGAKATANA\ Sega Dreamcast disc image 3792dc4dbb9SEitan Adler!:mime application/x-dc-rom 3803e41d09dSXin LI>0 use sega-dreamcast-disc-header 3813e41d09dSXin LI>0 byte x (2048-byte sectors) 3823e41d09dSXin LI# 2352-byte sector version. 3833e41d09dSXin LI0x10 string SEGA\ SEGAKATANA\ Sega Dreamcast disc image 3842dc4dbb9SEitan Adler!:mime application/x-dc-rom 3853e41d09dSXin LI>0x10 use sega-dreamcast-disc-header 3863e41d09dSXin LI>0 byte x (2352-byte sectors) 387b6cee71dSXin LI 388b6cee71dSXin LI#------------------------------------------------------------------------------ 389b6cee71dSXin LI# dreamcast: file(1) uncertain magic for the Sega Dreamcast VMU image format 390b6cee71dSXin LI# 391b6cee71dSXin LI0 belong 0x21068028 Sega Dreamcast VMU game image 392b6cee71dSXin LI0 string LCDi Dream Animator file 393b6cee71dSXin LI 394b6cee71dSXin LI#------------------------------------------------------------------------------ 3953e41d09dSXin LI# z64: file(1) magic for the Z64 format N64 ROM dumps 3963e41d09dSXin LI# Reference: http://forum.pj64-emu.com/showthread.php?t=2239 3973e41d09dSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 398b6cee71dSXin LI# 3993e41d09dSXin LI0 bequad 0x803712400000000F Nintendo 64 ROM image 4002dc4dbb9SEitan Adler!:mime application/x-n64-rom 4013e41d09dSXin LI>0x20 string >\0 \b: "%.20s" 4023e41d09dSXin LI>0x3B string x (%.4s 4033e41d09dSXin LI>0x3F byte x \b, Rev.%02u) 404b6cee71dSXin LI 4053e41d09dSXin LI#------------------------------------------------------------------------------ 4063e41d09dSXin LI# v64: file(1) magic for the V64 format N64 ROM dumps 4073e41d09dSXin LI# Same as z64 format, but with 16-bit byteswapping. 4083e41d09dSXin LI# 4093e41d09dSXin LI0 bequad 0x3780401200000F00 Nintendo 64 ROM image (V64) 4102dc4dbb9SEitan Adler!:mime application/x-n64-rom 4113e41d09dSXin LI 4123e41d09dSXin LI#------------------------------------------------------------------------------ 4133e41d09dSXin LI# n64-swap2: file(1) magic for the swap2 format N64 ROM dumps 4143e41d09dSXin LI# Same as z64 format, but with swapped 16-bit words. 4153e41d09dSXin LI# 4163e41d09dSXin LI0 bequad 0x12408037000F0000 Nintendo 64 ROM image (wordswapped) 4172dc4dbb9SEitan Adler!:mime application/x-n64-rom 4183e41d09dSXin LI 4193e41d09dSXin LI#------------------------------------------------------------------------------ 4203e41d09dSXin LI# n64-le32: file(1) magic for the 32-bit byteswapped format N64 ROM dumps 4213e41d09dSXin LI# Same as z64 format, but with 32-bit byteswapping. 4223e41d09dSXin LI# 4233e41d09dSXin LI0 bequad 0x401237800F000000 Nintendo 64 ROM image (32-bit byteswapped) 4242dc4dbb9SEitan Adler!:mime application/x-n64-rom 4253e41d09dSXin LI 4263e41d09dSXin LI#------------------------------------------------------------------------------ 4273e41d09dSXin LI# gba: file(1) magic for the Nintendo Game Boy Advance raw ROM format 42848c779cdSXin LI# Reference: https://problemkaputt.de/gbatek.htm#gbacartridgeheader 4293e41d09dSXin LI# 4303e41d09dSXin LI# Original version from: "Nelson A. de Oliveira" <naoliv@gmail.com> 4313e41d09dSXin LI# Updated version from: David Korth <gerbilsoft@gerbilsoft.com> 4323e41d09dSXin LI# 4333e41d09dSXin LI4 bequad 0x24FFAE51699AA221 Game Boy Advance ROM image 4342dc4dbb9SEitan Adler!:mime application/x-gba-rom 4353e41d09dSXin LI>0xA0 string >\0 \b: "%.12s" 4363e41d09dSXin LI>0xAC string x (%.6s 4373e41d09dSXin LI>0xBC byte x \b, Rev.%02u) 4383e41d09dSXin LI 4393e41d09dSXin LI#------------------------------------------------------------------------------ 4403e41d09dSXin LI# nds: file(1) magic for the Nintendo DS(i) raw ROM format 44148c779cdSXin LI# Reference: https://problemkaputt.de/gbatek.htm#dscartridgeheader 4423e41d09dSXin LI# 4433e41d09dSXin LI# Original version from: "Nelson A. de Oliveira" <naoliv@gmail.com> 4443e41d09dSXin LI# Updated version from: David Korth <gerbilsoft@gerbilsoft.com> 4453e41d09dSXin LI# 4463e41d09dSXin LI0xC0 bequad 0x24FFAE51699AA221 Nintendo DS ROM image 4472dc4dbb9SEitan Adler!:mime application/x-nintendo-ds-rom 4483e41d09dSXin LI>0x00 string >\0 \b: "%.12s" 4493e41d09dSXin LI>0x0C string x (%.6s 4503e41d09dSXin LI>0x1E byte x \b, Rev.%02u) 4513e41d09dSXin LI>0x12 byte 2 (DSi enhanced) 4523e41d09dSXin LI>0x12 byte 3 (DSi only) 45340427ccaSGordon Tetlow# Secure Area check. 45440427ccaSGordon Tetlow>0x20 lelong <0x4000 (homebrew) 45540427ccaSGordon Tetlow>0x20 lelong >0x3FFF 45640427ccaSGordon Tetlow>>0x4000 lequad 0x0000000000000000 (multiboot) 45740427ccaSGordon Tetlow>>0x4000 lequad !0x0000000000000000 45840427ccaSGordon Tetlow>>>0x4000 lequad 0xE7FFDEFFE7FFDEFF (decrypted) 45940427ccaSGordon Tetlow>>>0x4000 lequad !0xE7FFDEFFE7FFDEFF 46040427ccaSGordon Tetlow>>>>0x1000 lequad 0x0000000000000000 (encrypted) 46140427ccaSGordon Tetlow>>>>0x1000 lequad !0x0000000000000000 (mask ROM) 4623e41d09dSXin LI 4633e41d09dSXin LI#------------------------------------------------------------------------------ 4643e41d09dSXin LI# nds_passme: file(1) magic for Nintendo DS ROM images for GBA cartridge boot. 4653e41d09dSXin LI# This is also used for loading .nds files using the MSET exploit on 3DS. 4663e41d09dSXin LI# Reference: https://github.com/devkitPro/ndstool/blob/master/source/ndscreate.cpp 4673e41d09dSXin LI0xC0 bequad 0xC8604FE201708FE2 Nintendo DS Slot-2 ROM image (PassMe) 4682dc4dbb9SEitan Adler!:mime application/x-nintendo-ds-rom 4693e41d09dSXin LI 4703e41d09dSXin LI#------------------------------------------------------------------------------ 4713e41d09dSXin LI# ngp: file(1) magic for the Neo Geo Pocket (Color) raw ROM format. 4723e41d09dSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 4733e41d09dSXin LI# References: 4743e41d09dSXin LI# - https://neogpc.googlecode.com/svn-history/r10/trunk/src/core/neogpc.cpp 47548c779cdSXin LI# - https://www.devrs.com/ngp/files/ngpctech.txt 4763e41d09dSXin LI# 4773e41d09dSXin LI0x0A string BY\ SNK\ CORPORATION Neo Geo Pocket 4782dc4dbb9SEitan Adler!:mime application/x-neo-geo-pocket-rom 4793e41d09dSXin LI>0x23 byte 0x10 Color 4803e41d09dSXin LI>0 byte x ROM image 4813e41d09dSXin LI>0x24 string >\0 \b: "%.12s" 4823e41d09dSXin LI>0x1F byte 0xFF (debug mode enabled) 483b6cee71dSXin LI 484b6cee71dSXin LI#------------------------------------------------------------------------------ 485b6cee71dSXin LI# msx: file(1) magic for MSX game cartridge dumps 486b6cee71dSXin LI# Too simple - MPi 487b6cee71dSXin LI#0 beshort 0x4142 MSX game cartridge dump 488b6cee71dSXin LI 489b6cee71dSXin LI#------------------------------------------------------------------------------ 490b6cee71dSXin LI# Sony Playstation executables (Adam Sjoegren <asjo@diku.dk>) : 491b6cee71dSXin LI0 string PS-X\ EXE Sony Playstation executable 492*43a5ec4eSXin LI>16 lelong x PC=%#08x, 493*43a5ec4eSXin LI>20 lelong !0 GP=%#08x, 494*43a5ec4eSXin LI>24 lelong !0 .text=[%#08x, 495*43a5ec4eSXin LI>>28 lelong x \b%#x], 496*43a5ec4eSXin LI>32 lelong !0 .data=[%#08x, 497*43a5ec4eSXin LI>>36 lelong x \b%#x], 498*43a5ec4eSXin LI>40 lelong !0 .bss=[%#08x, 499*43a5ec4eSXin LI>>44 lelong x \b%#x], 500*43a5ec4eSXin LI>48 lelong !0 Stack=%#08x, 5013e41d09dSXin LI>48 lelong =0 No Stack!, 502*43a5ec4eSXin LI>52 lelong !0 StackSize=%#x, 5033e41d09dSXin LI#>76 string >\0 (%s) 504b6cee71dSXin LI# Area: 505b6cee71dSXin LI>113 string x (%s) 506b6cee71dSXin LI 5073e41d09dSXin LI# CPE executables 5083e41d09dSXin LI0 string CPE CPE executable 5093e41d09dSXin LI>3 byte x (version %d) 5103e41d09dSXin LI 511b6cee71dSXin LI#------------------------------------------------------------------------------ 512b6cee71dSXin LI# Microsoft Xbox executables .xbe (Esa Hyytia <ehyytia@cc.hut.fi>) 51348c779cdSXin LI0 string XBEH Microsoft Xbox executable 514d38c30c0SXin LI!:mime audio/x-xbox-executable 515d38c30c0SXin LI!:ext xbe 51648c779cdSXin LI# expect base address of 0x10000 51748c779cdSXin LI>0x0104 ulelong =0x10000 51848c779cdSXin LI>>(0x0118.l-0x0FFF4) lestring16 x \b: "%.40s" 51948c779cdSXin LI>>(0x0118.l-0x0FFF5) byte x (%c 52048c779cdSXin LI>>(0x0118.l-0x0FFF6) byte x \b%c- 52148c779cdSXin LI>>(0x0118.l-0x0FFF8) uleshort x \b%03u) 52248c779cdSXin LI>>(0x0118.l-0x0FF60) ulelong&0x80000007 0x80000007 \b, all regions 52348c779cdSXin LI>>(0x0118.l-0x0FF60) ulelong&0x80000007 !0x80000007 52448c779cdSXin LI>>>(0x0118.l-0x0FF60) ulelong >0 (regions: 52548c779cdSXin LI>>>>(0x0118.l-0x0FF60) ulelong &0x00000001 NA 52648c779cdSXin LI>>>>(0x0118.l-0x0FF60) ulelong &0x00000002 Japan 52748c779cdSXin LI>>>>(0x0118.l-0x0FF60) ulelong &0x00000004 Rest_of_World 52848c779cdSXin LI>>>>(0x0118.l-0x0FF60) ulelong &0x80000000 Manufacturer 52948c779cdSXin LI>>>(0x0118.l-0x0FF60) ulelong >0 \b) 530b6cee71dSXin LI# probabilistic checks whether signed or not 531b6cee71dSXin LI>0x0004 ulelong =0x0 532b6cee71dSXin LI>>&2 ulelong =0x0 533b6cee71dSXin LI>>>&2 ulelong =0x0 \b, not signed 534b6cee71dSXin LI>0x0004 ulelong >0 535b6cee71dSXin LI>>&2 ulelong >0 536b6cee71dSXin LI>>>&2 ulelong >0 \b, signed 537b6cee71dSXin LI 538b6cee71dSXin LI# -------------------------------- 539b6cee71dSXin LI# Microsoft Xbox data file formats 540b6cee71dSXin LI0 string XIP0 XIP, Microsoft Xbox data 541b6cee71dSXin LI0 string XTF0 XTF, Microsoft Xbox data 542b6cee71dSXin LI 54348c779cdSXin LI#------------------------------------------------------------------------------ 54448c779cdSXin LI# Microsoft Xbox 360 executables (.xex) 54548c779cdSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 54648c779cdSXin LI# References: 54748c779cdSXin LI# - https://free60project.github.io/wiki/XEX.html 54848c779cdSXin LI# - https://github.com/xenia-project/xenia/blob/HEAD/src/xenia/kernel/util/xex2_info.h 54948c779cdSXin LI 55048c779cdSXin LI# Title ID (part of Execution ID section) 55148c779cdSXin LI0 name xbox-360-xex-execution-id 55248c779cdSXin LI>(0.L+0xC) byte x (%c 55348c779cdSXin LI>(0.L+0xD) byte x \b%c 554d38c30c0SXin LI>(0.L+0xE) beshort x \b-%04u, media ID: 555d38c30c0SXin LI>(0.L) belong x %08X) 556d38c30c0SXin LI 557d38c30c0SXin LI# Region code (part of Security Info) 558d38c30c0SXin LI0 name xbox-360-xex-region-code 559d38c30c0SXin LI>0 ubelong 0xFFFFFFFF \b, all regions 560d38c30c0SXin LI>0 ubelong !0xFFFFFFFF 561d38c30c0SXin LI>>0 ubelong >0 (regions: 562d38c30c0SXin LI>>0 ubelong&0x000000FF 0x000000FF USA 563d38c30c0SXin LI>>0 ubelong&0x00000100 0x00000100 Japan 564d38c30c0SXin LI>>0 ubelong&0x00000200 0x00000200 China 565d38c30c0SXin LI>>0 ubelong&0x0000FC00 0x0000FC00 Asia 566d38c30c0SXin LI>>0 ubelong&0x00FF0000 0x00FF0000 PAL 567d38c30c0SXin LI>>0 ubelong&0x00FF0000 0x00FE0000 PAL [except AU/NZ] 568d38c30c0SXin LI>>0 ubelong&0x00FF0000 0x00010000 AU/NZ 569d38c30c0SXin LI>>0 ubelong&0xFF000000 0xFF000000 Other 570d38c30c0SXin LI>>0 ubelong >0 \b) 57148c779cdSXin LI 57248c779cdSXin LI0 string XEX2 Microsoft Xbox 360 executable 573d38c30c0SXin LI!:mime audio/x-xbox360-executable 574d38c30c0SXin LI!:ext xex 57548c779cdSXin LI>0x18 search/0x100 \x00\x04\x00\x06 57648c779cdSXin LI>>&0 use xbox-360-xex-execution-id 577d38c30c0SXin LI>(0x010.L+0x178) use xbox-360-xex-region-code 57848c779cdSXin LI 579d38c30c0SXin LI0 string XEX1 Microsoft Xbox 360 executable (XEX1) 580d38c30c0SXin LI!:mime audio/x-xbox360-executable 581d38c30c0SXin LI!:ext xex 582d38c30c0SXin LI>0x18 search/0x100 \x00\x04\x00\x06 583d38c30c0SXin LI>>&0 use xbox-360-xex-execution-id 584d38c30c0SXin LI>(0x010.L+0x154) use xbox-360-xex-region-code 58548c779cdSXin LI 586d38c30c0SXin LI#------------------------------------------------------------------------------ 587d38c30c0SXin LI# Microsoft Xbox 360 packages 588d38c30c0SXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 589d38c30c0SXin LI# References: 590d38c30c0SXin LI# - https://free60project.github.io/wiki/STFS.html 591d38c30c0SXin LI# - https://github.com/xenia-project/xenia/blob/HEAD/src/xenia/kernel/util/xex2_info.h 592d38c30c0SXin LI 593d38c30c0SXin LI# TODO: More information for console-signed packages. 594d38c30c0SXin LI 595d38c30c0SXin LI0 name xbox-360-package 596d38c30c0SXin LI>0x360 byte x (%c 597d38c30c0SXin LI>0x361 byte x \b%c 598d38c30c0SXin LI>0x362 beshort x \b-%04u, media ID: 599d38c30c0SXin LI>0x354 belong x %08X) 600d38c30c0SXin LI>0x344 belong x \b, content type: 601d38c30c0SXin LI>>0x344 belong 0x1 Saved Game 602d38c30c0SXin LI>>0x344 belong 0x2 Marketplace Content 603d38c30c0SXin LI>>0x344 belong 0x3 Publisher 604d38c30c0SXin LI>>0x344 belong 0x1000 Xbox 360 Title 605d38c30c0SXin LI>>0x344 belong 0x2000 IPTV Pause Buffer 606d38c30c0SXin LI>>0x344 belong 0x4000 Installed Game 607d38c30c0SXin LI>>0x344 belong 0x5000 Original Xbox Game 608d38c30c0SXin LI>>0x344 belong 0x9000 Avatar Item 609d38c30c0SXin LI>>0x344 belong 0x10000 Profile 610d38c30c0SXin LI>>0x344 belong 0x20000 Gamer Picture 611d38c30c0SXin LI>>0x344 belong 0x30000 Theme 612d38c30c0SXin LI>>0x344 belong 0x40000 Cache File 613d38c30c0SXin LI>>0x344 belong 0x50000 Storage Download 614d38c30c0SXin LI>>0x344 belong 0x60000 Xbox Saved Game 615d38c30c0SXin LI>>0x344 belong 0x70000 Xbox Download 616d38c30c0SXin LI>>0x344 belong 0x80000 Game Demo 617d38c30c0SXin LI>>0x344 belong 0x90000 Video 618d38c30c0SXin LI>>0x344 belong 0xA0000 Game 619d38c30c0SXin LI>>0x344 belong 0xB0000 Installer 620d38c30c0SXin LI>>0x344 belong 0xC0000 Game Trailer 621d38c30c0SXin LI>>0x344 belong 0xD0000 Arcade Title 622d38c30c0SXin LI>>0x344 belong 0xE0000 XNA 623d38c30c0SXin LI>>0x344 belong 0xF0000 License Store 624d38c30c0SXin LI>>0x344 belong 0x100000 Movie 625d38c30c0SXin LI>>0x344 belong 0x200000 TV 626d38c30c0SXin LI>>0x344 belong 0x300000 Music Video 627d38c30c0SXin LI>>0x344 belong 0x400000 Game Video 628d38c30c0SXin LI>>0x344 belong 0x500000 Podcast Video 629d38c30c0SXin LI>>0x344 belong 0x600000 Viral Video 630d38c30c0SXin LI>>0x344 belong 0x2000000 Community Game 631d38c30c0SXin LI 632d38c30c0SXin LI0 string CON\x20 Microsoft Xbox 360 package (console-signed) 633d38c30c0SXin LI>0 use xbox-360-package 6342726a701SXin LI0 string PIRS 6352726a701SXin LI>0 belong 0 Microsoft Xbox 360 package (non-Xbox Live) 6362726a701SXin LI>>0 use xbox-360-package 6372726a701SXin LI0 string LIVE 6382726a701SXin LI>0x104 belong 0 Microsoft Xbox 360 package (Xbox Live) 6392726a701SXin LI>>0 use xbox-360-package 64048c779cdSXin LI 641b6cee71dSXin LI# Atari Lynx cartridge dump (EXE/BLL header) 642b6cee71dSXin LI# From: "Stefan A. Haubenthal" <polluks@web.de> 643b6cee71dSXin LI 644b6cee71dSXin LI# Double-check that the image type matches too, 0x8008 conflicts with 645b6cee71dSXin LI# 8 character OMF-86 object file headers. 646b6cee71dSXin LI0 beshort 0x8008 647b6cee71dSXin LI>6 string BS93 Lynx homebrew cartridge 6482dc4dbb9SEitan Adler!:mime application/x-atari-lynx-rom 649b6cee71dSXin LI>>2 beshort x \b, RAM start $%04x 650b6cee71dSXin LI>6 string LYNX Lynx cartridge 6512dc4dbb9SEitan Adler!:mime application/x-atari-lynx-rom 652b6cee71dSXin LI>>2 beshort x \b, RAM start $%04x 653b6cee71dSXin LI 654b6cee71dSXin LI# Opera file system that is used on the 3DO console 655b6cee71dSXin LI# From: Serge van den Boom <svdb@stack.nl> 656b6cee71dSXin LI0 string \x01ZZZZZ\x01 3DO "Opera" file system 657b6cee71dSXin LI 65858a0f0d0SEitan Adler# From: Alex Myczko <alex@aiei.ch> 6595f0216bdSXin LI# From: David Pflug <david@pflug.email> 6605f0216bdSXin LI# is the offset 12 or the offset 16 correct? 6615f0216bdSXin LI# GBS (Game Boy Sound) magic 6625f0216bdSXin LI# ftp://ftp.modland.com/pub/documents/format_documentation/\ 6635f0216bdSXin LI# Gameboy%20Sound%20System%20(.gbs).txt 664b6cee71dSXin LI0 string GBS Nintendo Gameboy Music/Audio Data 6655f0216bdSXin LI#12 string GameBoy\ Music\ Module Nintendo Gameboy Music Module 6662dc4dbb9SEitan Adler>16 string >\0 ("%.32s" by 6672dc4dbb9SEitan Adler>48 string >\0 %.32s, copyright 6682dc4dbb9SEitan Adler>80 string >\0 %.32s), 6692dc4dbb9SEitan Adler>3 byte x version %u, 6702dc4dbb9SEitan Adler>4 byte x %u tracks 671b6cee71dSXin LI 67240427ccaSGordon Tetlow# IPS Patch Files from: From: Thomas Klausner <tk@giga.or.at> 67348c779cdSXin LI# see https://zerosoft.zophar.net/ips.php 67440427ccaSGordon Tetlow0 string PATCH IPS patch file 6752726a701SXin LI!:ext ips 6762726a701SXin LI 6772726a701SXin LI# BPS Patch Files - from: David Korth <gerbilsoft@gerbilsoft.com> 6782726a701SXin LI# Reference: https://www.romhacking.net/documents/746/ 6792726a701SXin LI0 string BPS1 BPS patch file 6802726a701SXin LI!:ext bps 6812726a701SXin LI 6822726a701SXin LI# APS Patch Files - from: David Korth <gerbilsoft@gerbilsoft.com> 6832726a701SXin LI# Reference: https://github.com/btimofeev/UniPatcher/wiki/APS-(N64) 6842726a701SXin LI0 string APS10 APS patch file 6852726a701SXin LI!:ext aps 6862726a701SXin LI>5 byte 0 \b, simple patch 6872726a701SXin LI>5 byte 1 \b, N64-specific patch for 6882726a701SXin LI>>58 byte x N%c 6892726a701SXin LI>>59 byte x \b%c 6902726a701SXin LI>>60 byte x \b%c 6912726a701SXin LI>7 byte !0x20 6922726a701SXin LI# FIXME: /T specifier isn't working with a fixed-length string. 6932726a701SXin LI>>7 string x \b: "%.50s" 6942726a701SXin LI 6952726a701SXin LI# UPS Patch Files - from: David Korth <gerbilsoft@gerbilsoft.com> 6962726a701SXin LI# Reference: http://fileformats.archiveteam.org/wiki/UPS_(binary_patch_format) 6972726a701SXin LI0 string UPS1 UPS patch file 6982726a701SXin LI!:ext ups 69940427ccaSGordon Tetlow 700b6cee71dSXin LI# Playstations Patch Files from: From: Thomas Klausner <tk@giga.or.at> 701b6cee71dSXin LI0 string PPF30 Playstation Patch File version 3.0 702b6cee71dSXin LI>5 byte 0 \b, PPF 1.0 patch 703b6cee71dSXin LI>5 byte 1 \b, PPF 2.0 patch 704b6cee71dSXin LI>5 byte 2 \b, PPF 3.0 patch 705b6cee71dSXin LI>>56 byte 0 \b, Imagetype BIN (any) 706b6cee71dSXin LI>>56 byte 1 \b, Imagetype GI (PrimoDVD) 707b6cee71dSXin LI>>57 byte 0 \b, Blockcheck disabled 708b6cee71dSXin LI>>57 byte 1 \b, Blockcheck enabled 709b6cee71dSXin LI>>58 byte 0 \b, Undo data not available 710b6cee71dSXin LI>>58 byte 1 \b, Undo data available 711b6cee71dSXin LI>6 string x \b, description: %s 712b6cee71dSXin LI 713b6cee71dSXin LI0 string PPF20 Playstation Patch File version 2.0 714b6cee71dSXin LI>5 byte 0 \b, PPF 1.0 patch 715b6cee71dSXin LI>5 byte 1 \b, PPF 2.0 patch 716b6cee71dSXin LI>>56 lelong >0 \b, size of file to patch %d 717b6cee71dSXin LI>6 string x \b, description: %s 718b6cee71dSXin LI 719b6cee71dSXin LI0 string PPF10 Playstation Patch File version 1.0 720b6cee71dSXin LI>5 byte 0 \b, Simple Encoding 721b6cee71dSXin LI>6 string x \b, description: %s 722b6cee71dSXin LI 723b6cee71dSXin LI# From: Daniel Dawson <ddawson@icehouse.net> 724b6cee71dSXin LI# SNES9x .smv "movie" file format. 725b6cee71dSXin LI0 string SMV\x1A SNES9x input recording 726b6cee71dSXin LI>0x4 lelong x \b, version %d 727b6cee71dSXin LI# version 4 is latest so far 728b6cee71dSXin LI>0x4 lelong <5 729b6cee71dSXin LI>>0x8 ledate x \b, recorded at %s 730b6cee71dSXin LI>>0xc lelong >0 \b, rerecorded %d times 731b6cee71dSXin LI>>0x10 lelong x \b, %d frames long 732b6cee71dSXin LI>>0x14 byte >0 \b, data for controller(s): 733b6cee71dSXin LI>>>0x14 byte &0x1 #1 734b6cee71dSXin LI>>>0x14 byte &0x2 #2 735b6cee71dSXin LI>>>0x14 byte &0x4 #3 736b6cee71dSXin LI>>>0x14 byte &0x8 #4 737b6cee71dSXin LI>>>0x14 byte &0x10 #5 738b6cee71dSXin LI>>0x15 byte ^0x1 \b, begins from snapshot 739b6cee71dSXin LI>>0x15 byte &0x1 \b, begins from reset 740b6cee71dSXin LI>>0x15 byte ^0x2 \b, NTSC standard 741b6cee71dSXin LI>>0x15 byte &0x2 \b, PAL standard 742b6cee71dSXin LI>>0x17 byte &0x1 \b, settings: 743b6cee71dSXin LI# WIP1Timing not used as of version 4 744b6cee71dSXin LI>>>0x4 lelong <4 745b6cee71dSXin LI>>>>0x17 byte &0x2 WIP1Timing 746b6cee71dSXin LI>>>0x17 byte &0x4 Left+Right 747b6cee71dSXin LI>>>0x17 byte &0x8 VolumeEnvX 748b6cee71dSXin LI>>>0x17 byte &0x10 FakeMute 749b6cee71dSXin LI>>>0x17 byte &0x20 SyncSound 750b6cee71dSXin LI# New flag as of version 4 751b6cee71dSXin LI>>>0x4 lelong >3 752b6cee71dSXin LI>>>>0x17 byte &0x80 NoCPUShutdown 753b6cee71dSXin LI>>0x4 lelong <4 754b6cee71dSXin LI>>>0x18 lelong >0x23 755b6cee71dSXin LI>>>>0x20 leshort !0 756b6cee71dSXin LI>>>>>0x20 lestring16 x \b, metadata: "%s" 757b6cee71dSXin LI>>0x4 lelong >3 758b6cee71dSXin LI>>>0x24 byte >0 \b, port 1: 759b6cee71dSXin LI>>>>0x24 byte 1 joypad 760b6cee71dSXin LI>>>>0x24 byte 2 mouse 761b6cee71dSXin LI>>>>0x24 byte 3 SuperScope 762b6cee71dSXin LI>>>>0x24 byte 4 Justifier 763b6cee71dSXin LI>>>>0x24 byte 5 multitap 764b6cee71dSXin LI>>>0x24 byte >0 \b, port 2: 765b6cee71dSXin LI>>>>0x25 byte 1 joypad 766b6cee71dSXin LI>>>>0x25 byte 2 mouse 767b6cee71dSXin LI>>>>0x25 byte 3 SuperScope 768b6cee71dSXin LI>>>>0x25 byte 4 Justifier 769b6cee71dSXin LI>>>>0x25 byte 5 multitap 770b6cee71dSXin LI>>>0x18 lelong >0x43 771b6cee71dSXin LI>>>>0x40 leshort !0 772b6cee71dSXin LI>>>>>0x40 lestring16 x \b, metadata: "%s" 773b6cee71dSXin LI>>0x17 byte &0x40 \b, ROM: 774*43a5ec4eSXin LI>>>(0x18.l-26) lelong x CRC32 %#08x 775b6cee71dSXin LI>>>(0x18.l-23) string x "%s" 776b6cee71dSXin LI 777b6cee71dSXin LI# Type: scummVM savegame files 778b6cee71dSXin LI# From: Sven Hartge <debian@ds9.argh.org> 779b6cee71dSXin LI0 string SCVM ScummVM savegame 780b6cee71dSXin LI>12 string >\0 "%s" 7813e41d09dSXin LI 7823e41d09dSXin LI#------------------------------------------------------------------------------ 7833e41d09dSXin LI# Nintendo GameCube / Wii file formats. 7843e41d09dSXin LI# 7853e41d09dSXin LI 7863e41d09dSXin LI# Type: Nintendo GameCube/Wii common disc header data. 7873e41d09dSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 78848c779cdSXin LI# Reference: https://wiibrew.org/wiki/Wii_Disc 7893e41d09dSXin LI0 name nintendo-gcn-disc-common 7903e41d09dSXin LI>0x20 string x "%.64s" 7913e41d09dSXin LI>0x00 string x (%.6s 7923e41d09dSXin LI>0x06 byte >0 7933e41d09dSXin LI>>0x06 byte 1 \b, Disc 2 7943e41d09dSXin LI>>0x06 byte 2 \b, Disc 3 7953e41d09dSXin LI>>0x06 byte 3 \b, Disc 4 7963e41d09dSXin LI>0x07 byte x \b, Rev.%02u) 7972dc4dbb9SEitan Adler>0x18 belong 0x5D1C9EA3 7982dc4dbb9SEitan Adler>>0x60 beshort 0x0101 \b (Unencrypted) 7992726a701SXin LI>0x200 string NKIT \b (NKit compressed) 8002726a701SXin LI 8013e41d09dSXin LI 8023e41d09dSXin LI# Type: Nintendo GameCube disc image 8033e41d09dSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 80448c779cdSXin LI# Reference: https://wiibrew.org/wiki/Wii_Disc 8053e41d09dSXin LI0x1C belong 0xC2339F3D Nintendo GameCube disc image: 8062dc4dbb9SEitan Adler!:mime application/x-gamecube-rom 8073e41d09dSXin LI>0 use nintendo-gcn-disc-common 8083e41d09dSXin LI 809282e23f0SXin LI# Type: Nintendo GameCube embedded disc image 810282e23f0SXin LI# Commonly found on demo discs. 811282e23f0SXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 812282e23f0SXin LI# Reference: http://hitmen.c02.at/files/yagcd/yagcd/index.html#idx14.8 813282e23f0SXin LI0 belong 0xAE0F38A2 814282e23f0SXin LI>0x0C belong 0x00100000 815282e23f0SXin LI>>(8.L+0x1C) belong 0xC2339F3D Nintendo GameCube embedded disc image: 8162dc4dbb9SEitan Adler!:mime application/x-gamecube-rom 817282e23f0SXin LI>>>(8.L) use nintendo-gcn-disc-common 818282e23f0SXin LI 8193e41d09dSXin LI# Type: Nintendo Wii disc image 8203e41d09dSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 82148c779cdSXin LI# Reference: https://wiibrew.org/wiki/Wii_Disc 8223e41d09dSXin LI0x18 belong 0x5D1C9EA3 Nintendo Wii disc image: 8233e41d09dSXin LI>0 use nintendo-gcn-disc-common 8243e41d09dSXin LI 8253e41d09dSXin LI# Type: Nintendo Wii disc image (WBFS format) 8263e41d09dSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 82748c779cdSXin LI# Reference: https://wiibrew.org/wiki/Wii_Disc 8283e41d09dSXin LI0 string WBFS 8293e41d09dSXin LI>0x218 belong 0x5D1C9EA3 Nintendo Wii disc image (WBFS format): 8302dc4dbb9SEitan Adler!:mime application/x-wii-rom 8313e41d09dSXin LI>>0x200 use nintendo-gcn-disc-common 8323e41d09dSXin LI 83340427ccaSGordon Tetlow# Type: Nintendo GameCube/Wii disc image (CISO format) 83440427ccaSGordon Tetlow# NOTE: This is NOT the same as Compact ISO or PSP CISO, 83540427ccaSGordon Tetlow# though it has the same magic number. 83640427ccaSGordon Tetlow0 string CISO 83740427ccaSGordon Tetlow# Other fields are used to determine what type of CISO this is: 83840427ccaSGordon Tetlow# - 0x04 == 0x00200000: GameCube/Wii CISO (block_size) 83940427ccaSGordon Tetlow# - 0x10 == 0x00000800: PSP CISO (ISO-9660 sector size) 84040427ccaSGordon Tetlow# - None of the above: Compact ISO. 84140427ccaSGordon Tetlow>4 lelong 0x200000 84240427ccaSGordon Tetlow>>8 byte 1 84340427ccaSGordon Tetlow>>>0x801C belong 0xC2339F3D Nintendo GameCube disc image (CISO format): 8442dc4dbb9SEitan Adler!:mime application/x-wii-rom 84540427ccaSGordon Tetlow>>>>0x8000 use nintendo-gcn-disc-common 84640427ccaSGordon Tetlow>>>0x8018 belong 0x5D1C9EA3 Nintendo Wii disc image (CISO format): 8472dc4dbb9SEitan Adler!:mime application/x-wii-rom 84840427ccaSGordon Tetlow>>>>0x8000 use nintendo-gcn-disc-common 84940427ccaSGordon Tetlow 85040427ccaSGordon Tetlow# Type: Nintendo GameCube/Wii disc image (GCZ format) 85140427ccaSGordon Tetlow# Due to zlib compression, we can't get the actual disc information. 85240427ccaSGordon Tetlow0 lelong 0xB10BC001 85340427ccaSGordon Tetlow>4 lelong 0 Nintendo GameCube disc image (GCZ format) 8542dc4dbb9SEitan Adler!:mime application/x-gamecube-rom 85540427ccaSGordon Tetlow>4 lelong 1 Nintendo Wii disc image (GCZ format) 8562dc4dbb9SEitan Adler!:mime application/x-wii-rom 8572dc4dbb9SEitan Adler>4 default x Nintendo GameCube/Wii disc image (GCZ format) 85840427ccaSGordon Tetlow 85940427ccaSGordon Tetlow# Type: Nintendo GameCube/Wii disc image (WDF format) 86040427ccaSGordon Tetlow0 string WII\001DISC 86140427ccaSGordon Tetlow>8 belong 1 86240427ccaSGordon Tetlow# WDFv1 86340427ccaSGordon Tetlow>>0x54 belong 0xC2339F3D Nintendo GameCube disc image (WDFv1 format): 8642dc4dbb9SEitan Adler!:mime application/x-gamecube-rom 86540427ccaSGordon Tetlow>>>0x38 use nintendo-gcn-disc-common 86640427ccaSGordon Tetlow>>0x58 belong 0x5D1C9EA3 Nintendo Wii disc image (WDFv1 format): 8672dc4dbb9SEitan Adler!:mime application/x-wii-rom 86840427ccaSGordon Tetlow>>>0x38 use nintendo-gcn-disc-common 86940427ccaSGordon Tetlow>8 belong 2 87040427ccaSGordon Tetlow# WDFv2 87140427ccaSGordon Tetlow>>(12.L+0x1C) belong 0xC2339F3D Nintendo GameCube disc image (WDFv2 format): 8722dc4dbb9SEitan Adler!:mime application/x-gamecube-rom 87340427ccaSGordon Tetlow>>>(12.L) use nintendo-gcn-disc-common 87440427ccaSGordon Tetlow>>(12.L+0x18) belong 0x5D1C9EA3 Nintendo Wii disc image (WDFv2 format): 8752dc4dbb9SEitan Adler!:mime application/x-wii-rom 87640427ccaSGordon Tetlow>>>(12.L) use nintendo-gcn-disc-common 87740427ccaSGordon Tetlow 87840427ccaSGordon Tetlow# Type: Nintendo GameCube/Wii disc image (WIA format) 87940427ccaSGordon Tetlow0 string WIA\001 Nintendo 88040427ccaSGordon Tetlow>0x48 belong 1 GameCube 8812dc4dbb9SEitan Adler!:mime application/x-gamecube-rom 88240427ccaSGordon Tetlow>0x48 belong 2 Wii 8832dc4dbb9SEitan Adler!:mime application/x-wii-rom 8842dc4dbb9SEitan Adler>0x48 default x GameCube/Wii 88540427ccaSGordon Tetlow>0x48 belong x disc image (WIA format): 88640427ccaSGordon Tetlow>>0x58 use nintendo-gcn-disc-common 88740427ccaSGordon Tetlow 8882dc4dbb9SEitan Adler# Type: Nintendo GameCube/Wii disc image (with SDK header) 8892dc4dbb9SEitan Adler# From: David Korth <gerbilsoft@gerbilsoft.com> 89048c779cdSXin LI# Reference: https://wiibrew.org/wiki/Wii_Disc 8912dc4dbb9SEitan Adler0 belong 0xFFFF0000 8922dc4dbb9SEitan Adler>0x18 belong 0x00000000 8932dc4dbb9SEitan Adler>>0x1C belong 0x00000000 8942dc4dbb9SEitan Adler>>>0x8018 belong 0x5D1C9EA3 Nintendo Wii SDK disc image: 89548c779cdSXin LI!:mime application/x-wii-rom 8962dc4dbb9SEitan Adler>>>>0x8000 use nintendo-gcn-disc-common 8972dc4dbb9SEitan Adler>>>0x801C belong 0xC2339F3D Nintendo GameCube SDK disc image: 89848c779cdSXin LI!:mime application/x-gamecube-rom 8992dc4dbb9SEitan Adler>>>>0x8000 use nintendo-gcn-disc-common 9002dc4dbb9SEitan Adler 9013e41d09dSXin LI#------------------------------------------------------------------------------ 9023e41d09dSXin LI# Nintendo 3DS file formats. 9033e41d09dSXin LI# 9043e41d09dSXin LI 9053e41d09dSXin LI# Type: Nintendo 3DS "NCSD" image. (game cards and eMMC) 9063e41d09dSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 9073e41d09dSXin LI# Reference: https://www.3dbrew.org/wiki/NCSD 9083e41d09dSXin LI0x100 string NCSD 9093e41d09dSXin LI>0x118 lequad 0 Nintendo 3DS Game Card image 910282e23f0SXin LI# NCCH header for partition 0. (game data) 911282e23f0SXin LI>>0x1150 string >\0 \b: "%.16s" 912282e23f0SXin LI>>0x312 byte x (Rev.%02u) 913282e23f0SXin LI>>0x118C byte 2 (New3DS only) 9143e41d09dSXin LI>>0x18D byte 0 (inner device) 9153e41d09dSXin LI>>0x18D byte 1 (Card1) 9163e41d09dSXin LI>>0x18D byte 2 (Card2) 9173e41d09dSXin LI>>0x18D byte 3 (extended device) 9183e41d09dSXin LI>0x118 bequad 0x0102020202000000 Nintendo 3DS eMMC dump (Old3DS) 9193e41d09dSXin LI>0x118 bequad 0x0102020203000000 Nintendo 3DS eMMC dump (New3DS) 9203e41d09dSXin LI 921282e23f0SXin LI# Nintendo 3DS version code. 922282e23f0SXin LI# Reference: https://www.3dbrew.org/wiki/Titles 923282e23f0SXin LI# Format: leshort containing three fields: 924282e23f0SXin LI# - 6-bit: Major 925282e23f0SXin LI# - 6-bit: Minor 926282e23f0SXin LI# - 4-bit: Revision 927282e23f0SXin LI# NOTE: Only supporting major/minor versions from 0-15 right now. 928282e23f0SXin LI# NOTE: Should be prefixed with "v". 929282e23f0SXin LI0 name nintendo-3ds-version-code 930282e23f0SXin LI# Raw version. 931282e23f0SXin LI>0 leshort x \b%u, 932282e23f0SXin LI# Major version. 933282e23f0SXin LI>0 leshort&0xFC00 0x0000 0 934282e23f0SXin LI>0 leshort&0xFC00 0x0400 1 935282e23f0SXin LI>0 leshort&0xFC00 0x0800 2 936282e23f0SXin LI>0 leshort&0xFC00 0x0C00 3 937282e23f0SXin LI>0 leshort&0xFC00 0x1000 4 938282e23f0SXin LI>0 leshort&0xFC00 0x1400 5 939282e23f0SXin LI>0 leshort&0xFC00 0x1800 6 940282e23f0SXin LI>0 leshort&0xFC00 0x1C00 7 941282e23f0SXin LI>0 leshort&0xFC00 0x2000 8 942282e23f0SXin LI>0 leshort&0xFC00 0x2400 9 943282e23f0SXin LI>0 leshort&0xFC00 0x2800 10 944282e23f0SXin LI>0 leshort&0xFC00 0x2C00 11 945282e23f0SXin LI>0 leshort&0xFC00 0x3000 12 946282e23f0SXin LI>0 leshort&0xFC00 0x3400 13 947282e23f0SXin LI>0 leshort&0xFC00 0x3800 14 948282e23f0SXin LI>0 leshort&0xFC00 0x3C00 15 949282e23f0SXin LI# Minor version. 950282e23f0SXin LI>0 leshort&0x03F0 0x0000 \b.0 951282e23f0SXin LI>0 leshort&0x03F0 0x0010 \b.1 952282e23f0SXin LI>0 leshort&0x03F0 0x0020 \b.2 953282e23f0SXin LI>0 leshort&0x03F0 0x0030 \b.3 954282e23f0SXin LI>0 leshort&0x03F0 0x0040 \b.4 955282e23f0SXin LI>0 leshort&0x03F0 0x0050 \b.5 956282e23f0SXin LI>0 leshort&0x03F0 0x0060 \b.6 957282e23f0SXin LI>0 leshort&0x03F0 0x0070 \b.7 958282e23f0SXin LI>0 leshort&0x03F0 0x0080 \b.8 959282e23f0SXin LI>0 leshort&0x03F0 0x0090 \b.9 960282e23f0SXin LI>0 leshort&0x03F0 0x00A0 \b.10 961282e23f0SXin LI>0 leshort&0x03F0 0x00B0 \b.11 962282e23f0SXin LI>0 leshort&0x03F0 0x00C0 \b.12 963282e23f0SXin LI>0 leshort&0x03F0 0x00D0 \b.13 964282e23f0SXin LI>0 leshort&0x03F0 0x00E0 \b.14 965282e23f0SXin LI>0 leshort&0x03F0 0x00F0 \b.15 966282e23f0SXin LI# Revision. 967282e23f0SXin LI>0 leshort&0x000F x \b.%u 968282e23f0SXin LI 9693e41d09dSXin LI# Type: Nintendo 3DS "NCCH" container. 9703e41d09dSXin LI# https://www.3dbrew.org/wiki/NCCH 9713e41d09dSXin LI0x100 string NCCH Nintendo 3DS 9723e41d09dSXin LI>0x18D byte&2 0 File Archive (CFA) 9733e41d09dSXin LI>0x18D byte&2 2 Executable Image (CXI) 974282e23f0SXin LI>0x150 string >\0 \b: "%.16s" 975282e23f0SXin LI>0x18D byte 0x05 976282e23f0SXin LI>>0x10E leshort x (Old3DS System Update v 977282e23f0SXin LI>>0x10E use nintendo-3ds-version-code 978282e23f0SXin LI>>0x10E leshort x \b) 979282e23f0SXin LI>0x18D byte 0x15 980282e23f0SXin LI>>0x10E leshort x (New3DS System Update v 981282e23f0SXin LI>>0x10E use nintendo-3ds-version-code 982282e23f0SXin LI>>0x10E leshort x \b) 983282e23f0SXin LI>0x18D byte !0x05 984282e23f0SXin LI>>0x18D byte !0x15 985282e23f0SXin LI>>>0x112 byte x (v 986282e23f0SXin LI>>>0x112 use nintendo-3ds-version-code 987282e23f0SXin LI>>>0x112 byte x \b) 988282e23f0SXin LI>0x18C byte 2 (New3DS only) 9893e41d09dSXin LI 9903e41d09dSXin LI# Type: Nintendo 3DS "SMDH" file. (application description) 9913e41d09dSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 9923e41d09dSXin LI# Reference: https://3dbrew.org/wiki/SMDH 9933e41d09dSXin LI0 string SMDH Nintendo 3DS SMDH file 9943e41d09dSXin LI>0x208 leshort !0 9953e41d09dSXin LI>>0x208 lestring16 x \b: "%.128s" 9963e41d09dSXin LI>>0x388 leshort !0 9973e41d09dSXin LI>>>0x388 lestring16 x by %.128s 9983e41d09dSXin LI>0x208 leshort 0 9993e41d09dSXin LI>>0x008 leshort !0 10003e41d09dSXin LI>>>0x008 lestring16 x \b: "%.128s" 10013e41d09dSXin LI>>>0x188 leshort !0 10023e41d09dSXin LI>>>>0x188 lestring16 x by %.128s 10033e41d09dSXin LI 10043e41d09dSXin LI# Type: Nintendo 3DS Homebrew Application. 10053e41d09dSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 100640427ccaSGordon Tetlow# Reference: https://3dbrew.org/wiki/3DSX_Format 10073e41d09dSXin LI0 string 3DSX Nintendo 3DS Homebrew Application (3DSX) 10083e41d09dSXin LI 1009*43a5ec4eSXin LI# Type: Nintendo 3DS Banner Model Data. 1010*43a5ec4eSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 1011*43a5ec4eSXin LI# Reference: https://3dbrew.org/wiki/CBMD 1012*43a5ec4eSXin LI0 string CBMD\0\0\0\0 Nintendo 3DS Banner Model Data 1013*43a5ec4eSXin LI 10143e41d09dSXin LI#------------------------------------------------------------------------------ 10153e41d09dSXin LI# a7800: file(1) magic for the Atari 7800 raw ROM format. 10163e41d09dSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 10173e41d09dSXin LI# Reference: https://sites.google.com/site/atari7800wiki/a78-header 10183e41d09dSXin LI 10193e41d09dSXin LI0 byte >0 10203e41d09dSXin LI>0 byte <3 10213e41d09dSXin LI>>1 string ATARI7800 Atari 7800 ROM image 10222dc4dbb9SEitan Adler!:mime application/x-atari-7800-rom 10233e41d09dSXin LI>>>0x11 string >\0 \b: "%.32s" 10243e41d09dSXin LI# Display type. 10253e41d09dSXin LI>>>0x39 byte 0 (NTSC) 10263e41d09dSXin LI>>>0x39 byte 1 (PAL) 10273e41d09dSXin LI>>>0x36 byte&1 1 (POKEY) 10283e41d09dSXin LI 10293e41d09dSXin LI#------------------------------------------------------------------------------ 10303e41d09dSXin LI# vectrex: file(1) magic for the GCE Vectrex raw ROM format. 10313e41d09dSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 10323e41d09dSXin LI# Reference: http://www.playvectrex.com/designit/chrissalo/hello1.htm 10333e41d09dSXin LI# 10343e41d09dSXin LI# NOTE: Title is terminated with 0x80, not 0. 10353e41d09dSXin LI# The header is terminated with a 0, so that will 10363e41d09dSXin LI# terminate the title as well. 10373e41d09dSXin LI# 10383e41d09dSXin LI0 string g\ GCE Vectrex ROM image 10393e41d09dSXin LI>0x11 string >\0 \b: "%.16s" 104040427ccaSGordon Tetlow 104140427ccaSGordon Tetlow#------------------------------------------------------------------------------ 104240427ccaSGordon Tetlow# amiibo: file(1) magic for Nintendo amiibo NFC dumps. 104340427ccaSGordon Tetlow# From: David Korth <gerbilsoft@gerbilsoft.com> 104440427ccaSGordon Tetlow# Reference: https://www.3dbrew.org/wiki/Amiibo 104540427ccaSGordon Tetlow0x00 byte 0x04 104640427ccaSGordon Tetlow>0x0A beshort 0x0FE0 104740427ccaSGordon Tetlow>>0x0C belong 0xF110FFEE 104840427ccaSGordon Tetlow>>>0x208 beshort 0x0100 104940427ccaSGordon Tetlow>>>>0x020A byte 0x0F 105040427ccaSGordon Tetlow>>>>>0x020C bequad 0x000000045F000000 105140427ccaSGordon Tetlow>>>>>>0x5B byte 0x02 105240427ccaSGordon Tetlow>>>>>>>0x54 belong x Nintendo amiibo NFC dump - amiibo ID: %08X- 105340427ccaSGordon Tetlow>>>>>>>0x58 belong x \b%08X 10542726a701SXin LI 10552726a701SXin LI#------------------------------------------------------------------------------ 10562726a701SXin LI# Type: Nintendo Switch XCI (Game Cartridge Image) 10572726a701SXin LI# From: Benjamin Lowry <ben@ben.gmbh> 10582726a701SXin LI# Reference: https://switchbrew.org/wiki/Gamecard_Format 10592726a701SXin LI0x100 string HEAD 10602726a701SXin LI>0x10D byte 0xFA Nintendo Switch cartridge image (XCI), 1GB 10612726a701SXin LI>0x10D byte 0xF8 Nintendo Switch cartridge image (XCI), 2GB 10622726a701SXin LI>0x10D byte 0xF0 Nintendo Switch cartridge image (XCI), 4GB 10632726a701SXin LI>0x10D byte 0xE0 Nintendo Switch cartridge image (XCI), 8GB 10642726a701SXin LI>0x10D byte 0xE1 Nintendo Switch cartridge image (XCI), 16GB 10652726a701SXin LI>0x10D byte 0xE2 Nintendo Switch cartridge image (XCI), 32GB 10662726a701SXin LI 10672726a701SXin LI#------------------------------------------------------------------------------ 10682726a701SXin LI# Type: Nintendo Switch Executable 10692726a701SXin LI# From: Benjamin Lowry <ben@ben.gmbh> 10702726a701SXin LI# Reference: https://switchbrew.org/wiki/NSO 10712726a701SXin LI0x00 string NSO0 Nintendo Switch executable (NSO) 10722726a701SXin LI 10732726a701SXin LI#------------------------------------------------------------------------------ 10742726a701SXin LI# Type: Nintendo Switch PFS0 10752726a701SXin LI# From: Benjamin Lowry <ben@ben.gmbh> 10762726a701SXin LI# Reference: https://switchbrew.org/wiki/NCA_Format#PFS0 10772726a701SXin LI0x00 string PFS0 Nintendo Switch partition filesystem (PFS0) 10782726a701SXin LI>0x04 ulelong x \b, %d files 10792726a701SXin LI 10802726a701SXin LI#------------------------------------------------------------------------------ 10812726a701SXin LI# amiibo: file(1) magic for Nintendo Badge Arcade files. 10822726a701SXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 10832726a701SXin LI# References: 10842726a701SXin LI# - https://github.com/GerbilSoft/rom-properties/issues/92 10852726a701SXin LI# - https://github.com/CaitSith2/BadgeArcadeTool 10862726a701SXin LI# - https://github.com/TheMachinumps/Advanced-badge-editor 10872726a701SXin LI 10882726a701SXin LI# PRBS: Individual badge and/or mega badge. 10892726a701SXin LI0 string PRBS 10902726a701SXin LI>0x44 byte >0x20 Nintendo Badge Arcade 10912726a701SXin LI>>0xB8 ulelong <2 10922726a701SXin LI>>>0xBC ulelong <2 badge: 10932726a701SXin LI>>>0xBC ulelong >1 Mega Badge 10942726a701SXin LI>>>>0xB8 ulelong x (%ux 10952726a701SXin LI>>>>0xBC ulelong x \b%u): 10962726a701SXin LI>>0xB8 ulelong >1 Mega Badge 10972726a701SXin LI>>>0xB8 ulelong x (%ux 10982726a701SXin LI>>>0xBC ulelong x \b%u): 10992726a701SXin LI>0x44 string x "%s" 11002726a701SXin LI>0x3C ulelong x \b, badge ID: %u 11012726a701SXin LI>0x74 byte >0x20 11022726a701SXin LI>>0x74 string x \b, set: "%s" 11032726a701SXin LI>0xA8 ulelong !0xFFFFFFFF 11042726a701SXin LI>>0xA8 ulelong x \b, launch title ID: %08X 11052726a701SXin LI>>0xA4 ulelong x \b-%08X 11062726a701SXin LI 11072726a701SXin LI# CABS: Badge set. 11082726a701SXin LI0 string CABS 11092726a701SXin LI>0x2C byte >0x20 Nintendo Badge Arcade badge set: 11102726a701SXin LI>>0x2C string x "%.48s" 11112726a701SXin LI>>0x24 ulelong x \b, set ID: %u 1112*43a5ec4eSXin LI 1113*43a5ec4eSXin LI#------------------------------------------------------------------------------ 1114*43a5ec4eSXin LI# sufami: file(1) magic for Sufami Turbo ROM images. 1115*43a5ec4eSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 1116*43a5ec4eSXin LI# References: 1117*43a5ec4eSXin LI# - https://problemkaputt.de/fullsnes.htm#snescartsufamiturbominicartridgeadaptor 1118*43a5ec4eSXin LI0 string BANDAI\ SFC-ADX 1119*43a5ec4eSXin LI>0x10 string !SFC-ADX\ BACKUP Sufami Turbo ROM image: 1120*43a5ec4eSXin LI>>0x10 string/T x "%.14s" 1121*43a5ec4eSXin LI>>0x30 byte x \b, ID %02X 1122*43a5ec4eSXin LI>>0x31 byte x \b%02X 1123*43a5ec4eSXin LI>>0x32 byte x \b%02X 1124*43a5ec4eSXin LI>>0x33 ubyte >0 \b, series index %u 1125*43a5ec4eSXin LI>>0x34 ubyte 0 [SlowROM] 1126*43a5ec4eSXin LI>>0x34 ubyte 1 [FastROM] 1127*43a5ec4eSXin LI>>0x35 ubyte 1 [SRAM] 1128*43a5ec4eSXin LI>>0x35 ubyte 3 [Special] 1129*43a5ec4eSXin LI 1130*43a5ec4eSXin LI# Type: Nintendo GameCube/Wii disc image (RVZ format) 1131*43a5ec4eSXin LI0 string RVZ\001 Nintendo 1132*43a5ec4eSXin LI>0x48 belong 1 GameCube 1133*43a5ec4eSXin LI!:mime application/x-gamecube-rom 1134*43a5ec4eSXin LI>0x48 belong 2 Wii 1135*43a5ec4eSXin LI!:mime application/x-wii-rom 1136*43a5ec4eSXin LI>0x48 default x GameCube/Wii 1137*43a5ec4eSXin LI>0x48 belong x disc image (RVZ format): 1138*43a5ec4eSXin LI>>0x58 use nintendo-gcn-disc-common 1139*43a5ec4eSXin LI 1140