1 2#------------------------------------------------------------------------------ 3# $File: console,v 1.20 2015/03/15 23:21:42 christos Exp $ 4# Console game magic 5# Toby Deshane <hac@shoelace.digivill.net> 6# ines: file(1) magic for Marat's iNES Nintendo Entertainment System 7# ROM dump format 8 90 string NES\032 iNES ROM dump, 10>4 byte x %dx16k PRG 11>5 byte x \b, %dx8k CHR 12>6 byte&0x01 =0x1 \b, [Vert.] 13>6 byte&0x01 =0x0 \b, [Horiz.] 14>6 byte&0x02 =0x2 \b, [SRAM] 15>6 byte&0x04 =0x4 \b, [Trainer] 16>6 byte&0x04 =0x8 \b, [4-Scr] 17 18#------------------------------------------------------------------------------ 19# gameboy: file(1) magic for the Nintendo (Color) Gameboy raw ROM format 20# 210x104 belong 0xCEED6666 Gameboy ROM: 22>0x134 string >\0 "%.16s" 23>0x146 byte 0x03 \b,[SGB] 24>0x147 byte 0x00 \b, [ROM ONLY] 25>0x147 byte 0x01 \b, [ROM+MBC1] 26>0x147 byte 0x02 \b, [ROM+MBC1+RAM] 27>0x147 byte 0x03 \b, [ROM+MBC1+RAM+BATT] 28>0x147 byte 0x05 \b, [ROM+MBC2] 29>0x147 byte 0x06 \b, [ROM+MBC2+BATTERY] 30>0x147 byte 0x08 \b, [ROM+RAM] 31>0x147 byte 0x09 \b, [ROM+RAM+BATTERY] 32>0x147 byte 0x0B \b, [ROM+MMM01] 33>0x147 byte 0x0C \b, [ROM+MMM01+SRAM] 34>0x147 byte 0x0D \b, [ROM+MMM01+SRAM+BATT] 35>0x147 byte 0x0F \b, [ROM+MBC3+TIMER+BATT] 36>0x147 byte 0x10 \b, [ROM+MBC3+TIMER+RAM+BATT] 37>0x147 byte 0x11 \b, [ROM+MBC3] 38>0x147 byte 0x12 \b, [ROM+MBC3+RAM] 39>0x147 byte 0x13 \b, [ROM+MBC3+RAM+BATT] 40>0x147 byte 0x19 \b, [ROM+MBC5] 41>0x147 byte 0x1A \b, [ROM+MBC5+RAM] 42>0x147 byte 0x1B \b, [ROM+MBC5+RAM+BATT] 43>0x147 byte 0x1C \b, [ROM+MBC5+RUMBLE] 44>0x147 byte 0x1D \b, [ROM+MBC5+RUMBLE+SRAM] 45>0x147 byte 0x1E \b, [ROM+MBC5+RUMBLE+SRAM+BATT] 46>0x147 byte 0x1F \b, [Pocket Camera] 47>0x147 byte 0xFD \b, [Bandai TAMA5] 48>0x147 byte 0xFE \b, [Hudson HuC-3] 49>0x147 byte 0xFF \b, [Hudson HuC-1] 50 51>0x148 byte 0 \b, ROM: 256Kbit 52>0x148 byte 1 \b, ROM: 512Kbit 53>0x148 byte 2 \b, ROM: 1Mbit 54>0x148 byte 3 \b, ROM: 2Mbit 55>0x148 byte 4 \b, ROM: 4Mbit 56>0x148 byte 5 \b, ROM: 8Mbit 57>0x148 byte 6 \b, ROM: 16Mbit 58>0x148 byte 0x52 \b, ROM: 9Mbit 59>0x148 byte 0x53 \b, ROM: 10Mbit 60>0x148 byte 0x54 \b, ROM: 12Mbit 61 62>0x149 byte 1 \b, RAM: 16Kbit 63>0x149 byte 2 \b, RAM: 64Kbit 64>0x149 byte 3 \b, RAM: 128Kbit 65>0x149 byte 4 \b, RAM: 1Mbit 66 67#>0x14e long x \b, CRC: %x 68 69#------------------------------------------------------------------------------ 70# genesis: file(1) magic for the Sega MegaDrive/Genesis raw ROM format 71# 720x100 string SEGA Sega MegaDrive/Genesis raw ROM dump 73>0x120 string >\0 Name: "%.16s" 74>0x110 string >\0 %.16s 75>0x1B0 string RA with SRAM 76 77#------------------------------------------------------------------------------ 78# genesis: file(1) magic for the Super MegaDrive ROM dump format 79# 800x280 string EAGN Super MagicDrive ROM dump 81>0 byte x %dx16k blocks 82>2 byte 0 \b, last in series or standalone 83>2 byte >0 \b, split ROM 84>8 byte 0xAA 85>9 byte 0xBB 86 87#------------------------------------------------------------------------------ 88# genesis: file(1) alternate magic for the Super MegaDrive ROM dump format 89# 900x280 string EAMG Super MagicDrive ROM dump 91>0 byte x %dx16k blocks 92>2 byte x \b, last in series or standalone 93>8 byte 0xAA 94>9 byte 0xBB 95 96#------------------------------------------------------------------------------ 97# smsgg: file(1) magic for Sega Master System and Game Gear ROM dumps 98# 99# Does not detect all images. Very preliminary guesswork. Need more data 100# on format. 101# 102# FIXME: need a little more info...;P 103# 104#0 byte 0xF3 105#>1 byte 0xED Sega Master System/Game Gear ROM dump 106#>1 byte 0x31 Sega Master System/Game Gear ROM dump 107#>1 byte 0xDB Sega Master System/Game Gear ROM dump 108#>1 byte 0xAF Sega Master System/Game Gear ROM dump 109#>1 byte 0xC3 Sega Master System/Game Gear ROM dump 110 111#------------------------------------------------------------------------------ 112# dreamcast: file(1) uncertain magic for the Sega Dreamcast VMU image format 113# 1140 belong 0x21068028 Sega Dreamcast VMU game image 1150 string LCDi Dream Animator file 116 117#------------------------------------------------------------------------------ 118# v64: file(1) uncertain magic for the V64 format N64 ROM dumps 119# 1200 belong 0x37804012 V64 Nintendo 64 ROM dump 121 122# From: "Nelson A. de Oliveira" <naoliv@gmail.com> 123# Nintendo .nds 124192 string \044\377\256Qi\232 Nintendo DS Game ROM Image 125# Nintendo .gba 1260 string \056\000\000\352$\377\256Qi Nintendo Game Boy Advance ROM Image 127 128#------------------------------------------------------------------------------ 129# msx: file(1) magic for MSX game cartridge dumps 130# Too simple - MPi 131#0 beshort 0x4142 MSX game cartridge dump 132 133#------------------------------------------------------------------------------ 134# Sony Playstation executables (Adam Sjoegren <asjo@diku.dk>) : 1350 string PS-X\ EXE Sony Playstation executable 136# Area: 137>113 string x (%s) 138 139#------------------------------------------------------------------------------ 140# Microsoft Xbox executables .xbe (Esa Hyytia <ehyytia@cc.hut.fi>) 1410 string XBEH XBE, Microsoft Xbox executable 142# probabilistic checks whether signed or not 143>0x0004 ulelong =0x0 144>>&2 ulelong =0x0 145>>>&2 ulelong =0x0 \b, not signed 146>0x0004 ulelong >0 147>>&2 ulelong >0 148>>>&2 ulelong >0 \b, signed 149# expect base address of 0x10000 150>0x0104 ulelong =0x10000 151>>(0x0118-0x0FF60) ulelong&0x80000007 0x80000007 \b, all regions 152>>(0x0118-0x0FF60) ulelong&0x80000007 !0x80000007 153>>>(0x0118-0x0FF60) ulelong >0 (regions: 154>>>>(0x0118-0x0FF60) ulelong &0x00000001 NA 155>>>>(0x0118-0x0FF60) ulelong &0x00000002 Japan 156>>>>(0x0118-0x0FF60) ulelong &0x00000004 Rest_of_World 157>>>>(0x0118-0x0FF60) ulelong &0x80000000 Manufacturer 158>>>(0x0118-0x0FF60) ulelong >0 \b) 159 160# -------------------------------- 161# Microsoft Xbox data file formats 1620 string XIP0 XIP, Microsoft Xbox data 1630 string XTF0 XTF, Microsoft Xbox data 164 165# Atari Lynx cartridge dump (EXE/BLL header) 166# From: "Stefan A. Haubenthal" <polluks@web.de> 167 168# Double-check that the image type matches too, 0x8008 conflicts with 169# 8 character OMF-86 object file headers. 1700 beshort 0x8008 171>6 string BS93 Lynx homebrew cartridge 172>>2 beshort x \b, RAM start $%04x 173>6 string LYNX Lynx cartridge 174>>2 beshort x \b, RAM start $%04x 175 176# Opera file system that is used on the 3DO console 177# From: Serge van den Boom <svdb@stack.nl> 1780 string \x01ZZZZZ\x01 3DO "Opera" file system 179 180# From: Gurkan Sengun <gurkan@linuks.mine.nu>, www.linuks.mine.nu 181# From: David Pflug <david@pflug.email> 182# is the offset 12 or the offset 16 correct? 183# GBS (Game Boy Sound) magic 184# ftp://ftp.modland.com/pub/documents/format_documentation/\ 185# Gameboy%20Sound%20System%20(.gbs).txt 1860 string GBS Nintendo Gameboy Music/Audio Data 187#12 string GameBoy\ Music\ Module Nintendo Gameboy Music Module 188>16 string >\0 ("%s" by 189>48 string >\0 %s, copyright 190>80 string >\0 %s), 191>3 byte x version %d, 192>4 byte x %d tracks 193 194# Playstations Patch Files from: From: Thomas Klausner <tk@giga.or.at> 1950 string PPF30 Playstation Patch File version 3.0 196>5 byte 0 \b, PPF 1.0 patch 197>5 byte 1 \b, PPF 2.0 patch 198>5 byte 2 \b, PPF 3.0 patch 199>>56 byte 0 \b, Imagetype BIN (any) 200>>56 byte 1 \b, Imagetype GI (PrimoDVD) 201>>57 byte 0 \b, Blockcheck disabled 202>>57 byte 1 \b, Blockcheck enabled 203>>58 byte 0 \b, Undo data not available 204>>58 byte 1 \b, Undo data available 205>6 string x \b, description: %s 206 2070 string PPF20 Playstation Patch File version 2.0 208>5 byte 0 \b, PPF 1.0 patch 209>5 byte 1 \b, PPF 2.0 patch 210>>56 lelong >0 \b, size of file to patch %d 211>6 string x \b, description: %s 212 2130 string PPF10 Playstation Patch File version 1.0 214>5 byte 0 \b, Simple Encoding 215>6 string x \b, description: %s 216 217# From: Daniel Dawson <ddawson@icehouse.net> 218# SNES9x .smv "movie" file format. 2190 string SMV\x1A SNES9x input recording 220>0x4 lelong x \b, version %d 221# version 4 is latest so far 222>0x4 lelong <5 223>>0x8 ledate x \b, recorded at %s 224>>0xc lelong >0 \b, rerecorded %d times 225>>0x10 lelong x \b, %d frames long 226>>0x14 byte >0 \b, data for controller(s): 227>>>0x14 byte &0x1 #1 228>>>0x14 byte &0x2 #2 229>>>0x14 byte &0x4 #3 230>>>0x14 byte &0x8 #4 231>>>0x14 byte &0x10 #5 232>>0x15 byte ^0x1 \b, begins from snapshot 233>>0x15 byte &0x1 \b, begins from reset 234>>0x15 byte ^0x2 \b, NTSC standard 235>>0x15 byte &0x2 \b, PAL standard 236>>0x17 byte &0x1 \b, settings: 237# WIP1Timing not used as of version 4 238>>>0x4 lelong <4 239>>>>0x17 byte &0x2 WIP1Timing 240>>>0x17 byte &0x4 Left+Right 241>>>0x17 byte &0x8 VolumeEnvX 242>>>0x17 byte &0x10 FakeMute 243>>>0x17 byte &0x20 SyncSound 244# New flag as of version 4 245>>>0x4 lelong >3 246>>>>0x17 byte &0x80 NoCPUShutdown 247>>0x4 lelong <4 248>>>0x18 lelong >0x23 249>>>>0x20 leshort !0 250>>>>>0x20 lestring16 x \b, metadata: "%s" 251>>0x4 lelong >3 252>>>0x24 byte >0 \b, port 1: 253>>>>0x24 byte 1 joypad 254>>>>0x24 byte 2 mouse 255>>>>0x24 byte 3 SuperScope 256>>>>0x24 byte 4 Justifier 257>>>>0x24 byte 5 multitap 258>>>0x24 byte >0 \b, port 2: 259>>>>0x25 byte 1 joypad 260>>>>0x25 byte 2 mouse 261>>>>0x25 byte 3 SuperScope 262>>>>0x25 byte 4 Justifier 263>>>>0x25 byte 5 multitap 264>>>0x18 lelong >0x43 265>>>>0x40 leshort !0 266>>>>>0x40 lestring16 x \b, metadata: "%s" 267>>0x17 byte &0x40 \b, ROM: 268>>>(0x18.l-26) lelong x CRC32 0x%08x 269>>>(0x18.l-23) string x "%s" 270 271# Type: scummVM savegame files 272# From: Sven Hartge <debian@ds9.argh.org> 2730 string SCVM ScummVM savegame 274>12 string >\0 "%s" 275