diff options
author | Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> | 2020-09-24 11:20:14 +0300 |
---|---|---|
committer | Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> | 2020-09-24 11:20:14 +0300 |
commit | 697e35f8a8e7a0674513ea2a40c32c23b38816b6 (patch) | |
tree | 3564fca68fdb098734ee1a5fdaecdaa4c25d7fb0 | |
parent | 4f703d2d45f82bf7e87d9152d42b89856eda7c50 (diff) | |
parent | b53656d50ced58b8ab867f1878f45825d41472a6 (diff) |
Merge branch 'master' of https://github.com/ClusterM/nes-containers
-rw-r--r-- | NesFile.cs | 4 | ||||
-rw-r--r-- | UnifFile.cs | 2 |
2 files changed, 5 insertions, 1 deletions
@@ -716,7 +716,11 @@ namespace com.clusterrr.Famicom.Containers throw new InvalidDataException("Mapper > 255 supported by NES 2.0 only");
if (Submapper != 0)
throw new InvalidDataException("Submapper supported by NES 2.0 only");
+ var length16k = PRG.Length / 0x4000;
+ if (length16k > 0xFF) throw new ArgumentOutOfRangeException("PRG size is too big for iNES, use NES 2.0 instead");
header[4] = (byte)(PRG.Length / 0x4000);
+ var length8k = CHR.Length / 0x2000;
+ if (length8k > 0xFF) throw new ArgumentOutOfRangeException("CHR size is too big for iNES, use NES 2.0 instead");
header[5] = (byte)(CHR.Length / 0x2000);
// Hard-wired nametable mirroring type
if (Mirroring == MirroringType.Vertical)
diff --git a/UnifFile.cs b/UnifFile.cs index 8ca040e..c112850 100644 --- a/UnifFile.cs +++ b/UnifFile.cs @@ -59,7 +59,7 @@ namespace com.clusterrr.Famicom.Containers /// </summary>
/// <param name="fileName">Target filename</param>
/// <param name="dumperName"></param>
- public void Save(string fileName, string dumperName = null)
+ public void Save(string fileName)
{
var data = new List<byte>();
var header = new byte[32];
|