diff options
author | Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> | 2022-12-13 18:11:41 +0300 |
---|---|---|
committer | Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> | 2022-12-13 18:13:35 +0300 |
commit | b271384cc473e469e2c96ed9eaf437219c678d0b (patch) | |
tree | 3f5c3c4c0fc5670822c1f97bc57e619e0a690843 | |
parent | d9513045ac61429651f422c44e7351ede430e600 (diff) |
ROM size check
-rw-r--r-- | tools_sources/CoolboyCombiner/Config.cs | 8 | ||||
-rw-r--r-- | tools_sources/CoolboyCombiner/Program.cs | 5 |
2 files changed, 11 insertions, 2 deletions
diff --git a/tools_sources/CoolboyCombiner/Config.cs b/tools_sources/CoolboyCombiner/Config.cs index 781bf2e..ba4db19 100644 --- a/tools_sources/CoolboyCombiner/Config.cs +++ b/tools_sources/CoolboyCombiner/Config.cs @@ -203,6 +203,14 @@ namespace com.clusterrr.Famicom.CoolBoy Console.WriteLine("At least one parameter required: --unif, --nes20 or --bin"); return null; } + if (((config.Submapper == 5) || (config.Submapper == 6)) && config.MaxRomSizeMB > 4) + { + throw new InvalidDataException($"ROM with submapper {config.Submapper} can't be > 4MB"); + } + if (config.MaxRomSizeMB > 32) + { + throw new InvalidDataException($"ROM can't be > 32MB"); + } return config; } diff --git a/tools_sources/CoolboyCombiner/Program.cs b/tools_sources/CoolboyCombiner/Program.cs index e22716d..134ecbe 100644 --- a/tools_sources/CoolboyCombiner/Program.cs +++ b/tools_sources/CoolboyCombiner/Program.cs @@ -403,8 +403,9 @@ namespace com.clusterrr.Famicom.CoolBoy throw new NotSupportedException($"Submapper {config.Submapper} is not supported");
}
r2 = 0;
- r3 = (byte)(((game.Mapper == 0) ? (1 << 4) : 0) // NROM mode
- | ((bank & 0b111) << 1) // 2, 1, 0 bits
+ r3 = (byte)(
+ ((game.Mapper == 0) ? (1 << 4) : 0) // NROM mode
+ | ((bank & 0b111) << 1) // 2(16), 1(15), 0(14) bits
| 0x80); // lockout
regs["reg_0"].Add(string.Format("${0:X2}", r0));
|