Add media type for FM-Towns discs.

This commit is contained in:
2018-09-10 00:26:37 +01:00
parent 8dfd26a1a6
commit 7eabb901d2
11 changed files with 66 additions and 43 deletions

View File

@@ -125,6 +125,7 @@ namespace DiscImageChef.CommonTypes
/// marks track as audio pause. /// marks track as audio pause.
/// </summary> /// </summary>
CDIREADY = 34, CDIREADY = 34,
FMTOWNS = 35,
#endregion Somewhat standard Compact Disc formats, types 10 to 39 #endregion Somewhat standard Compact Disc formats, types 10 to 39
#region Standard DVD formats, types 40 to 50 #region Standard DVD formats, types 40 to 50

View File

@@ -886,6 +886,12 @@ namespace DiscImageChef.CommonTypes.Metadata
case CommonTypes.MediaType.WUOD: case CommonTypes.MediaType.WUOD:
case CommonTypes.MediaType.PCFX: case CommonTypes.MediaType.PCFX:
case CommonTypes.MediaType.CDIREADY: case CommonTypes.MediaType.CDIREADY:
case CommonTypes.MediaType.FMTOWNS:
case CommonTypes.MediaType.CDTV:
case CommonTypes.MediaType.CD32:
case CommonTypes.MediaType.Nuon:
case CommonTypes.MediaType.Playdia:
case CommonTypes.MediaType.Pippin:
dmns.Diameter = 120; dmns.Diameter = 120;
dmns.DiameterSpecified = true; dmns.DiameterSpecified = true;
dmns.Thickness = 1.2; dmns.Thickness = 1.2;

View File

@@ -368,6 +368,10 @@ namespace DiscImageChef.CommonTypes.Metadata
discType = "Blu-ray"; discType = "Blu-ray";
discSubType = "Xbox One Game Disc (XGD4)"; discSubType = "Xbox One Game Disc (XGD4)";
break; break;
case CommonTypes.MediaType.FMTOWNS:
discType = "Compact Disc";
discSubType = "FM-Towns";
break;
case CommonTypes.MediaType.Apple32SS: case CommonTypes.MediaType.Apple32SS:
discType = "5.25\" floppy"; discType = "5.25\" floppy";
discSubType = "Apple DOS 3.2"; discSubType = "Apple DOS 3.2";

View File

@@ -121,7 +121,15 @@ namespace DiscImageChef.DiscImages
case MediaType.SATURNCD: case MediaType.SATURNCD:
case MediaType.ThreeDO: case MediaType.ThreeDO:
case MediaType.VCD: case MediaType.VCD:
case MediaType.VCDHD: return AlcoholMediumType.CD; case MediaType.VCDHD:
case MediaType.NeoGeoCD:
case MediaType.PCFX:
case MediaType.CDTV:
case MediaType.CD32:
case MediaType.Nuon:
case MediaType.Playdia:
case MediaType.Pippin:
case MediaType.FMTOWNS: return AlcoholMediumType.CD;
case MediaType.CDR: return AlcoholMediumType.CDR; case MediaType.CDR: return AlcoholMediumType.CDR;
case MediaType.CDRW: case MediaType.CDRW:
case MediaType.CDMRW: return AlcoholMediumType.CDRW; case MediaType.CDMRW: return AlcoholMediumType.CDRW;
@@ -149,9 +157,7 @@ namespace DiscImageChef.DiscImages
} }
} }
static (byte minute, byte second, byte frame) LbaToMsf(ulong sector) static (byte minute, byte second, byte frame) LbaToMsf(ulong sector) =>
{ ((byte)((sector + 150) / 75 / 60), (byte)((sector + 150) / 75 % 60), (byte)((sector + 150) % 75));
return ((byte)((sector + 150) / 75 / 60), (byte)((sector + 150) / 75 % 60), (byte)((sector + 150) % 75));
}
} }
} }

View File

@@ -133,7 +133,7 @@ namespace DiscImageChef.DiscImages
MediaType.SuperCDROM2, MediaType.SVCD, MediaType.SVOD, MediaType.SATURNCD, MediaType.ThreeDO, MediaType.SuperCDROM2, MediaType.SVCD, MediaType.SVOD, MediaType.SATURNCD, MediaType.ThreeDO,
MediaType.UDO, MediaType.UDO2, MediaType.UDO2_WORM, MediaType.UMD, MediaType.VCD, MediaType.VCDHD, MediaType.UDO, MediaType.UDO2, MediaType.UDO2_WORM, MediaType.UMD, MediaType.VCD, MediaType.VCDHD,
MediaType.NeoGeoCD, MediaType.PCFX, MediaType.CDTV, MediaType.CD32, MediaType.Nuon, MediaType.NeoGeoCD, MediaType.PCFX, MediaType.CDTV, MediaType.CD32, MediaType.Nuon,
MediaType.Playdia, MediaType.Pippin MediaType.Playdia, MediaType.Pippin, MediaType.FMTOWNS
}; };
public IEnumerable<(string name, Type type, string description)> SupportedOptions => public IEnumerable<(string name, Type type, string description)> SupportedOptions =>
new (string name, Type type, string description)[] { }; new (string name, Type type, string description)[] { };

View File

@@ -100,6 +100,14 @@ namespace DiscImageChef.DiscImages
case MediaType.ThreeDO: case MediaType.ThreeDO:
case MediaType.VCD: case MediaType.VCD:
case MediaType.VCDHD: case MediaType.VCDHD:
case MediaType.NeoGeoCD:
case MediaType.PCFX:
case MediaType.CDTV:
case MediaType.CD32:
case MediaType.Nuon:
case MediaType.Playdia:
case MediaType.Pippin:
case MediaType.FMTOWNS:
isDvd = false; isDvd = false;
break; break;
default: default:
@@ -445,7 +453,8 @@ namespace DiscImageChef.DiscImages
new AlcoholSession new AlcoholSession
{ {
sessionEnd = sessionEnd =
(int)(writingTracks[0].TrackEndSector - writingTracks[0].TrackStartSector + 1), (int)(writingTracks[0].TrackEndSector - writingTracks[0].TrackStartSector +
1),
sessionSequence = 1, sessionSequence = 1,
allBlocks = 1, allBlocks = 1,
nonTrackBlocks = 3, nonTrackBlocks = 3,
@@ -464,7 +473,8 @@ namespace DiscImageChef.DiscImages
adrCtl = 20, adrCtl = 20,
point = 1, point = 1,
extraOffset = extraOffset =
(uint)(writingTracks[0].TrackEndSector - writingTracks[0].TrackStartSector + 1), (uint)(writingTracks[0].TrackEndSector - writingTracks[0].TrackStartSector +
1),
sectorSize = 2048, sectorSize = 2048,
files = 1, files = 1,
footerOffset = (uint)footerOffset, footerOffset = (uint)footerOffset,
@@ -632,8 +642,8 @@ namespace DiscImageChef.DiscImages
// Daemon Tools expect it to be like this // Daemon Tools expect it to be like this
alcTrk.unknown = new byte[] alcTrk.unknown = new byte[]
{ {
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00 0x00, 0x00, 0x00, 0x00
}; };
alcTrk.unknown2 = new byte[24]; alcTrk.unknown2 = new byte[24];
@@ -713,17 +723,16 @@ namespace DiscImageChef.DiscImages
unknown2 = new byte[24] unknown2 = new byte[24]
}); });
thisSessionTracks.Add(0xC0, thisSessionTracks.Add(0xC0, new AlcoholTrack
new AlcoholTrack {
{ point = 0xC0,
point = 0xC0, adrCtl = 0x50,
adrCtl = 0x50, min = 128,
min = 128, pmin = 97,
pmin = 97, psec = 25,
psec = 25, unknown = new byte[18],
unknown = new byte[18], unknown2 = new byte[24]
unknown2 = new byte[24] });
});
currentTrackOffset += Marshal.SizeOf(typeof(AlcoholTrack)) * 2; currentTrackOffset += Marshal.SizeOf(typeof(AlcoholTrack)) * 2;
} }
@@ -733,8 +742,7 @@ namespace DiscImageChef.DiscImages
alcFooter = new AlcoholFooter alcFooter = new AlcoholFooter
{ {
filenameOffset = (uint)(footerOffset + Marshal.SizeOf(typeof(AlcoholFooter))), filenameOffset = (uint)(footerOffset + Marshal.SizeOf(typeof(AlcoholFooter))), widechar = 1
widechar = 1
}; };
byte[] filename = Encoding.Unicode.GetBytes("*.mdf"); // Yup, Alcohol stores no filename but a wildcard. byte[] filename = Encoding.Unicode.GetBytes("*.mdf"); // Yup, Alcohol stores no filename but a wildcard.
@@ -847,10 +855,7 @@ namespace DiscImageChef.DiscImages
return true; return true;
} }
public bool SetMetadata(ImageInfo metadata) public bool SetMetadata(ImageInfo metadata) => true;
{
return true;
}
public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack) public bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack)
{ {
@@ -970,16 +975,8 @@ namespace DiscImageChef.DiscImages
} }
} }
public bool SetDumpHardware(List<DumpHardwareType> dumpHardware) public bool SetDumpHardware(List<DumpHardwareType> dumpHardware) => false;
{
// Not supported
return false;
}
public bool SetCicmMetadata(CICMMetadataType metadata) public bool SetCicmMetadata(CICMMetadataType metadata) => false;
{
// Not supported
return false;
}
} }
} }

View File

@@ -115,7 +115,7 @@ namespace DiscImageChef.DiscImages
MediaType.JaguarCD, MediaType.MEGACD, MediaType.PD650, MediaType.PD650_WORM, MediaType.PS1CD, MediaType.JaguarCD, MediaType.MEGACD, MediaType.PD650, MediaType.PD650_WORM, MediaType.PS1CD,
MediaType.PS2CD, MediaType.SuperCDROM2, MediaType.SVCD, MediaType.SATURNCD, MediaType.ThreeDO, MediaType.PS2CD, MediaType.SuperCDROM2, MediaType.SVCD, MediaType.SATURNCD, MediaType.ThreeDO,
MediaType.VCD, MediaType.VCDHD, MediaType.NeoGeoCD, MediaType.PCFX, MediaType.CDTV, MediaType.CD32, MediaType.VCD, MediaType.VCDHD, MediaType.NeoGeoCD, MediaType.PCFX, MediaType.CDTV, MediaType.CD32,
MediaType.Nuon, MediaType.Playdia, MediaType.Pippin MediaType.Nuon, MediaType.Playdia, MediaType.Pippin, MediaType.FMTOWNS
}; };
public IEnumerable<(string name, Type type, string description)> SupportedOptions => public IEnumerable<(string name, Type type, string description)> SupportedOptions =>
new[] {("separate", typeof(bool), "Write each track to a separate file.")}; new[] {("separate", typeof(bool), "Write each track to a separate file.")};

View File

@@ -120,7 +120,7 @@ namespace DiscImageChef.DiscImages
MediaType.PS3DVD, MediaType.PS4BD, MediaType.SuperCDROM2, MediaType.SVCD, MediaType.SVOD, MediaType.PS3DVD, MediaType.PS4BD, MediaType.SuperCDROM2, MediaType.SVCD, MediaType.SVOD,
MediaType.SATURNCD, MediaType.ThreeDO, MediaType.UDO, MediaType.UDO2, MediaType.UDO2_WORM, MediaType.SATURNCD, MediaType.ThreeDO, MediaType.UDO, MediaType.UDO2, MediaType.UDO2_WORM,
MediaType.UMD, MediaType.VCD, MediaType.VCDHD, MediaType.NeoGeoCD, MediaType.PCFX, MediaType.CDTV, MediaType.UMD, MediaType.VCD, MediaType.VCDHD, MediaType.NeoGeoCD, MediaType.PCFX, MediaType.CDTV,
MediaType.CD32, MediaType.Nuon, MediaType.Playdia, MediaType.Pippin MediaType.CD32, MediaType.Nuon, MediaType.Playdia, MediaType.Pippin, MediaType.FMTOWNS
}; };
public IEnumerable<(string name, Type type, string description)> SupportedOptions => public IEnumerable<(string name, Type type, string description)> SupportedOptions =>
new[] {("separate", typeof(bool), "Write each track to a separate file.")}; new[] {("separate", typeof(bool), "Write each track to a separate file.")};

View File

@@ -67,7 +67,8 @@ namespace DiscImageChef.DiscImages
MediaType.CDRW, MediaType.CDV, MediaType.DTSCD, MediaType.JaguarCD, MediaType.MEGACD, MediaType.CDRW, MediaType.CDV, MediaType.DTSCD, MediaType.JaguarCD, MediaType.MEGACD,
MediaType.PS1CD, MediaType.PS2CD, MediaType.SuperCDROM2, MediaType.SVCD, MediaType.SATURNCD, MediaType.PS1CD, MediaType.PS2CD, MediaType.SuperCDROM2, MediaType.SVCD, MediaType.SATURNCD,
MediaType.ThreeDO, MediaType.VCD, MediaType.VCDHD, MediaType.NeoGeoCD, MediaType.PCFX, MediaType.ThreeDO, MediaType.VCD, MediaType.VCDHD, MediaType.NeoGeoCD, MediaType.PCFX,
MediaType.CDTV, MediaType.CD32, MediaType.Nuon, MediaType.Playdia, MediaType.Pippin MediaType.CDTV, MediaType.CD32, MediaType.Nuon, MediaType.Playdia, MediaType.Pippin,
MediaType.FMTOWNS
}; };
public IEnumerable<(string name, Type type, string description)> SupportedOptions => public IEnumerable<(string name, Type type, string description)> SupportedOptions =>
new (string name, Type type, string description)[] { }; new (string name, Type type, string description)[] { };

View File

@@ -213,7 +213,8 @@ namespace DiscImageChef.DiscImages
case MediaType.CD32: case MediaType.CD32:
case MediaType.Nuon: case MediaType.Nuon:
case MediaType.Playdia: case MediaType.Playdia:
case MediaType.Pippin: return XmlMediaType.OpticalDisc; case MediaType.Pippin:
case MediaType.FMTOWNS: return XmlMediaType.OpticalDisc;
default: return XmlMediaType.BlockMedia; default: return XmlMediaType.BlockMedia;
} }
} }

View File

@@ -8,7 +8,7 @@
// Category: Misc // Category: Misc
// File Mask: *.dicf // File Mask: *.dicf
// ID Bytes: 44 49 43 4D 46 52 4D 54 // DICMFRMT // ID Bytes: 44 49 43 4D 46 52 4D 54 // DICMFRMT
// History: // History:
// 1.0 2018-01-26 Natalia Portillo: Initial release // 1.0 2018-01-26 Natalia Portillo: Initial release
//------------------------------------------------ //------------------------------------------------
@@ -48,6 +48,7 @@ enum <uint> MediaType
PD650 = 32, PD650 = 32,
PD650_WORM = 33, PD650_WORM = 33,
CDIREADY = 34, CDIREADY = 34,
FMTOWNS = 35,
DVDROM = 40, DVDROM = 40,
DVDR = 41, DVDR = 41,
@@ -107,6 +108,7 @@ enum <uint> MediaType
PS3BD = 116, PS3BD = 116,
PS4BD = 117, PS4BD = 117,
UMD = 118, UMD = 118,
PlayStationVitaGameCard = 119,
XGD = 130, XGD = 130,
XGD2 = 131, XGD2 = 131,
@@ -125,6 +127,10 @@ enum <uint> MediaType
ThreeDO = 173, ThreeDO = 173,
PCFX = 174, PCFX = 174,
NeoGeoCD = 175, NeoGeoCD = 175,
CDTV = 176,
CD32 = 177,
Nuon = 178,
Playdia = 179,
Apple32SS = 180, Apple32SS = 180,
Apple32DS = 181, Apple32DS = 181,
@@ -502,6 +508,7 @@ enum <uint> MediaType
AppleWidget = 691, AppleWidget = 691,
AppleHD20 = 692, AppleHD20 = 692,
PriamDataTower = 693, PriamDataTower = 693,
Pippin = 694,
RA60 = 700, RA60 = 700,
RA80 = 701, RA80 = 701,
@@ -664,7 +671,7 @@ enum <byte> ChecksumAlgorithm
SpamSum = 4 SpamSum = 4
}; };
typedef struct typedef struct
{ {
char identifier[8]; char identifier[8];
wchar_t application[32]; wchar_t application[32];