From 4753c118bfb5b2d66a38d6313dccb4a9fb2ea2ff Mon Sep 17 00:00:00 2001 From: Peter Hanraets Date: Wed, 24 Jan 2024 09:56:42 +0100 Subject: [PATCH] Changed the output file extension to cat and max size to 9MB (in line with 1.20 firmware for MSXpico --- prepare_msxpico_roms/Program.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/prepare_msxpico_roms/Program.cs b/prepare_msxpico_roms/Program.cs index 1c3c7e1..93c3f8d 100644 --- a/prepare_msxpico_roms/Program.cs +++ b/prepare_msxpico_roms/Program.cs @@ -43,9 +43,13 @@ internal class Program static void Main(string[] args) { string romFilesDirName = "."; - string concatOutputFileName = "msxpico.bin"; + string concatOutputFileName = "msxpico.cat"; UInt32 concatOutputSize = 0; + const UInt32 concatOutputMaxSize = 9 * 1024 * 1024; + + const string version = "0.4"; + const UInt16 mapperGeneric8 = 0; /* Generic switch, 8kB pages */ const UInt16 mapperGeneric16 = 1; /* Generic switch, 16kB pages */ const UInt16 mapperKonami5 = 2; /* Konami 5000/7000/9000/B000h */ @@ -70,6 +74,9 @@ static void Main(string[] args) const UInt16 generationMSX1 = 0; const UInt16 generationMSX2 = 1; + Console.WriteLine("MSXpico Catalog Preparation v" + version); + Console.WriteLine(); + if (args.Length == 1) { romFilesDirName = args[0]; @@ -100,7 +107,7 @@ static void Main(string[] args) string romGenerationString = romFileInfo.Name.Split('.')[0].Split('_')[2]; romHeader.size = (UInt32) romFileInfo.Length; - if (concatOutputSize + romHeader.size + (2 * 96) < (7 * 1024 * 1024)) + if (concatOutputSize + romHeader.size + (2 * 96) < (concatOutputMaxSize)) { switch (romMapperString) { @@ -232,8 +239,8 @@ static void Main(string[] args) } } - Console.WriteLine("Size of msxpico.bin:\t" + ByteSize.FromBytes(concatOutputSize + 96).ToString("#.# KiB")); - Console.WriteLine("Remaining flash space:\t" + ByteSize.FromBytes((7 * 1024 * 1024) - (concatOutputSize + 96)).ToString("#.# KiB")); + Console.WriteLine("Size of msxpico.cat:\t" + ByteSize.FromBytes(concatOutputSize + 96).ToString("#.# KiB")); + Console.WriteLine("Remaining flash space:\t" + ByteSize.FromBytes((concatOutputMaxSize) - (concatOutputSize + 96)).ToString("#.# KiB")); // Write a terminator header so pico knows he is finished; byte[] romTerminator = new byte[96]; concatOutputFileStream.Write(romTerminator, 0, 96);