From 49c6dc82b95ec44b6af4d59f2df5c92414c7782d Mon Sep 17 00:00:00 2001 From: Alexey 'Cluster' Avdyukhin Date: Wed, 7 Dec 2022 23:28:26 +0400 Subject: ROM file size fix --- .github/workflows/build.yaml | 20 ++++++++++---------- .../CoolgirlCombiner/CoolgirlCombiner.csproj | 6 +++--- tools_sources/CoolgirlCombiner/Program.cs | 7 +++---- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index bc57c39..700eebc 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -36,11 +36,11 @@ jobs: - name: Build CoolgirlCombiner for Linux-x64 env: SC_OPS: ${{ matrix.sc == 'self-contained' && '--self-contained true' || '--no-self-contained' }} - run: dotnet publish tools_sources/CoolgirlCombiner -c Release -r linux-x64 -o ${{ env.TOOLS_DIR }} ${{ env.SC_OPS }} + run: dotnet publish tools_sources/CoolgirlCombiner -c Debug -r linux-x64 -o ${{ env.TOOLS_DIR }} ${{ env.SC_OPS }} - name: Build NesTiler for Linux-x64 env: SC_OPS: ${{ matrix.sc == 'self-contained' && '--self-contained true' || '--no-self-contained' }} - run: dotnet publish tools_sources/NesTiler/NesTiler -c Release -r linux-x64 -o ${{ env.TOOLS_DIR }} ${{ env.SC_OPS }} + run: dotnet publish tools_sources/NesTiler/NesTiler -c Debug -r linux-x64 -o ${{ env.TOOLS_DIR }} ${{ env.SC_OPS }} - name: Build nesasm for Linux-x64 run: make -C tools_sources/nesasm/source EXEDIR=../../../${{ env.TOOLS_DIR }} - name: Remove unnecessary files @@ -61,11 +61,11 @@ jobs: - name: Build CoolgirlCombiner for Linux-ARM32 env: SC_OPS: ${{ matrix.sc == 'self-contained' && '--self-contained true' || '--no-self-contained' }} - run: dotnet publish tools_sources/CoolgirlCombiner -c Release -r linux-arm -o ${{ env.TOOLS_DIR }} ${{ env.SC_OPS }} + run: dotnet publish tools_sources/CoolgirlCombiner -c Debug -r linux-arm -o ${{ env.TOOLS_DIR }} ${{ env.SC_OPS }} - name: Build NesTiler for Linux-ARM32 env: SC_OPS: ${{ matrix.sc == 'self-contained' && '--self-contained true' || '--no-self-contained' }} - run: dotnet publish tools_sources/NesTiler/NesTiler -c Release -r linux-arm -o ${{ env.TOOLS_DIR }} ${{ env.SC_OPS }} + run: dotnet publish tools_sources/NesTiler/NesTiler -c Debug -r linux-arm -o ${{ env.TOOLS_DIR }} ${{ env.SC_OPS }} - name: Build nesasm for Linux-ARM32 run: make -C tools_sources/nesasm/source EXEDIR=../../../${{ env.TOOLS_DIR }} CC=arm-linux-gnueabihf-gcc - name: Remove unnecessary files @@ -82,11 +82,11 @@ jobs: - name: Build CoolgirlCombiner for Linux-ARM64 env: SC_OPS: ${{ matrix.sc == 'self-contained' && '--self-contained true' || '--no-self-contained' }} - run: dotnet publish tools_sources/CoolgirlCombiner -c Release -r linux-arm64 -o ${{ env.TOOLS_DIR }} ${{ env.SC_OPS }} + run: dotnet publish tools_sources/CoolgirlCombiner -c Debug -r linux-arm64 -o ${{ env.TOOLS_DIR }} ${{ env.SC_OPS }} - name: Build NesTiler for Linux-ARM64 env: SC_OPS: ${{ matrix.sc == 'self-contained' && '--self-contained true' || '--no-self-contained' }} - run: dotnet publish tools_sources/NesTiler/NesTiler -c Release -r linux-arm64 -o ${{ env.TOOLS_DIR }} ${{ env.SC_OPS }} + run: dotnet publish tools_sources/NesTiler/NesTiler -c Debug -r linux-arm64 -o ${{ env.TOOLS_DIR }} ${{ env.SC_OPS }} - name: Build nesasm for Linux-ARM64 run: make -C tools_sources/nesasm/source EXEDIR=../../../${{ env.TOOLS_DIR }} CC=aarch64-linux-gnu-gcc - name: Remove unnecessary files @@ -124,11 +124,11 @@ jobs: - name: Build CoolgirlCombiner for MacOS-x64 env: SC_OPS: ${{ matrix.sc == 'self-contained' && '--self-contained true' || '--no-self-contained' }} - run: dotnet publish tools_sources/CoolgirlCombiner -c Release -r osx-x64 -o ${{ env.TOOLS_DIR }} ${{ env.SC_OPS }} + run: dotnet publish tools_sources/CoolgirlCombiner -c Debug -r osx-x64 -o ${{ env.TOOLS_DIR }} ${{ env.SC_OPS }} - name: Build NesTiler for MacOS-x64 env: SC_OPS: ${{ matrix.sc == 'self-contained' && '--self-contained true' || '--no-self-contained' }} - run: dotnet publish tools_sources/NesTiler/NesTiler -c Release -r osx-x64 -o ${{ env.TOOLS_DIR }} ${{ env.SC_OPS }} + run: dotnet publish tools_sources/NesTiler/NesTiler -c Debug -r osx-x64 -o ${{ env.TOOLS_DIR }} ${{ env.SC_OPS }} - name: Build nesasm for MacOS-x64 run: make -C tools_sources/nesasm/source EXEDIR=../../../${{ env.TOOLS_DIR }} - name: Remove unnecessary files @@ -178,11 +178,11 @@ jobs: - name: Build CoolgirlCombiner for Win-x64 env: SC_OPS: ${{ matrix.sc == 'self-contained' && '--self-contained true' || '--no-self-contained' }} - run: dotnet publish tools_sources/CoolgirlCombiner -c Release -r win-x64 -o ${{ env.TOOLS_DIR }} ${{ env.SC_OPS }} + run: dotnet publish tools_sources/CoolgirlCombiner -c Debug -r win-x64 -o ${{ env.TOOLS_DIR }} ${{ env.SC_OPS }} - name: Build NesTiler for Win-x64 env: SC_OPS: ${{ matrix.sc == 'self-contained' && '--self-contained true' || '--no-self-contained' }} - run: dotnet publish tools_sources/NesTiler/NesTiler -c Release -r win-x64 -o ${{ env.TOOLS_DIR }} ${{ env.SC_OPS }} + run: dotnet publish tools_sources/NesTiler/NesTiler -c Debug -r win-x64 -o ${{ env.TOOLS_DIR }} ${{ env.SC_OPS }} - name: Remove unnecessary files shell: msys2 {0} run: rm -f ${{ env.TOOLS_DIR }}/*.md diff --git a/tools_sources/CoolgirlCombiner/CoolgirlCombiner.csproj b/tools_sources/CoolgirlCombiner/CoolgirlCombiner.csproj index 80185a4..c2bd258 100644 --- a/tools_sources/CoolgirlCombiner/CoolgirlCombiner.csproj +++ b/tools_sources/CoolgirlCombiner/CoolgirlCombiner.csproj @@ -10,9 +10,9 @@ enable https://github.com/ClusterM/coolgirl-multirom-builder git - 2.0.1 - 2.0.1 - 2.0.1 + 2.1.0 + 2.1.0 + 2.1.0 en Alexey 'Cluster' Avdyukhin diff --git a/tools_sources/CoolgirlCombiner/Program.cs b/tools_sources/CoolgirlCombiner/Program.cs index 7bb7614..47c35f2 100644 --- a/tools_sources/CoolgirlCombiner/Program.cs +++ b/tools_sources/CoolgirlCombiner/Program.cs @@ -28,7 +28,7 @@ namespace com.clusterrr.Famicom.CoolGirl { try { - var version = Assembly.GetExecutingAssembly()?.GetName()?.Version; + var version = Assembly.GetExecutingAssembly()?.GetName()?.Version; Console.WriteLine($"COOLGIRL Combiner v{version?.Major}.{version?.Minor}{((version?.Build ?? 0) > 0 ? $"{(char)((byte)'a' + version!.Build)}" : "")}"); Console.WriteLine($" Commit {Properties.Resources.gitCommit} @ {REPO_PATH}"); #if DEBUG @@ -238,7 +238,6 @@ namespace com.clusterrr.Famicom.CoolGirl usedSpace += notFittedSize; // Round up to minimum PRG bank size usedSpace = 0x4000 * (int)Math.Ceiling((float)usedSpace / (float)0x4000); - int romSize = usedSpace; // Round up to sector size usedSpace = FLASH_SECTOR_SIZE * (int)Math.Ceiling((float)usedSpace / (float)FLASH_SECTOR_SIZE); // Space for saves @@ -604,7 +603,7 @@ namespace com.clusterrr.Famicom.CoolGirl if (config.Command == Config.CombinerCommand.Prepare) { var offsets = new Offsets(); - offsets.Size = romSize; + offsets.Size = usedSpace; offsets.RomCount = gameCount; offsets.GamesFile = Path.GetFileName(config.GamesFile); offsets.Games = sortedGames.Where(g => !g.IsSeparator).ToArray(); @@ -614,7 +613,7 @@ namespace com.clusterrr.Famicom.CoolGirl if (config.Command == Config.CombinerCommand.Build) { Console.Write("Compiling using nesasm... "); - if (romSize < result.Length) Array.Resize(ref result, romSize); + if (usedSpace < result.Length) Array.Resize(ref result, usedSpace); var process = new Process(); var cp866 = CodePagesEncodingProvider.Instance.GetEncoding(866) ?? Encoding.ASCII; process.StartInfo.FileName = config.NesAsm; -- cgit v1.2.3