Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/coolgirl-multicart/coolgirl-multirom-builder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2022-11-07 16:10:10 +0300
committerAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2022-11-07 16:10:37 +0300
commiteee8ef253c3286d7904328fc040672f58548c56c (patch)
treea898cfe6575be6dca260b43d26dfa24c5aba0488
parentb41ae1ab2bb784d34018053ff5e967de22888fc2 (diff)
Makefile to create some resources
-rw-r--r--tools_sources/CoolgirlCombiner.sln6
-rw-r--r--tools_sources/CoolgirlCombiner/CoolgirlCombiner.csproj19
-rw-r--r--tools_sources/CoolgirlCombiner/Makefile14
-rw-r--r--tools_sources/CoolgirlCombiner/Program.cs25
-rw-r--r--tools_sources/CoolgirlCombiner/Resources/dummy0
5 files changed, 58 insertions, 6 deletions
diff --git a/tools_sources/CoolgirlCombiner.sln b/tools_sources/CoolgirlCombiner.sln
index 866264e..89fbf54 100644
--- a/tools_sources/CoolgirlCombiner.sln
+++ b/tools_sources/CoolgirlCombiner.sln
@@ -5,6 +5,8 @@ VisualStudioVersion = 17.3.32825.248
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoolgirlCombiner", "CoolgirlCombiner\CoolgirlCombiner.csproj", "{3BD5CDFF-02F6-4D2A-B95C-CC82EB73785E}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NesTiler", "..\..\..\C#\NesTiler\NesTiler\NesTiler.csproj", "{BA88B483-D314-4D20-9787-DE0666EED7AD}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -15,6 +17,10 @@ Global
{3BD5CDFF-02F6-4D2A-B95C-CC82EB73785E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3BD5CDFF-02F6-4D2A-B95C-CC82EB73785E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3BD5CDFF-02F6-4D2A-B95C-CC82EB73785E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {BA88B483-D314-4D20-9787-DE0666EED7AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {BA88B483-D314-4D20-9787-DE0666EED7AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {BA88B483-D314-4D20-9787-DE0666EED7AD}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {BA88B483-D314-4D20-9787-DE0666EED7AD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/tools_sources/CoolgirlCombiner/CoolgirlCombiner.csproj b/tools_sources/CoolgirlCombiner/CoolgirlCombiner.csproj
index 714988f..2bda475 100644
--- a/tools_sources/CoolgirlCombiner/CoolgirlCombiner.csproj
+++ b/tools_sources/CoolgirlCombiner/CoolgirlCombiner.csproj
@@ -24,6 +24,21 @@
</ItemGroup>
<ItemGroup>
+ <Compile Update="Properties\Resources.Designer.cs">
+ <DesignTime>True</DesignTime>
+ <AutoGen>True</AutoGen>
+ <DependentUpon>Resources.resx</DependentUpon>
+ </Compile>
+ </ItemGroup>
+
+ <ItemGroup>
+ <EmbeddedResource Update="Properties\Resources.resx">
+ <Generator>ResXFileCodeGenerator</Generator>
+ <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+ </EmbeddedResource>
+ </ItemGroup>
+
+ <ItemGroup>
<None Update="coolgirl-fixes.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
@@ -42,4 +57,8 @@
<DebugType>embedded</DebugType>
</PropertyGroup>
+ <Target Name="PreBuild" BeforeTargets="PreBuildEvent">
+ <Exec Command="make commit buildtime" />
+ </Target>
+
</Project>
diff --git a/tools_sources/CoolgirlCombiner/Makefile b/tools_sources/CoolgirlCombiner/Makefile
new file mode 100644
index 0000000..75503e0
--- /dev/null
+++ b/tools_sources/CoolgirlCombiner/Makefile
@@ -0,0 +1,14 @@
+# Makefile to create some resources
+
+COMMIT=$(shell git rev-parse --short HEAD)
+COMMIT_RESOURCE=Resources/commit.txt
+BUILDTIME_RESOURCE=Resources/buildtime.txt
+
+all: commit buildtime
+
+commit:
+ echo -n $(COMMIT) > $(COMMIT_RESOURCE)
+ git diff-index --quiet HEAD -- || echo -n " (dirty)" >> $(COMMIT_RESOURCE)
+
+buildtime:
+ date -u +"%s" > $(BUILDTIME_RESOURCE)
diff --git a/tools_sources/CoolgirlCombiner/Program.cs b/tools_sources/CoolgirlCombiner/Program.cs
index ad9e409..9c02c03 100644
--- a/tools_sources/CoolgirlCombiner/Program.cs
+++ b/tools_sources/CoolgirlCombiner/Program.cs
@@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
+using System.Reflection;
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
@@ -13,6 +14,8 @@ namespace com.clusterrr.Famicom.CoolGirl
{
class Program
{
+ public const string REPO_PATH = "https://github.com/ClusterM/coolgirl-multirom-builder";
+ public static DateTime BUILD_TIME = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc).AddSeconds(long.Parse(Properties.Resources.buildtime.Trim()));
const string DEFAULT_MAPPERS_FILE = @"coolgirl-mappers.json";
const string DEFAULT_FIXES_FILE = @"coolgirl-fixes.json";
const string DEFAULT_SYMBOLS_FILE = @"coolgirl-symbols.json";
@@ -21,11 +24,14 @@ namespace com.clusterrr.Famicom.CoolGirl
{
try
{
- Console.WriteLine("COOLGIRL UNIF combiner");
- Console.WriteLine("(c) Cluster, 2021");
- Console.WriteLine("http://clusterrr.com");
- Console.WriteLine("clusterrr@clusterrr.com");
- Console.WriteLine();
+ Console.WriteLine($"COOLGIRL Combiner v{Assembly.GetExecutingAssembly()?.GetName()?.Version?.Major}.{Assembly.GetExecutingAssembly()?.GetName()?.Version?.Minor}");
+ Console.WriteLine($" Commit {Properties.Resources.gitCommit} @ {REPO_PATH}");
+#if DEBUG
+ Console.WriteLine($" Debug version, build time: {BUILD_TIME.ToLocalTime()}");
+#endif
+ Console.WriteLine(" (c) Alexey 'Cluster' Avdyukhin / https://clusterrr.com / clusterrr@clusterrr.com");
+ Console.WriteLine("");
+
bool needShowHelp = false;
const string commandPrepare = "prepare";
@@ -34,8 +40,14 @@ namespace com.clusterrr.Famicom.CoolGirl
string command = null;
string optionMappersFile = Path.Combine(Path.GetDirectoryName(AppContext.BaseDirectory), DEFAULT_MAPPERS_FILE);
+ if (!File.Exists(optionMappersFile) && !OperatingSystem.IsWindows())
+ optionMappersFile = Path.Combine("/etc", DEFAULT_MAPPERS_FILE);
string optionFixesFile = Path.Combine(Path.GetDirectoryName(AppContext.BaseDirectory), DEFAULT_FIXES_FILE);
+ if (!File.Exists(optionFixesFile) && !OperatingSystem.IsWindows())
+ optionFixesFile = Path.Combine("/etc", DEFAULT_FIXES_FILE);
string optionSymbolsFile = Path.Combine(Path.GetDirectoryName(AppContext.BaseDirectory), DEFAULT_SYMBOLS_FILE);
+ if (!File.Exists(optionSymbolsFile) && !OperatingSystem.IsWindows())
+ optionSymbolsFile = Path.Combine("/etc", DEFAULT_SYMBOLS_FILE);
string optionNesAsm = "nesasm";
string optionNesAsmArgs = "";
string optionGamesFile = null;
@@ -585,12 +597,13 @@ namespace com.clusterrr.Famicom.CoolGirl
uint chrMask = ~(chrBankingSize / 0x2000 - 1);
byte @params = 0;
- if (prgRamEnabled) @params |= (1 << 0); // enable SRAM
+ if (prgRamEnabled || game.Battery) @params |= (1 << 0); // enable SRAM
if (game.ChrSize == 0) @params |= (1 << 1); // enable CHR write
if (game.Mirroring == MirroringType.Horizontal) @params |= (1 << 3); // default mirroring
if (game.Mirroring == MirroringType.FourScreenVram) @params |= (1 << 5); // four-screen mirroring
@params |= (1 << 7); // lockout
+ // TODO: replace magic numbers
regs["reg_0"].Add(string.Format("${0:X2}", ((game.PrgOffset / 0x4000) >> 8) & 0xFF)); // none[7:5], prg_base[26:22]
regs["reg_1"].Add(string.Format("${0:X2}", (game.PrgOffset / 0x4000) & 0xFF)); // prg_base[21:14]
regs["reg_2"].Add(string.Format("${0:X2}", ((chrMask & 0x20) << 2) | (prgMask & 0x7F))); // chr_mask[18], prg_mask[20:14]
diff --git a/tools_sources/CoolgirlCombiner/Resources/dummy b/tools_sources/CoolgirlCombiner/Resources/dummy
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tools_sources/CoolgirlCombiner/Resources/dummy