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:
authorAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2022-11-05 15:49:04 +0300
committerAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2022-11-05 15:49:04 +0300
commitd0ee300e41dc33d093ee78f9d4ae4da697908cc4 (patch)
tree7bcbf0587dab043cbe189b4bb2f18c21ca826a06
parent07c9382c7755c78db9445d5f7d9d260fc377789f (diff)
Minor checks and comments
-rw-r--r--FdsDiskFile.cs3
-rw-r--r--FdsDiskSide.cs1
-rw-r--r--FdsFile.cs1
3 files changed, 3 insertions, 2 deletions
diff --git a/FdsDiskFile.cs b/FdsDiskFile.cs
index 88e3dce..e972fd2 100644
--- a/FdsDiskFile.cs
+++ b/FdsDiskFile.cs
@@ -4,7 +4,7 @@ using System.Linq;
namespace com.clusterrr.Famicom.Containers
{
/// <summary>
- /// FDS file - header and data
+ /// File on FDS disk - header and data
/// </summary>
public class FdsDiskFile
{
@@ -55,6 +55,7 @@ namespace com.clusterrr.Famicom.Containers
HeaderBlock.FileSize = (ushort)DataBlock.Data.Count();
}
}
+
/// <summary>
/// Construcor
/// </summary>
diff --git a/FdsDiskSide.cs b/FdsDiskSide.cs
index 1a373d9..0d08639 100644
--- a/FdsDiskSide.cs
+++ b/FdsDiskSide.cs
@@ -89,7 +89,6 @@ namespace com.clusterrr.Famicom.Containers
public byte FileAmount { get => fileAmountBlock.FileAmount; set => fileAmountBlock.FileAmount = value; }
readonly IList<FdsDiskFile> files;
-
/// <summary>
/// Files on disk
/// </summary>
diff --git a/FdsFile.cs b/FdsFile.cs
index 35e12a5..000849b 100644
--- a/FdsFile.cs
+++ b/FdsFile.cs
@@ -39,6 +39,7 @@ namespace com.clusterrr.Famicom.Containers
{
if (data[0] == (byte)'F' && data[1] == (byte)'D' && data[2] == (byte)'S' && data[3] == 0x1A)
data = data.Skip(16).ToArray(); // skip header
+ if (data.Length % 65500 != 0) throw new InvalidDataException("Invalid FDS image: the size must be divisible by 65500");
for (int i = 0; i < data.Length; i += 65500)
{
var sideData = data.Skip(i).Take(66500).ToArray();