From 4360c3b84fa6942527476c24b97829e839ff3f30 Mon Sep 17 00:00:00 2001 From: Alexey 'Cluster' Avdyukhin Date: Wed, 7 Dec 2022 23:28:04 +0400 Subject: ROM file size fix --- .github/workflows/build.yaml | 20 ++++++++++---------- flash.asm | 6 ++++-- tools_sources/CoolboyCombiner/CoolboyCombiner.csproj | 6 +++--- tools_sources/CoolboyCombiner/Program.cs | 9 +++++++-- 4 files changed, 24 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index dc5eed8..66ffc40 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -36,11 +36,11 @@ jobs: - name: Build CoolboyCombiner for Linux-x64 env: SC_OPS: ${{ matrix.sc == 'self-contained' && '--self-contained true' || '--no-self-contained' }} - run: dotnet publish tools_sources/CoolboyCombiner -c Release -r linux-x64 -o ${{ env.TOOLS_DIR }} ${{ env.SC_OPS }} + run: dotnet publish tools_sources/CoolboyCombiner -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 CoolboyCombiner for Linux-ARM32 env: SC_OPS: ${{ matrix.sc == 'self-contained' && '--self-contained true' || '--no-self-contained' }} - run: dotnet publish tools_sources/CoolboyCombiner -c Release -r linux-arm -o ${{ env.TOOLS_DIR }} ${{ env.SC_OPS }} + run: dotnet publish tools_sources/CoolboyCombiner -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 CoolboyCombiner for Linux-ARM64 env: SC_OPS: ${{ matrix.sc == 'self-contained' && '--self-contained true' || '--no-self-contained' }} - run: dotnet publish tools_sources/CoolboyCombiner -c Release -r linux-arm64 -o ${{ env.TOOLS_DIR }} ${{ env.SC_OPS }} + run: dotnet publish tools_sources/CoolboyCombiner -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 CoolboyCombiner for MacOS-x64 env: SC_OPS: ${{ matrix.sc == 'self-contained' && '--self-contained true' || '--no-self-contained' }} - run: dotnet publish tools_sources/CoolboyCombiner -c Release -r osx-x64 -o ${{ env.TOOLS_DIR }} ${{ env.SC_OPS }} + run: dotnet publish tools_sources/CoolboyCombiner -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 CoolboyCombiner for Win-x64 env: SC_OPS: ${{ matrix.sc == 'self-contained' && '--self-contained true' || '--no-self-contained' }} - run: dotnet publish tools_sources/CoolboyCombiner -c Release -r win-x64 -o ${{ env.TOOLS_DIR }} ${{ env.SC_OPS }} + run: dotnet publish tools_sources/CoolboyCombiner -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/flash.asm b/flash.asm index 383b0d7..62c3986 100644 --- a/flash.asm +++ b/flash.asm @@ -46,9 +46,11 @@ flash_erase_sector: sta $8555 lda #$30 sta $8000 + lda #$FF .wait: - lda $8000 - cmp #$FF + cmp $8000 + bne .wait + cmp $8000 bne .wait jmp flash_return diff --git a/tools_sources/CoolboyCombiner/CoolboyCombiner.csproj b/tools_sources/CoolboyCombiner/CoolboyCombiner.csproj index 9eaa4ad..e515f4c 100644 --- a/tools_sources/CoolboyCombiner/CoolboyCombiner.csproj +++ b/tools_sources/CoolboyCombiner/CoolboyCombiner.csproj @@ -10,9 +10,9 @@ enable https://github.com/ClusterM/coolboy-multirom-builder git - 2.0.0 - 2.0.0 - 2.0.0 + 2.1.0 + 2.1.0 + 2.1.0 en Alexey 'Cluster' Avdyukhin diff --git a/tools_sources/CoolboyCombiner/Program.cs b/tools_sources/CoolboyCombiner/Program.cs index 5efc5f7..3b82cff 100644 --- a/tools_sources/CoolboyCombiner/Program.cs +++ b/tools_sources/CoolboyCombiner/Program.cs @@ -28,7 +28,8 @@ namespace com.clusterrr.Famicom.CoolBoy { try { - Console.WriteLine($"COOLBOY Combiner v{Assembly.GetExecutingAssembly()?.GetName()?.Version?.Major}.{Assembly.GetExecutingAssembly()?.GetName()?.Version?.Minor}"); + var version = Assembly.GetExecutingAssembly()?.GetName()?.Version; + Console.WriteLine($"COOLBOY 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 Console.WriteLine($" Debug version, build time: {BUILD_TIME.ToLocalTime()}"); @@ -221,6 +222,9 @@ namespace com.clusterrr.Famicom.CoolBoy // 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 if (config.Saves) { // Round up to sector size @@ -499,7 +503,8 @@ namespace com.clusterrr.Famicom.CoolBoy asmResult.AppendLine("string_not_available:"); asmResult.Append(BytesToAsm(StringToTiles("NOT AVAILABLE", symbols))); asmResult.AppendLine("string_version:"); - asmResult.Append(BytesToAsm(StringToTiles($"VERSION: {Assembly.GetExecutingAssembly()?.GetName()?.Version?.Major}.{Assembly.GetExecutingAssembly()?.GetName()?.Version?.Minor}", symbols))); + var v = Assembly.GetExecutingAssembly()?.GetName()?.Version; + asmResult.Append(BytesToAsm(StringToTiles($"VERSION: {v?.Major}.{v?.Minor}{((v?.Build ?? 0) > 0 ? $"{(char)((byte)'a' + v!.Build)}" : "")}", symbols))); asmResult.AppendLine("string_commit:"); asmResult.Append(BytesToAsm(StringToTiles($"COMMIT: {Properties.Resources.gitCommit}", symbols))); switch (config.Language) -- cgit v1.2.3