Skip to content

Commit

Permalink
Added unofficial MIME types from xdg/shared-mime-info. (David Korth)
Browse files Browse the repository at this point in the history
  • Loading branch information
zoulasc committed Jun 23, 2018
1 parent 70de4f2 commit f1507f5
Showing 1 changed file with 55 additions and 1 deletion.
56 changes: 55 additions & 1 deletion magic/Magdir/console
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#------------------------------------------------------------------------------
# $File: console,v 1.36 2018/06/23 16:36:27 christos Exp $
# $File: console,v 1.37 2018/06/23 16:36:37 christos Exp $
# Console game magic
# Toby Deshane <hac@shoelace.digivill.net>

Expand Down Expand Up @@ -47,10 +47,12 @@

# Standard iNES ROM header.
0 string NES\x1A NES ROM image (iNES)
!:mime application/x-nes-rom
>0 use nes-rom-image-ines

# Wii U Virtual Console iNES ROM header.
0 belong 0x4E455300 NES ROM image (Wii U Virtual Console)
!:mime application/x-nes-rom
>0 use nes-rom-image-ines

#------------------------------------------------------------------------------
Expand All @@ -63,6 +65,7 @@
#
0 string UNIF
>4 lelong <16 NES ROM image (UNIF v%d format)
!:mime application/x-nes-rom

#------------------------------------------------------------------------------
# fds: file(1) magic for Famciom Disk System disk images
Expand All @@ -81,12 +84,14 @@
# Headered version.
0 string FDS\x1A
>0x11 string *NINTENDO-HVC* Famicom Disk System disk image:
!:mime application/x-fds-disk
>>0x10 use nintendo-fds-disk-info-block
>4 byte 1 (%u side)
>4 byte !1 (%u sides)

# Unheadered version.
1 string *NINTENDO-HVC* Famicom Disk System disk image:
!:mime application/x-fds-disk
>0 use nintendo-fds-disk-info-block

#------------------------------------------------------------------------------
Expand All @@ -95,6 +100,7 @@
# From: David Korth <gerbilsoft@gerbilsoft.com>
#
0 string TNES NES ROM image (Nintendo 3DS Virtual Console)
!:mime application/x-nes-rom
>4 byte 100 \b: FDS,
>>0x2010 use nintendo-fds-disk-info-block
>4 byte !100 \b: TNES mapper %u
Expand All @@ -110,6 +116,8 @@
# Reference: http://gbdev.gg8.se/wiki/articles/The_Cartridge_Header
#
0x104 bequad 0xCEED6666CC0D000B Game Boy ROM image
# TODO: application/x-gameboy-color-rom for GBC.
!:mime application/x-gameboy-rom
>0x143 byte&0x80 0x80
>>0x134 string >\0 \b: "%.15s"
>0x143 byte&0x80 !0x80
Expand All @@ -124,6 +132,7 @@
>>0x146 byte !0x03
>>>0x143 byte&0xC0 0x80 [CGB]
>>>0x143 byte&0xC0 0xC0 [CGB ONLY]
>0x14b byte !0x33

# Mapper.
>0x147 byte 0x00 [ROM ONLY]
Expand Down Expand Up @@ -199,29 +208,37 @@
# TODO: Check for 32X CD?
# Sega Mega CD disc images: 2048-byte sectors.
0 string SEGADISCSYSTEM\ \ Sega Mega CD disc image
!:mime application/x-sega-cd-rom
>0 use sega-mega-drive-header
>0 byte x \b, 2048-byte sectors
0 string SEGABOOTDISC\ \ \ \ Sega Mega CD disc image
!:mime application/x-sega-cd-rom
>0 use sega-mega-drive-header
>0 byte x \b, 2048-byte sectors
# Sega Mega CD disc images: 2352-byte sectors.
0x10 string SEGADISCSYSTEM\ \ Sega Mega CD disc image
!:mime application/x-sega-cd-rom
>0x10 use sega-mega-drive-header
>0 byte x \b, 2352-byte sectors
0x10 string SEGABOOTDISC\ \ \ \ Sega Mega CD disc image
!:mime application/x-sega-cd-rom
>0x10 use sega-mega-drive-header
>0 byte x \b, 2352-byte sectors

# Sega Mega Drive, 32X, Pico, and Mega CD Boot ROM images.
0x100 string SEGA
>0x3C0 bequad 0x4D41525320434845 Sega 32X ROM image
!:mime application/x-genesis-32x-rom
>>0 use sega-mega-drive-header
>0x3C0 bequad !0x4D41525320434845
>>0x105 belong 0x5049434F Sega Pico ROM image
!:mime application/x-sega-pico-rom
>>>0 use sega-mega-drive-header
>>0x105 belong !0x5049434F
>>>0x180 beshort 0x4252 Sega Mega CD Boot ROM image
!:mime application/x-genesis-rom
>>>0x180 beshort !0x4252 Sega Mega Drive / Genesis ROM image
!:mime application/x-genesis-rom
>>>0 use sega-mega-drive-header

#------------------------------------------------------------------------------
Expand All @@ -238,11 +255,13 @@
# "Sega Genesis" header.
0x280 string EAGN
>8 beshort 0xAABB Sega Mega Drive / Genesis ROM image (SMD format):
!:mime application/x-genesis-rom
>>0 use sega-genesis-smd-header

# "Sega Mega Drive" header.
0x280 string EAMG
>8 beshort 0xAABB Sega Mega Drive / Genesis ROM image (SMD format):
!:mime application/x-genesis-rom
>>0 use sega-genesis-smd-header

#------------------------------------------------------------------------------
Expand All @@ -258,12 +277,19 @@
0 name sega-master-system-rom-header
# Machine type.
>0x0F byte&0xF0 0x30 Sega Master System
!:mime application/x-sms-rom
>0x0F byte&0xF0 0x40 Sega Master System
!:mime application/x-sms-rom
>0x0F byte&0xF0 0x50 Sega Game Gear
!:mime application/x-gamegear-rom
>0x0F byte&0xF0 0x60 Sega Game Gear
!:mime application/x-gamegear-rom
>0x0F byte&0xF0 0x70 Sega Game Gear
!:mime application/x-gamegear-rom
>0x0F byte&0xF0 <0x30 Sega Master System / Game Gear
!:mime application/x-sms-rom
>0x0F byte&0xF0 >0x70 Sega Master System / Game Gear
!:mime application/x-sms-rom
>0 byte x ROM image:
# Product code.
>0x0E byte&0xF0 0x10 1
Expand Down Expand Up @@ -323,10 +349,12 @@

# 2048-byte sector version.
0 string SEGA\ SEGASATURN\ Sega Saturn disc image
!:mime application/x-saturn-rom
>0 use sega-saturn-disc-header
>0 byte x (2048-byte sectors)
# 2352-byte sector version.
0x10 string SEGA\ SEGASATURN\ Sega Saturn disc image
!:mime application/x-saturn-rom
>0x10 use sega-saturn-disc-header
>0 byte x (2352-byte sectors)

Expand All @@ -347,10 +375,12 @@

# 2048-byte sector version.
0 string SEGA\ SEGAKATANA\ Sega Dreamcast disc image
!:mime application/x-dc-rom
>0 use sega-dreamcast-disc-header
>0 byte x (2048-byte sectors)
# 2352-byte sector version.
0x10 string SEGA\ SEGAKATANA\ Sega Dreamcast disc image
!:mime application/x-dc-rom
>0x10 use sega-dreamcast-disc-header
>0 byte x (2352-byte sectors)

Expand All @@ -366,6 +396,7 @@
# From: David Korth <gerbilsoft@gerbilsoft.com>
#
0 bequad 0x803712400000000F Nintendo 64 ROM image
!:mime application/x-n64-rom
>0x20 string >\0 \b: "%.20s"
>0x3B string x (%.4s
>0x3F byte x \b, Rev.%02u)
Expand All @@ -375,18 +406,21 @@
# Same as z64 format, but with 16-bit byteswapping.
#
0 bequad 0x3780401200000F00 Nintendo 64 ROM image (V64)
!:mime application/x-n64-rom

#------------------------------------------------------------------------------
# n64-swap2: file(1) magic for the swap2 format N64 ROM dumps
# Same as z64 format, but with swapped 16-bit words.
#
0 bequad 0x12408037000F0000 Nintendo 64 ROM image (wordswapped)
!:mime application/x-n64-rom

#------------------------------------------------------------------------------
# n64-le32: file(1) magic for the 32-bit byteswapped format N64 ROM dumps
# Same as z64 format, but with 32-bit byteswapping.
#
0 bequad 0x401237800F000000 Nintendo 64 ROM image (32-bit byteswapped)
!:mime application/x-n64-rom

#------------------------------------------------------------------------------
# gba: file(1) magic for the Nintendo Game Boy Advance raw ROM format
Expand All @@ -396,6 +430,7 @@
# Updated version from: David Korth <gerbilsoft@gerbilsoft.com>
#
4 bequad 0x24FFAE51699AA221 Game Boy Advance ROM image
!:mime application/x-gba-rom
>0xA0 string >\0 \b: "%.12s"
>0xAC string x (%.6s
>0xBC byte x \b, Rev.%02u)
Expand All @@ -408,6 +443,7 @@
# Updated version from: David Korth <gerbilsoft@gerbilsoft.com>
#
0xC0 bequad 0x24FFAE51699AA221 Nintendo DS ROM image
!:mime application/x-nintendo-ds-rom
>0x00 string >\0 \b: "%.12s"
>0x0C string x (%.6s
>0x1E byte x \b, Rev.%02u)
Expand All @@ -428,6 +464,7 @@
# This is also used for loading .nds files using the MSET exploit on 3DS.
# Reference: https://github.com/devkitPro/ndstool/blob/master/source/ndscreate.cpp
0xC0 bequad 0xC8604FE201708FE2 Nintendo DS Slot-2 ROM image (PassMe)
!:mime application/x-nintendo-ds-rom

#------------------------------------------------------------------------------
# ngp: file(1) magic for the Neo Geo Pocket (Color) raw ROM format.
Expand All @@ -437,6 +474,7 @@
# - http://www.devrs.com/ngp/files/ngpctech.txt
#
0x0A string BY\ SNK\ CORPORATION Neo Geo Pocket
!:mime application/x-neo-geo-pocket-rom
>0x23 byte 0x10 Color
>0 byte x ROM image
>0x24 string >\0 \b: "%.12s"
Expand Down Expand Up @@ -502,8 +540,10 @@
# 8 character OMF-86 object file headers.
0 beshort 0x8008
>6 string BS93 Lynx homebrew cartridge
!:mime application/x-atari-lynx-rom
>>2 beshort x \b, RAM start $%04x
>6 string LYNX Lynx cartridge
!:mime application/x-atari-lynx-rom
>>2 beshort x \b, RAM start $%04x

# Opera file system that is used on the 3DO console
Expand Down Expand Up @@ -630,6 +670,7 @@
# From: David Korth <gerbilsoft@gerbilsoft.com>
# Reference: http://wiibrew.org/wiki/Wii_Disc
0x1C belong 0xC2339F3D Nintendo GameCube disc image:
!:mime application/x-gamecube-rom
>0 use nintendo-gcn-disc-common

# Type: Nintendo GameCube embedded disc image
Expand All @@ -639,6 +680,7 @@
0 belong 0xAE0F38A2
>0x0C belong 0x00100000
>>(8.L+0x1C) belong 0xC2339F3D Nintendo GameCube embedded disc image:
!:mime application/x-gamecube-rom
>>>(8.L) use nintendo-gcn-disc-common

# Type: Nintendo Wii disc image
Expand All @@ -652,6 +694,7 @@
# Reference: http://wiibrew.org/wiki/Wii_Disc
0 string WBFS
>0x218 belong 0x5D1C9EA3 Nintendo Wii disc image (WBFS format):
!:mime application/x-wii-rom
>>0x200 use nintendo-gcn-disc-common

# Type: Nintendo GameCube/Wii disc image (CISO format)
Expand All @@ -665,37 +708,47 @@
>4 lelong 0x200000
>>8 byte 1
>>>0x801C belong 0xC2339F3D Nintendo GameCube disc image (CISO format):
!:mime application/x-wii-rom
>>>>0x8000 use nintendo-gcn-disc-common
>>>0x8018 belong 0x5D1C9EA3 Nintendo Wii disc image (CISO format):
!:mime application/x-wii-rom
>>>>0x8000 use nintendo-gcn-disc-common

# Type: Nintendo GameCube/Wii disc image (GCZ format)
# Due to zlib compression, we can't get the actual disc information.
0 lelong 0xB10BC001
>4 lelong 0 Nintendo GameCube disc image (GCZ format)
!:mime application/x-gamecube-rom
>4 lelong 1 Nintendo Wii disc image (GCZ format)
!:mime application/x-wii-rom
>4 lelong >1 Nintendo GameCube/Wii disc image (GCZ format)

# Type: Nintendo GameCube/Wii disc image (WDF format)
0 string WII\001DISC
>8 belong 1
# WDFv1
>>0x54 belong 0xC2339F3D Nintendo GameCube disc image (WDFv1 format):
!:mime application/x-gamecube-rom
>>>0x38 use nintendo-gcn-disc-common
>>0x58 belong 0x5D1C9EA3 Nintendo Wii disc image (WDFv1 format):
!:mime application/x-wii-rom
>>>0x38 use nintendo-gcn-disc-common
>8 belong 2
# WDFv2
>>(12.L+0x1C) belong 0xC2339F3D Nintendo GameCube disc image (WDFv2 format):
!:mime application/x-gamecube-rom
>>>(12.L) use nintendo-gcn-disc-common
>>(12.L+0x18) belong 0x5D1C9EA3 Nintendo Wii disc image (WDFv2 format):
!:mime application/x-wii-rom
>>>(12.L) use nintendo-gcn-disc-common

# Type: Nintendo GameCube/Wii disc image (WIA format)
0 string WIA\001 Nintendo
>0x48 belong 0 GameCube/Wii
>0x48 belong 1 GameCube
!:mime application/x-gamecube-rom
>0x48 belong 2 Wii
!:mime application/x-wii-rom
>0x48 belong >2 GameCube/Wii
>0x48 belong x disc image (WIA format):
>>0x58 use nintendo-gcn-disc-common
Expand Down Expand Up @@ -816,6 +869,7 @@
0 byte >0
>0 byte <3
>>1 string ATARI7800 Atari 7800 ROM image
!:mime application/x-atari-7800-rom
>>>0x11 string >\0 \b: "%.32s"
# Display type.
>>>0x39 byte 0 (NTSC)
Expand Down

0 comments on commit f1507f5

Please sign in to comment.