Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/nes-containers.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'NesFile.cs')
-rw-r--r--NesFile.cs12
1 files changed, 6 insertions, 6 deletions
diff --git a/NesFile.cs b/NesFile.cs
index 06dc837..042b7ec 100644
--- a/NesFile.cs
+++ b/NesFile.cs
@@ -22,17 +22,17 @@ namespace com.clusterrr.Famicom.Containers
/// <summary>
/// CHR data (can be null if none)
/// </summary>
- public IEnumerable<byte> CHR
+ public IEnumerable<byte>? CHR
{
- get => Array.AsReadOnly(chr);
+ get => chr.Length == 0 ? null : Array.AsReadOnly(chr);
set => chr = (value ?? new byte[0]).ToArray();
}
/// <summary>
/// Trainer (can be null if none)
/// </summary>
- public IEnumerable<byte> Trainer
+ public IEnumerable<byte>? Trainer
{
- get => Array.AsReadOnly(trainer);
+ get => trainer.Length == 0 ? null : Array.AsReadOnly(trainer);
set
{
if (value != null && value.Count() != 0 && value.Count() != 512)
@@ -43,9 +43,9 @@ namespace com.clusterrr.Famicom.Containers
/// <summary>
/// Miscellaneous ROM (NES 2.0 only, can be null if none)
/// </summary>
- public IEnumerable<byte> MiscellaneousROM
+ public IEnumerable<byte>? MiscellaneousROM
{
- get => Array.AsReadOnly(miscellaneousROM);
+ get => miscellaneousROM.Length == 0 ? null : Array.AsReadOnly(miscellaneousROM);
set => miscellaneousROM = (value ?? new byte[0]).ToArray();
}
/// <summary>