mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Use Aaru Metadata instead of CICM Metadata.
This commit is contained in:
@@ -5,11 +5,11 @@ using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
using Aaru.Helpers;
|
||||
using Schemas;
|
||||
using Marshal = Aaru.Helpers.Marshal;
|
||||
|
||||
namespace Aaru.DiscImages;
|
||||
@@ -23,9 +23,9 @@ public class AtariLynx : IByteAddressableImage
|
||||
/// <inheritdoc />
|
||||
public string Author => Authors.NataliaPortillo;
|
||||
/// <inheritdoc />
|
||||
public CICMMetadataType CicmMetadata => null;
|
||||
public Metadata AaruMetadata => null;
|
||||
/// <inheritdoc />
|
||||
public List<DumpHardwareType> DumpHardware => null;
|
||||
public List<DumpHardware> DumpHardware => null;
|
||||
/// <inheritdoc />
|
||||
public string Format => "Atari Lynx cartridge dump";
|
||||
/// <inheritdoc />
|
||||
@@ -91,7 +91,7 @@ public class AtariLynx : IByteAddressableImage
|
||||
MediaType = MediaType.AtariLynxCard,
|
||||
LastModificationTime = imageFilter.LastWriteTime,
|
||||
Sectors = (ulong)imageFilter.DataForkLength,
|
||||
XmlMediaType = XmlMediaType.LinearMedia
|
||||
MetadataMediaType = MetadataMediaType.LinearMedia
|
||||
};
|
||||
|
||||
HandyHeader header = Marshal.ByteArrayToStructureBigEndian<HandyHeader>(headerBytes, 0, 64);
|
||||
@@ -195,13 +195,13 @@ public class AtariLynx : IByteAddressableImage
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool SetCicmMetadata(CICMMetadataType metadata) => false;
|
||||
public bool SetMetadata(Metadata metadata) => false;
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool SetDumpHardware(List<DumpHardwareType> dumpHardware) => false;
|
||||
public bool SetDumpHardware(List<DumpHardware> dumpHardware) => false;
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool SetMetadata(ImageInfo metadata)
|
||||
public bool SetImageInfo(ImageInfo imageInfo)
|
||||
{
|
||||
if(!_opened)
|
||||
{
|
||||
@@ -217,11 +217,11 @@ public class AtariLynx : IByteAddressableImage
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!string.IsNullOrWhiteSpace(metadata.MediaTitle))
|
||||
_imageInfo.MediaTitle = metadata.MediaTitle[..32];
|
||||
if(!string.IsNullOrWhiteSpace(imageInfo.MediaTitle))
|
||||
_imageInfo.MediaTitle = imageInfo.MediaTitle[..32];
|
||||
|
||||
if(!string.IsNullOrWhiteSpace(metadata.MediaManufacturer))
|
||||
_imageInfo.MediaManufacturer = metadata.MediaManufacturer[..16];
|
||||
if(!string.IsNullOrWhiteSpace(imageInfo.MediaManufacturer))
|
||||
_imageInfo.MediaManufacturer = imageInfo.MediaManufacturer[..16];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -5,11 +5,11 @@ using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
using Aaru.Helpers;
|
||||
using Schemas;
|
||||
using Marshal = Aaru.Helpers.Marshal;
|
||||
|
||||
namespace Aaru.DiscImages;
|
||||
@@ -23,9 +23,9 @@ public class GameBoy : IByteAddressableImage
|
||||
/// <inheritdoc />
|
||||
public string Author => Authors.NataliaPortillo;
|
||||
/// <inheritdoc />
|
||||
public CICMMetadataType CicmMetadata => null;
|
||||
public Metadata AaruMetadata => null;
|
||||
/// <inheritdoc />
|
||||
public List<DumpHardwareType> DumpHardware => null;
|
||||
public List<DumpHardware> DumpHardware => null;
|
||||
/// <inheritdoc />
|
||||
public string Format => "Nintendo Game Boy cartridge dump";
|
||||
/// <inheritdoc />
|
||||
@@ -87,7 +87,7 @@ public class GameBoy : IByteAddressableImage
|
||||
MediaType = MediaType.GameBoyGamePak,
|
||||
LastModificationTime = imageFilter.LastWriteTime,
|
||||
Sectors = (ulong)imageFilter.DataForkLength,
|
||||
XmlMediaType = XmlMediaType.LinearMedia
|
||||
MetadataMediaType = MetadataMediaType.LinearMedia
|
||||
};
|
||||
|
||||
Header header = Marshal.ByteArrayToStructureBigEndian<Header>(_data, 0x100, Marshal.SizeOf<Header>());
|
||||
@@ -186,13 +186,13 @@ public class GameBoy : IByteAddressableImage
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool SetCicmMetadata(CICMMetadataType metadata) => false;
|
||||
public bool SetMetadata(Metadata metadata) => false;
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool SetDumpHardware(List<DumpHardwareType> dumpHardware) => false;
|
||||
public bool SetDumpHardware(List<DumpHardware> dumpHardware) => false;
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool SetMetadata(ImageInfo metadata) => true;
|
||||
public bool SetImageInfo(ImageInfo imageInfo) => true;
|
||||
|
||||
/// <inheritdoc />
|
||||
public long Position { get; set; }
|
||||
|
||||
@@ -5,11 +5,11 @@ using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
using Aaru.Helpers;
|
||||
using Schemas;
|
||||
using Marshal = Aaru.Helpers.Marshal;
|
||||
|
||||
namespace Aaru.DiscImages;
|
||||
@@ -23,9 +23,9 @@ public class GameBoyAdvance : IByteAddressableImage
|
||||
/// <inheritdoc />
|
||||
public string Author => Authors.NataliaPortillo;
|
||||
/// <inheritdoc />
|
||||
public CICMMetadataType CicmMetadata => null;
|
||||
public Metadata AaruMetadata => null;
|
||||
/// <inheritdoc />
|
||||
public List<DumpHardwareType> DumpHardware => null;
|
||||
public List<DumpHardware> DumpHardware => null;
|
||||
/// <inheritdoc />
|
||||
public string Format => "Nintendo Game Boy Advance cartridge dump";
|
||||
/// <inheritdoc />
|
||||
@@ -86,7 +86,7 @@ public class GameBoyAdvance : IByteAddressableImage
|
||||
MediaType = MediaType.GameBoyAdvanceGamePak,
|
||||
LastModificationTime = imageFilter.LastWriteTime,
|
||||
Sectors = (ulong)imageFilter.DataForkLength,
|
||||
XmlMediaType = XmlMediaType.LinearMedia
|
||||
MetadataMediaType = MetadataMediaType.LinearMedia
|
||||
};
|
||||
|
||||
Header header = Marshal.ByteArrayToStructureBigEndian<Header>(_data, 0, Marshal.SizeOf<Header>());
|
||||
@@ -164,13 +164,13 @@ public class GameBoyAdvance : IByteAddressableImage
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool SetCicmMetadata(CICMMetadataType metadata) => false;
|
||||
public bool SetMetadata(Metadata metadata) => false;
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool SetDumpHardware(List<DumpHardwareType> dumpHardware) => false;
|
||||
public bool SetDumpHardware(List<DumpHardware> dumpHardware) => false;
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool SetMetadata(ImageInfo metadata) => true;
|
||||
public bool SetImageInfo(ImageInfo imageInfo) => true;
|
||||
|
||||
/// <inheritdoc />
|
||||
public long Position { get; set; }
|
||||
|
||||
@@ -5,11 +5,11 @@ using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
using Aaru.Helpers;
|
||||
using Schemas;
|
||||
using Marshal = Aaru.Helpers.Marshal;
|
||||
|
||||
namespace Aaru.DiscImages;
|
||||
@@ -25,9 +25,9 @@ public class MasterSystem : IByteAddressableImage
|
||||
/// <inheritdoc />
|
||||
public string Author => Authors.NataliaPortillo;
|
||||
/// <inheritdoc />
|
||||
public CICMMetadataType CicmMetadata => null;
|
||||
public Metadata AaruMetadata => null;
|
||||
/// <inheritdoc />
|
||||
public List<DumpHardwareType> DumpHardware => null;
|
||||
public List<DumpHardware> DumpHardware => null;
|
||||
/// <inheritdoc />
|
||||
public string Format => _gameGear ? "Sega Game Gear cartridge dump" : "Sega Master System cartridge dump";
|
||||
/// <inheritdoc />
|
||||
@@ -128,7 +128,7 @@ public class MasterSystem : IByteAddressableImage
|
||||
ImageSize = (ulong)imageFilter.DataForkLength,
|
||||
LastModificationTime = imageFilter.LastWriteTime,
|
||||
Sectors = (ulong)imageFilter.DataForkLength,
|
||||
XmlMediaType = XmlMediaType.LinearMedia
|
||||
MetadataMediaType = MetadataMediaType.LinearMedia
|
||||
};
|
||||
|
||||
Header header = Marshal.ByteArrayToStructureBigEndian<Header>(_data, headerPosition, Marshal.SizeOf<Header>());
|
||||
@@ -266,13 +266,13 @@ public class MasterSystem : IByteAddressableImage
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool SetCicmMetadata(CICMMetadataType metadata) => false;
|
||||
public bool SetMetadata(Metadata metadata) => false;
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool SetDumpHardware(List<DumpHardwareType> dumpHardware) => false;
|
||||
public bool SetDumpHardware(List<DumpHardware> dumpHardware) => false;
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool SetMetadata(ImageInfo metadata) => true;
|
||||
public bool SetImageInfo(ImageInfo imageInfo) => true;
|
||||
|
||||
/// <inheritdoc />
|
||||
public long Position { get; set; }
|
||||
|
||||
@@ -6,13 +6,13 @@ using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Aaru.Checksums;
|
||||
using Aaru.CommonTypes;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
using Aaru.Database;
|
||||
using Aaru.Database.Models;
|
||||
using Aaru.Helpers;
|
||||
using Schemas;
|
||||
|
||||
namespace Aaru.DiscImages;
|
||||
|
||||
@@ -38,9 +38,9 @@ public class Nes : IByteAddressableImage
|
||||
/// <inheritdoc />
|
||||
public string Author => Authors.NataliaPortillo;
|
||||
/// <inheritdoc />
|
||||
public CICMMetadataType CicmMetadata => null;
|
||||
public Metadata AaruMetadata => null;
|
||||
/// <inheritdoc />
|
||||
public List<DumpHardwareType> DumpHardware => null;
|
||||
public List<DumpHardware> DumpHardware => null;
|
||||
/// <inheritdoc />
|
||||
public string Format => _nes20 ? "NES 2.0" : "iNES";
|
||||
/// <inheritdoc />
|
||||
@@ -172,7 +172,7 @@ public class Nes : IByteAddressableImage
|
||||
ImageSize = (ulong)imageFilter.DataForkLength,
|
||||
LastModificationTime = imageFilter.LastWriteTime,
|
||||
Sectors = (ulong)imageFilter.DataForkLength,
|
||||
XmlMediaType = XmlMediaType.LinearMedia,
|
||||
MetadataMediaType = MetadataMediaType.LinearMedia,
|
||||
MediaType = MediaType.FamicomGamePak
|
||||
};
|
||||
|
||||
@@ -390,13 +390,13 @@ public class Nes : IByteAddressableImage
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool SetCicmMetadata(CICMMetadataType metadata) => false;
|
||||
public bool SetMetadata(Metadata metadata) => false;
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool SetDumpHardware(List<DumpHardwareType> dumpHardware) => false;
|
||||
public bool SetDumpHardware(List<DumpHardware> dumpHardware) => false;
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool SetMetadata(ImageInfo metadata) => true;
|
||||
public bool SetImageInfo(ImageInfo imageInfo) => true;
|
||||
|
||||
/// <inheritdoc />
|
||||
public long Position { get; set; }
|
||||
|
||||
@@ -37,11 +37,11 @@ using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
using Aaru.Helpers;
|
||||
using Schemas;
|
||||
using Marshal = Aaru.Helpers.Marshal;
|
||||
|
||||
namespace Aaru.DiscImages;
|
||||
@@ -59,9 +59,9 @@ public class Nintendo64 : IByteAddressableImage
|
||||
/// <inheritdoc />
|
||||
public string Author => Authors.NataliaPortillo;
|
||||
/// <inheritdoc />
|
||||
public CICMMetadataType CicmMetadata => null;
|
||||
public Metadata AaruMetadata => null;
|
||||
/// <inheritdoc />
|
||||
public List<DumpHardwareType> DumpHardware => null;
|
||||
public List<DumpHardware> DumpHardware => null;
|
||||
/// <inheritdoc />
|
||||
public string Format => !_opened
|
||||
? "Nintendo 64 cartridge dump"
|
||||
@@ -164,7 +164,7 @@ public class Nintendo64 : IByteAddressableImage
|
||||
MediaType = MediaType.N64GamePak,
|
||||
LastModificationTime = imageFilter.LastWriteTime,
|
||||
Sectors = (ulong)imageFilter.DataForkLength,
|
||||
XmlMediaType = XmlMediaType.LinearMedia
|
||||
MetadataMediaType = MetadataMediaType.LinearMedia
|
||||
};
|
||||
|
||||
if(_littleEndian)
|
||||
@@ -850,13 +850,13 @@ public class Nintendo64 : IByteAddressableImage
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool SetCicmMetadata(CICMMetadataType metadata) => false;
|
||||
public bool SetMetadata(Metadata metadata) => false;
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool SetDumpHardware(List<DumpHardwareType> dumpHardware) => false;
|
||||
public bool SetDumpHardware(List<DumpHardware> dumpHardware) => false;
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool SetMetadata(ImageInfo metadata) => true;
|
||||
public bool SetImageInfo(ImageInfo imageInfo) => true;
|
||||
|
||||
static string DecodeCountryCode(byte countryCode) => countryCode switch
|
||||
{
|
||||
|
||||
@@ -37,11 +37,11 @@ using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
using Aaru.Helpers;
|
||||
using Schemas;
|
||||
using Marshal = Aaru.Helpers.Marshal;
|
||||
|
||||
namespace Aaru.DiscImages;
|
||||
@@ -60,9 +60,9 @@ public class SegaMegaDrive : IByteAddressableImage
|
||||
/// <inheritdoc />
|
||||
public string Author => Authors.NataliaPortillo;
|
||||
/// <inheritdoc />
|
||||
public CICMMetadataType CicmMetadata => null;
|
||||
public Metadata AaruMetadata => null;
|
||||
/// <inheritdoc />
|
||||
public List<DumpHardwareType> DumpHardware => null;
|
||||
public List<DumpHardware> DumpHardware => null;
|
||||
/// <inheritdoc />
|
||||
public string Format => !_opened
|
||||
? "Mega Drive cartridge dump"
|
||||
@@ -337,8 +337,8 @@ public class SegaMegaDrive : IByteAddressableImage
|
||||
_ => MediaType.MegaDriveCartridge
|
||||
};
|
||||
|
||||
_imageInfo.Sectors = (ulong)_data.Length;
|
||||
_imageInfo.XmlMediaType = XmlMediaType.LinearMedia;
|
||||
_imageInfo.Sectors = (ulong)_data.Length;
|
||||
_imageInfo.MetadataMediaType = MetadataMediaType.LinearMedia;
|
||||
|
||||
_imageInfo.Comments = sb.ToString();
|
||||
_opened = true;
|
||||
@@ -449,13 +449,13 @@ public class SegaMegaDrive : IByteAddressableImage
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool SetCicmMetadata(CICMMetadataType metadata) => false;
|
||||
public bool SetMetadata(Metadata metadata) => false;
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool SetDumpHardware(List<DumpHardwareType> dumpHardware) => false;
|
||||
public bool SetDumpHardware(List<DumpHardware> dumpHardware) => false;
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool SetMetadata(ImageInfo metadata) => true;
|
||||
public bool SetImageInfo(ImageInfo imageInfo) => true;
|
||||
|
||||
/// <inheritdoc />
|
||||
public long Position { get; set; }
|
||||
|
||||
@@ -5,11 +5,11 @@ using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
using Aaru.Helpers;
|
||||
using Schemas;
|
||||
using Marshal = Aaru.Helpers.Marshal;
|
||||
|
||||
namespace Aaru.DiscImages;
|
||||
@@ -183,7 +183,7 @@ public class SuperNintendo : IByteAddressableImage
|
||||
MediaType = _header.Region == 1 ? MediaType.SNESGamePakUS : MediaType.SNESGamePak,
|
||||
LastModificationTime = imageFilter.LastWriteTime,
|
||||
Sectors = (ulong)imageFilter.DataForkLength,
|
||||
XmlMediaType = XmlMediaType.LinearMedia,
|
||||
MetadataMediaType = MetadataMediaType.LinearMedia,
|
||||
MediaTitle = StringHandlers.SpacePaddedToString(_header.Title, encoding),
|
||||
MediaManufacturer = DecodeManufacturer(_header.OldMakerCode, _header.MakerCode)
|
||||
};
|
||||
@@ -239,9 +239,9 @@ public class SuperNintendo : IByteAddressableImage
|
||||
/// <inheritdoc />
|
||||
public string Format => "Super Nintendo Cartridge Dump";
|
||||
/// <inheritdoc />
|
||||
public List<DumpHardwareType> DumpHardware => null;
|
||||
public List<DumpHardware> DumpHardware => null;
|
||||
/// <inheritdoc />
|
||||
public CICMMetadataType CicmMetadata => null;
|
||||
public Metadata AaruMetadata => null;
|
||||
/// <inheritdoc />
|
||||
public string ErrorMessage { get; private set; }
|
||||
/// <inheritdoc />
|
||||
@@ -296,13 +296,13 @@ public class SuperNintendo : IByteAddressableImage
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool SetCicmMetadata(CICMMetadataType metadata) => false;
|
||||
public bool SetMetadata(Metadata metadata) => false;
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool SetDumpHardware(List<DumpHardwareType> dumpHardware) => false;
|
||||
public bool SetDumpHardware(List<DumpHardware> dumpHardware) => false;
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool SetMetadata(ImageInfo metadata) => true;
|
||||
public bool SetImageInfo(ImageInfo imageInfo) => true;
|
||||
|
||||
/// <inheritdoc />
|
||||
public long Position { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user