2 #------------------------------------------------------------------------------
3 # $File: console,v 1.24 2016/03/23 15:29:20 christos Exp $
5 # Toby Deshane <hac@shoelace.digivill.net>
7 # ines: file(1) magic for Marat's iNES Nintendo Entertainment System ROM dump format
8 # Updated by David Korth <gerbilsoft@gerbilsoft.com>
10 # - http://wiki.nesdev.com/w/index.php/INES
11 # - http://wiki.nesdev.com/w/index.php/NES_2.0
12 0 string NES\x1A iNES ROM image
13 >7 byte&0x0C =0x8 (NES 2.0)
14 >4 byte x \b: %ux16k PRG
15 >5 byte x \b, %ux16k CHR
16 >6 byte&0x08 =0x8 [4-Scr]
17 >6 byte&0x09 =0x0 [H-mirror]
18 >6 byte&0x09 =0x1 [V-mirror]
19 >6 byte&0x02 =0x2 [SRAM]
20 >6 byte&0x04 =0x4 [Trainer]
21 >7 byte&0x03 =0x2 [PC10]
25 >>>13 byte&0x0F =0x0 \b, RP2C03B
26 >>>13 byte&0x0F =0x1 \b, RP2C03G
27 >>>13 byte&0x0F =0x2 \b, RP2C04-0001
28 >>>13 byte&0x0F =0x3 \b, RP2C04-0002
29 >>>13 byte&0x0F =0x4 \b, RP2C04-0003
30 >>>13 byte&0x0F =0x5 \b, RP2C04-0004
31 >>>13 byte&0x0F =0x6 \b, RP2C03B
32 >>>13 byte&0x0F =0x7 \b, RP2C03C
33 >>>13 byte&0x0F =0x8 \b, RP2C05-01
34 >>>13 byte&0x0F =0x9 \b, RP2C05-02
35 >>>13 byte&0x0F =0xA \b, RP2C05-03
36 >>>13 byte&0x0F =0xB \b, RP2C05-04
37 >>>13 byte&0x0F =0xC \b, RP2C05-05
38 # TODO: VS protection hardware?
40 # NES 2.0-specific flags.
42 >>12 byte&0x03 =0x0 [NTSC]
43 >>12 byte&0x03 =0x1 [PAL]
44 >>12 byte&0x02 =0x2 [NTSC+PAL]
46 #------------------------------------------------------------------------------
47 # unif: file(1) magic for UNIF-format Nintendo Entertainment System ROM images
48 # Reference: http://wiki.nesdev.com/w/index.php/UNIF
49 # From: David Korth <gerbilsoft@gerbilsoft.com>
50 # TODO commit on 2016/03/21
52 # NOTE: The UNIF format uses chunks instead of a fixed header,
53 # so most of the data isn't easily parseable.
56 4 lelong <16 UNIF v%d format NES ROM image
58 #------------------------------------------------------------------------------
59 # gameboy: file(1) magic for the Nintendo (Color) Gameboy raw ROM format
60 # Reference: http://gbdev.gg8.se/wiki/articles/The_Cartridge_Header
62 0x104 bequad 0xCEED6666CC0D000B Game Boy ROM image
64 >>0x134 string >\0 \b: "%.15s"
65 >0x143 byte&0x80 !0x80
66 >>0x134 string >\0 \b: "%.16s"
67 >0x14c byte x (Rev.%02u)
69 # Machine type. (SGB, CGB, SGB+CGB)
72 >>>0x143 byte&0x80 0x80 [SGB+CGB]
73 >>>0x143 byte&0x80 !0x80 [SGB]
75 >>>0x143 byte&0xC0 0x80 [CGB]
76 >>>0x143 byte&0xC0 0xC0 [CGB ONLY]
79 >0x147 byte 0x00 [ROM ONLY]
80 >0x147 byte 0x01 [MBC1]
81 >0x147 byte 0x02 [MBC1+RAM]
82 >0x147 byte 0x03 [MBC1+RAM+BATT]
83 >0x147 byte 0x05 [MBC2]
84 >0x147 byte 0x06 [MBC2+BATTERY]
85 >0x147 byte 0x08 [ROM+RAM]
86 >0x147 byte 0x09 [ROM+RAM+BATTERY]
87 >0x147 byte 0x0B [MMM01]
88 >0x147 byte 0x0C [MMM01+SRAM]
89 >0x147 byte 0x0D [MMM01+SRAM+BATT]
90 >0x147 byte 0x0F [MBC3+TIMER+BATT]
91 >0x147 byte 0x10 [MBC3+TIMER+RAM+BATT]
92 >0x147 byte 0x11 [MBC3]
93 >0x147 byte 0x12 [MBC3+RAM]
94 >0x147 byte 0x13 [MBC3+RAM+BATT]
95 >0x147 byte 0x19 [MBC5]
96 >0x147 byte 0x1A [MBC5+RAM]
97 >0x147 byte 0x1B [MBC5+RAM+BATT]
98 >0x147 byte 0x1C [MBC5+RUMBLE]
99 >0x147 byte 0x1D [MBC5+RUMBLE+SRAM]
100 >0x147 byte 0x1E [MBC5+RUMBLE+SRAM+BATT]
101 >0x147 byte 0xFC [Pocket Camera]
102 >0x147 byte 0xFD [Bandai TAMA5]
103 >0x147 byte 0xFE [Hudson HuC-3]
104 >0x147 byte 0xFF [Hudson HuC-1]
107 >0x148 byte 0 \b, ROM: 256Kbit
108 >0x148 byte 1 \b, ROM: 512Kbit
109 >0x148 byte 2 \b, ROM: 1Mbit
110 >0x148 byte 3 \b, ROM: 2Mbit
111 >0x148 byte 4 \b, ROM: 4Mbit
112 >0x148 byte 5 \b, ROM: 8Mbit
113 >0x148 byte 6 \b, ROM: 16Mbit
114 >0x148 byte 7 \b, ROM: 32Mbit
115 >0x148 byte 0x52 \b, ROM: 9Mbit
116 >0x148 byte 0x53 \b, ROM: 10Mbit
117 >0x148 byte 0x54 \b, ROM: 12Mbit
120 >0x149 byte 1 \b, RAM: 16Kbit
121 >0x149 byte 2 \b, RAM: 64Kbit
122 >0x149 byte 3 \b, RAM: 128Kbit
123 >0x149 byte 4 \b, RAM: 1Mbit
124 >0x149 byte 5 \b, RAM: 512Kbit
126 #------------------------------------------------------------------------------
127 # genesis: file(1) magic for various Sega Mega Drive / Genesis ROM image and disc formats
128 # Updated by David Korth <gerbilsoft@gerbilsoft.com>
130 # - http://www.retrodev.com/segacd.html
131 # - http://devster.monkeeh.com/sega/32xguide1.txt
134 # Common Sega Mega Drive header format.
135 # FIXME: Name fields are 48 bytes, but have spaces for padding instead of 00s.
136 0 name sega-mega-drive-header
137 # ROM title. (Use domestic if present; if not, use international.)
139 >>0x120 string >\0 \b: "%.16s"
141 >>0x150 string >\0 \b: "%.16s"
143 >0x180 string >\0 (%.14s
144 >>0x110 string >\0 \b, %.16s
146 >>0x110 string >\0 (%.16s
149 # TODO: Check for 32X CD?
150 # Sega Mega CD disc images: 2048-byte sectors.
151 0 string SEGADISCSYSTEM\ \ Sega Mega CD disc image
152 >0 use sega-mega-drive-header
153 >0 byte x \b, 2048-byte sectors
154 0 string SEGABOOTDISC\ \ \ \ Sega Mega CD disc image
155 >0 use sega-mega-drive-header
156 >0 byte x \b, 2048-byte sectors
157 # Sega Mega CD disc images: 2352-byte sectors.
158 0x10 string SEGADISCSYSTEM\ \ Sega Mega CD disc image
159 >0x10 use sega-mega-drive-header
160 >0 byte x \b, 2352-byte sectors
161 0x10 string SEGABOOTDISC\ \ \ \ Sega Mega CD disc image
162 >0x10 use sega-mega-drive-header
163 >0 byte x \b, 2352-byte sectors
165 # Sega Mega Drive, 32X, Pico, and Mega CD Boot ROM images.
167 >0x3C0 bequad 0x4D41525320434845 Sega 32X ROM image
168 >>0 use sega-mega-drive-header
169 >0x3C0 bequad !0x4D41525320434845
170 >>0x105 belong 0x5049434F Sega Pico ROM image
171 >>>0 use sega-mega-drive-header
172 >>0x105 belong !0x5049434F
173 >>>0x180 beshort 0x4252 Sega Mega CD Boot ROM image
174 >>>0x180 beshort !0x4252 Sega Mega Drive / Genesis ROM image
175 >>>0 use sega-mega-drive-header
177 #------------------------------------------------------------------------------
178 # genesis: file(1) magic for the Super MegaDrive ROM dump format
181 # NOTE: Due to interleaving, we can't display anything
182 # other than the copier header information.
183 0 name sega-genesis-smd-header
184 >0 byte x %dx16k blocks
185 >2 byte 0 \b, last in series or standalone
186 >2 byte >0 \b, split ROM
188 # "Sega Genesis" header.
190 >8 beshort 0xAABB Sega Mega Drive / Genesis ROM image (SMD format):
191 >>0 use sega-genesis-smd-header
193 # "Sega Mega Drive" header.
195 >8 beshort 0xAABB Sega Mega Drive / Genesis ROM image (SMD format):
196 >>0 use sega-genesis-smd-header
198 #------------------------------------------------------------------------------
199 # smsgg: file(1) magic for Sega Master System and Game Gear ROM images
200 # Detects all Game Gear and export Sega Master System ROM images,
201 # and some Japanese Sega Master System ROM images.
202 # From: David Korth <gerbilsoft@gerbilsoft.com>
203 # Reference: http://www.smspower.org/Development/ROMHeader
206 # General SMS header rule.
207 # The SMS boot ROM checks the header at three locations.
208 0 name sega-master-system-rom-header
210 >0x0F byte&0xF0 0x30 Sega Master System
211 >0x0F byte&0xF0 0x40 Sega Master System
212 >0x0F byte&0xF0 0x50 Sega Game Gear
213 >0x0F byte&0xF0 0x60 Sega Game Gear
214 >0x0F byte&0xF0 0x70 Sega Game Gear
215 >0x0F byte&0xF0 <0x30 Sega Master System / Game Gear
216 >0x0F byte&0xF0 >0x70 Sega Master System / Game Gear
219 >0x0E byte&0xF0 0x10 1
220 >0x0E byte&0xF0 0x20 2
221 >0x0E byte&0xF0 0x30 3
222 >0x0E byte&0xF0 0x40 4
223 >0x0E byte&0xF0 0x50 5
224 >0x0E byte&0xF0 0x60 6
225 >0x0E byte&0xF0 0x70 7
226 >0x0E byte&0xF0 0x80 8
227 >0x0E byte&0xF0 0x90 9
228 >0x0E byte&0xF0 0xA0 10
229 >0x0E byte&0xF0 0xB0 11
230 >0x0E byte&0xF0 0xC0 12
231 >0x0E byte&0xF0 0xD0 13
232 >0x0E byte&0xF0 0xE0 14
233 >0x0E byte&0xF0 0xF0 15
234 # If the product code is 5 digits, we'll need to backspace here.
236 >>0x0C leshort x \b%04x
238 >>0x0C leshort x %04x
240 >0x0E byte&0x0F x (Rev.%02d)
241 # ROM size. (Used for the boot ROM checksum routine.)
242 >0x0F byte&0x0F 0x0A (8 KB)
243 >0x0F byte&0x0F 0x0B (16 KB)
244 >0x0F byte&0x0F 0x0C (32 KB)
245 >0x0F byte&0x0F 0x0D (48 KB)
246 >0x0F byte&0x0F 0x0E (64 KB)
247 >0x0F byte&0x0F 0x0F (128 KB)
248 >0x0F byte&0x0F 0x00 (256 KB)
249 >0x0F byte&0x0F 0x01 (512 KB)
250 >0x0F byte&0x0F 0x02 (1 MB)
252 # SMS/GG header locations.
253 0x7FF0 string TMR\ SEGA
254 >0x7FF0 use sega-master-system-rom-header
255 0x3FF0 string TMR\ SEGA
256 >0x3FF0 use sega-master-system-rom-header
257 0x1FF0 string TMR\ SEGA
258 >0x1FF0 use sega-master-system-rom-header
260 #------------------------------------------------------------------------------
261 # saturn: file(1) magic for the Sega Saturn disc image format.
262 # From: David Korth <gerbilsoft@gerbilsoft.com>
265 # Common Sega Saturn disc header format.
266 # NOTE: Title is 112 bytes, but we're only showing 32 due to space padding.
267 # TODO: Release date, device information, region code, others?
268 0 name sega-saturn-disc-header
269 >0x60 string >\0 \b: "%.32s"
270 >0x20 string >\0 (%.10s
271 >>0x2A string >\0 \b, %.6s)
274 # 2048-byte sector version.
275 0 string SEGA\ SEGASATURN\ Sega Saturn disc image
276 >0 use sega-saturn-disc-header
277 >0 byte x (2048-byte sectors)
278 # 2352-byte sector version.
279 0x10 string SEGA\ SEGASATURN\ Sega Saturn disc image
280 >0x10 use sega-saturn-disc-header
281 >0 byte x (2352-byte sectors)
283 #------------------------------------------------------------------------------
284 # dreamcast: file(1) magic for the Sega Dreamcast disc image format.
285 # From: David Korth <gerbilsoft@gerbilsoft.com>
286 # Reference: http://mc.pp.se/dc/ip0000.bin.html
289 # Common Sega Dreamcast disc header format.
290 # NOTE: Title is 128 bytes, but we're only showing 32 due to space padding.
291 # TODO: Release date, device information, region code, others?
292 0 name sega-dreamcast-disc-header
293 >0x80 string >\0 \b: "%.32s"
294 >0x40 string >\0 (%.10s
295 >>0x4A string >\0 \b, %.6s)
298 # 2048-byte sector version.
299 0 string SEGA\ SEGAKATANA\ Sega Dreamcast disc image
300 >0 use sega-dreamcast-disc-header
301 >0 byte x (2048-byte sectors)
302 # 2352-byte sector version.
303 0x10 string SEGA\ SEGAKATANA\ Sega Dreamcast disc image
304 >0x10 use sega-dreamcast-disc-header
305 >0 byte x (2352-byte sectors)
307 #------------------------------------------------------------------------------
308 # dreamcast: file(1) uncertain magic for the Sega Dreamcast VMU image format
310 0 belong 0x21068028 Sega Dreamcast VMU game image
311 0 string LCDi Dream Animator file
313 #------------------------------------------------------------------------------
314 # z64: file(1) magic for the Z64 format N64 ROM dumps
315 # Reference: http://forum.pj64-emu.com/showthread.php?t=2239
316 # From: David Korth <gerbilsoft@gerbilsoft.com>
318 0 bequad 0x803712400000000F Nintendo 64 ROM image
319 >0x20 string >\0 \b: "%.20s"
321 >0x3F byte x \b, Rev.%02u)
323 #------------------------------------------------------------------------------
324 # v64: file(1) magic for the V64 format N64 ROM dumps
325 # Same as z64 format, but with 16-bit byteswapping.
327 0 bequad 0x3780401200000F00 Nintendo 64 ROM image (V64)
329 #------------------------------------------------------------------------------
330 # n64-swap2: file(1) magic for the swap2 format N64 ROM dumps
331 # Same as z64 format, but with swapped 16-bit words.
333 0 bequad 0x12408037000F0000 Nintendo 64 ROM image (wordswapped)
335 #------------------------------------------------------------------------------
336 # n64-le32: file(1) magic for the 32-bit byteswapped format N64 ROM dumps
337 # Same as z64 format, but with 32-bit byteswapping.
339 0 bequad 0x401237800F000000 Nintendo 64 ROM image (32-bit byteswapped)
341 #------------------------------------------------------------------------------
342 # gba: file(1) magic for the Nintendo Game Boy Advance raw ROM format
343 # Reference: http://problemkaputt.de/gbatek.htm#gbacartridgeheader
345 # Original version from: "Nelson A. de Oliveira" <naoliv@gmail.com>
346 # Updated version from: David Korth <gerbilsoft@gerbilsoft.com>
348 4 bequad 0x24FFAE51699AA221 Game Boy Advance ROM image
349 >0xA0 string >\0 \b: "%.12s"
351 >0xBC byte x \b, Rev.%02u)
353 #------------------------------------------------------------------------------
354 # nds: file(1) magic for the Nintendo DS(i) raw ROM format
355 # Reference: http://problemkaputt.de/gbatek.htm#dscartridgeheader
357 # Original version from: "Nelson A. de Oliveira" <naoliv@gmail.com>
358 # Updated version from: David Korth <gerbilsoft@gerbilsoft.com>
360 0xC0 bequad 0x24FFAE51699AA221 Nintendo DS ROM image
361 >0x00 string >\0 \b: "%.12s"
363 >0x1E byte x \b, Rev.%02u)
364 >0x12 byte 2 (DSi enhanced)
365 >0x12 byte 3 (DSi only)
367 #------------------------------------------------------------------------------
368 # nds_passme: file(1) magic for Nintendo DS ROM images for GBA cartridge boot.
369 # This is also used for loading .nds files using the MSET exploit on 3DS.
370 # Reference: https://github.com/devkitPro/ndstool/blob/master/source/ndscreate.cpp
371 0xC0 bequad 0xC8604FE201708FE2 Nintendo DS Slot-2 ROM image (PassMe)
373 #------------------------------------------------------------------------------
374 # ngp: file(1) magic for the Neo Geo Pocket (Color) raw ROM format.
375 # From: David Korth <gerbilsoft@gerbilsoft.com>
377 # - https://neogpc.googlecode.com/svn-history/r10/trunk/src/core/neogpc.cpp
378 # - http://www.devrs.com/ngp/files/ngpctech.txt
380 0x0A string BY\ SNK\ CORPORATION Neo Geo Pocket
381 >0x23 byte 0x10 Color
383 >0x24 string >\0 \b: "%.12s"
384 >0x1F byte 0xFF (debug mode enabled)
386 #------------------------------------------------------------------------------
387 # msx: file(1) magic for MSX game cartridge dumps
389 #0 beshort 0x4142 MSX game cartridge dump
391 #------------------------------------------------------------------------------
392 # Sony Playstation executables (Adam Sjoegren <asjo@diku.dk>) :
393 0 string PS-X\ EXE Sony Playstation executable
394 >16 lelong x PC=0x%08x,
395 >20 lelong !0 GP=0x%08x,
396 >24 lelong !0 .text=[0x%08x,
397 >>28 lelong x \b0x%x],
398 >32 lelong !0 .data=[0x%08x,
399 >>36 lelong x \b0x%x],
400 >40 lelong !0 .bss=[0x%08x,
401 >>44 lelong x \b0x%x],
402 >48 lelong !0 Stack=0x%08x,
403 >48 lelong =0 No Stack!,
404 >52 lelong !0 StackSize=0x%x,
410 0 string CPE CPE executable
411 >3 byte x (version %d)
413 #------------------------------------------------------------------------------
414 # Microsoft Xbox executables .xbe (Esa Hyytia <ehyytia@cc.hut.fi>)
415 0 string XBEH XBE, Microsoft Xbox executable
416 # probabilistic checks whether signed or not
419 >>>&2 ulelong =0x0 \b, not signed
422 >>>&2 ulelong >0 \b, signed
423 # expect base address of 0x10000
424 >0x0104 ulelong =0x10000
425 >>(0x0118-0x0FF60) ulelong&0x80000007 0x80000007 \b, all regions
426 >>(0x0118-0x0FF60) ulelong&0x80000007 !0x80000007
427 >>>(0x0118-0x0FF60) ulelong >0 (regions:
428 >>>>(0x0118-0x0FF60) ulelong &0x00000001 NA
429 >>>>(0x0118-0x0FF60) ulelong &0x00000002 Japan
430 >>>>(0x0118-0x0FF60) ulelong &0x00000004 Rest_of_World
431 >>>>(0x0118-0x0FF60) ulelong &0x80000000 Manufacturer
432 >>>(0x0118-0x0FF60) ulelong >0 \b)
434 # --------------------------------
435 # Microsoft Xbox data file formats
436 0 string XIP0 XIP, Microsoft Xbox data
437 0 string XTF0 XTF, Microsoft Xbox data
439 # Atari Lynx cartridge dump (EXE/BLL header)
440 # From: "Stefan A. Haubenthal" <polluks@web.de>
442 # Double-check that the image type matches too, 0x8008 conflicts with
443 # 8 character OMF-86 object file headers.
445 >6 string BS93 Lynx homebrew cartridge
446 >>2 beshort x \b, RAM start $%04x
447 >6 string LYNX Lynx cartridge
448 >>2 beshort x \b, RAM start $%04x
450 # Opera file system that is used on the 3DO console
451 # From: Serge van den Boom <svdb@stack.nl>
452 0 string \x01ZZZZZ\x01 3DO "Opera" file system
454 # From: Gurkan Sengun <gurkan@linuks.mine.nu>, www.linuks.mine.nu
455 # From: David Pflug <david@pflug.email>
456 # is the offset 12 or the offset 16 correct?
457 # GBS (Game Boy Sound) magic
458 # ftp://ftp.modland.com/pub/documents/format_documentation/\
459 # Gameboy%20Sound%20System%20(.gbs).txt
460 0 string GBS Nintendo Gameboy Music/Audio Data
461 #12 string GameBoy\ Music\ Module Nintendo Gameboy Music Module
462 >16 string >\0 ("%s" by
463 >48 string >\0 %s, copyright
465 >3 byte x version %d,
468 # Playstations Patch Files from: From: Thomas Klausner <tk@giga.or.at>
469 0 string PPF30 Playstation Patch File version 3.0
470 >5 byte 0 \b, PPF 1.0 patch
471 >5 byte 1 \b, PPF 2.0 patch
472 >5 byte 2 \b, PPF 3.0 patch
473 >>56 byte 0 \b, Imagetype BIN (any)
474 >>56 byte 1 \b, Imagetype GI (PrimoDVD)
475 >>57 byte 0 \b, Blockcheck disabled
476 >>57 byte 1 \b, Blockcheck enabled
477 >>58 byte 0 \b, Undo data not available
478 >>58 byte 1 \b, Undo data available
479 >6 string x \b, description: %s
481 0 string PPF20 Playstation Patch File version 2.0
482 >5 byte 0 \b, PPF 1.0 patch
483 >5 byte 1 \b, PPF 2.0 patch
484 >>56 lelong >0 \b, size of file to patch %d
485 >6 string x \b, description: %s
487 0 string PPF10 Playstation Patch File version 1.0
488 >5 byte 0 \b, Simple Encoding
489 >6 string x \b, description: %s
491 # From: Daniel Dawson <ddawson@icehouse.net>
492 # SNES9x .smv "movie" file format.
493 0 string SMV\x1A SNES9x input recording
494 >0x4 lelong x \b, version %d
495 # version 4 is latest so far
497 >>0x8 ledate x \b, recorded at %s
498 >>0xc lelong >0 \b, rerecorded %d times
499 >>0x10 lelong x \b, %d frames long
500 >>0x14 byte >0 \b, data for controller(s):
505 >>>0x14 byte &0x10 #5
506 >>0x15 byte ^0x1 \b, begins from snapshot
507 >>0x15 byte &0x1 \b, begins from reset
508 >>0x15 byte ^0x2 \b, NTSC standard
509 >>0x15 byte &0x2 \b, PAL standard
510 >>0x17 byte &0x1 \b, settings:
511 # WIP1Timing not used as of version 4
513 >>>>0x17 byte &0x2 WIP1Timing
514 >>>0x17 byte &0x4 Left+Right
515 >>>0x17 byte &0x8 VolumeEnvX
516 >>>0x17 byte &0x10 FakeMute
517 >>>0x17 byte &0x20 SyncSound
518 # New flag as of version 4
520 >>>>0x17 byte &0x80 NoCPUShutdown
524 >>>>>0x20 lestring16 x \b, metadata: "%s"
526 >>>0x24 byte >0 \b, port 1:
527 >>>>0x24 byte 1 joypad
528 >>>>0x24 byte 2 mouse
529 >>>>0x24 byte 3 SuperScope
530 >>>>0x24 byte 4 Justifier
531 >>>>0x24 byte 5 multitap
532 >>>0x24 byte >0 \b, port 2:
533 >>>>0x25 byte 1 joypad
534 >>>>0x25 byte 2 mouse
535 >>>>0x25 byte 3 SuperScope
536 >>>>0x25 byte 4 Justifier
537 >>>>0x25 byte 5 multitap
540 >>>>>0x40 lestring16 x \b, metadata: "%s"
541 >>0x17 byte &0x40 \b, ROM:
542 >>>(0x18.l-26) lelong x CRC32 0x%08x
543 >>>(0x18.l-23) string x "%s"
545 # Type: scummVM savegame files
546 # From: Sven Hartge <debian@ds9.argh.org>
547 0 string SCVM ScummVM savegame
550 #------------------------------------------------------------------------------
551 # Nintendo GameCube / Wii file formats.
554 # Type: Nintendo GameCube/Wii common disc header data.
555 # From: David Korth <gerbilsoft@gerbilsoft.com>
556 # Reference: http://wiibrew.org/wiki/Wii_Disc
557 0 name nintendo-gcn-disc-common
558 >0x20 string x "%.64s"
561 >>0x06 byte 1 \b, Disc 2
562 >>0x06 byte 2 \b, Disc 3
563 >>0x06 byte 3 \b, Disc 4
564 >0x07 byte x \b, Rev.%02u)
566 # Type: Nintendo GameCube disc image
567 # From: David Korth <gerbilsoft@gerbilsoft.com>
568 # Reference: http://wiibrew.org/wiki/Wii_Disc
569 0x1C belong 0xC2339F3D Nintendo GameCube disc image:
570 >0 use nintendo-gcn-disc-common
572 # Type: Nintendo Wii disc image
573 # From: David Korth <gerbilsoft@gerbilsoft.com>
574 # Reference: http://wiibrew.org/wiki/Wii_Disc
575 0x18 belong 0x5D1C9EA3 Nintendo Wii disc image:
576 >0 use nintendo-gcn-disc-common
578 # Type: Nintendo Wii disc image (WBFS format)
579 # From: David Korth <gerbilsoft@gerbilsoft.com>
580 # Reference: http://wiibrew.org/wiki/Wii_Disc
582 >0x218 belong 0x5D1C9EA3 Nintendo Wii disc image (WBFS format):
583 >>0x200 use nintendo-gcn-disc-common
585 #------------------------------------------------------------------------------
586 # Nintendo 3DS file formats.
589 # Type: Nintendo 3DS "NCCH" header.
590 # Contained within either a CXI executable or an NCSD image.
591 # From: David Korth <gerbilsoft@gerbilsoft.com>
592 # Reference: https://www.3dbrew.org/wiki/NCCH
593 0 name nintendo-3ds-NCCH
595 >>0x150 string >\0 \b: "%.16s"
596 >>0x112 leshort x (v%u)
597 >>0x18C byte 2 (New3DS only)
599 # Type: Nintendo 3DS "NCSD" image. (game cards and eMMC)
600 # From: David Korth <gerbilsoft@gerbilsoft.com>
601 # Reference: https://www.3dbrew.org/wiki/NCSD
603 >0x118 lequad 0 Nintendo 3DS Game Card image
604 >>0x1000 use nintendo-3ds-NCCH
605 >>0x18D byte 0 (inner device)
606 >>0x18D byte 1 (Card1)
607 >>0x18D byte 2 (Card2)
608 >>0x18D byte 3 (extended device)
609 >0x118 bequad 0x0102020202000000 Nintendo 3DS eMMC dump (Old3DS)
610 >0x118 bequad 0x0102020203000000 Nintendo 3DS eMMC dump (New3DS)
612 # Type: Nintendo 3DS "NCCH" container.
613 # https://www.3dbrew.org/wiki/NCCH
614 0x100 string NCCH Nintendo 3DS
615 >0x18D byte&2 0 File Archive (CFA)
616 >0x18D byte&2 2 Executable Image (CXI)
617 >0 use nintendo-3ds-NCCH
619 # Type: Nintendo 3DS "SMDH" file. (application description)
620 # From: David Korth <gerbilsoft@gerbilsoft.com>
621 # Reference: https://3dbrew.org/wiki/SMDH
622 0 string SMDH Nintendo 3DS SMDH file
624 >>0x208 lestring16 x \b: "%.128s"
626 >>>0x388 lestring16 x by %.128s
629 >>>0x008 lestring16 x \b: "%.128s"
631 >>>>0x188 lestring16 x by %.128s
633 # Type: Nintendo 3DS Homebrew Application.
634 # From: David Korth <gerbilsoft@gerbilsoft.com>
635 # Refernece: https://3dbrew.org/wiki/3DSX_Format
636 0 string 3DSX Nintendo 3DS Homebrew Application (3DSX)
638 #------------------------------------------------------------------------------
639 # a7800: file(1) magic for the Atari 7800 raw ROM format.
640 # From: David Korth <gerbilsoft@gerbilsoft.com>
641 # Reference: https://sites.google.com/site/atari7800wiki/a78-header
645 >>1 string ATARI7800 Atari 7800 ROM image
646 >>>0x11 string >\0 \b: "%.32s"
648 >>>0x39 byte 0 (NTSC)
650 >>>0x36 byte&1 1 (POKEY)
652 #------------------------------------------------------------------------------
653 # vectrex: file(1) magic for the GCE Vectrex raw ROM format.
654 # From: David Korth <gerbilsoft@gerbilsoft.com>
655 # Reference: http://www.playvectrex.com/designit/chrissalo/hello1.htm
657 # NOTE: Title is terminated with 0x80, not 0.
658 # The header is terminated with a 0, so that will
659 # terminate the title as well.
661 0 string g\ GCE Vectrex ROM image
662 >0x11 string >\0 \b: "%.16s"