From 74fe88b84621e6a2ace445f7ac7c8673305c12b4 Mon Sep 17 00:00:00 2001 From: Alexey 'Cluster' Avdyukhin Date: Wed, 9 Nov 2022 00:56:41 +0400 Subject: Automatic GAMES_DB define, new parameter - --sources --- Makefile | 3 +-- tools_sources/CoolgirlCombiner/Program.cs | 12 +++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index b1492b2..0487c27 100644 --- a/Makefile +++ b/Makefile @@ -115,8 +115,7 @@ NESASM_OPTS += -C MENU_HEADER_PATTERN_TABLE_BIN=$(MENU_HEADER -C MENU_HEADER_ATTRIBUTE_TABLE_BIN=$(MENU_HEADER_ATTRIBUTE_TABLE_BIN) \ -C MENU_HEADER_BG_PALETTE_0=$(MENU_HEADER_BG_PALETTE_0) \ -C MENU_HEADER_BG_PALETTE_1=$(MENU_HEADER_BG_PALETTE_1) \ - -C MENU_HEADER_BG_PALETTE_2=$(MENU_HEADER_BG_PALETTE_2) \ - -C GAMES_DB=$(GAMES_DB) + -C MENU_HEADER_BG_PALETTE_2=$(MENU_HEADER_BG_PALETTE_2) all: $(UNIF) $(NES20) $(BIN) build: $(UNIF) diff --git a/tools_sources/CoolgirlCombiner/Program.cs b/tools_sources/CoolgirlCombiner/Program.cs index 9ee245a..cfa2146 100644 --- a/tools_sources/CoolgirlCombiner/Program.cs +++ b/tools_sources/CoolgirlCombiner/Program.cs @@ -51,6 +51,7 @@ namespace com.clusterrr.Famicom.CoolGirl optionSymbolsFile = Path.Combine("/etc", DEFAULT_SYMBOLS_FILE); string optionNesAsm = "nesasm"; string optionNesAsmArgs = ""; + string optionSourcesDir = "."; string? optionGamesFile = null; string optionAsmFile = "games.asm"; string optionOffsetsFile = "offsets.json"; @@ -166,6 +167,10 @@ namespace com.clusterrr.Famicom.CoolGirl optionNesAsmArgs = value; i++; break; + case "sources": + optionSourcesDir = value; + i++; + break; default: Console.WriteLine("Unknown parameter: " + param); needShowHelp = true; @@ -217,11 +222,12 @@ namespace com.clusterrr.Famicom.CoolGirl Console.WriteLine(" {0,-20}{1}", "--nes20", "- output NES 2.0 file"); Console.WriteLine(" {0,-20}{1}", "--bin", "- output raw binary file"); Console.WriteLine("All at once:"); - Console.WriteLine($" {exename} build --games --asm [--nesasm ] [--nesasm-args ] [--report ] [--nosort] [--maxromsize ] [--maxchrsize ] [--language ] [--badsectors ] [--unif ] [--nes20 ] [--bin ]"); + Console.WriteLine($" {exename} build --games --asm [--nesasm ] [--nesasm-args ] [--sources ] [--report ] [--nosort] [--maxromsize ] [--maxchrsize ] [--language ] [--badsectors ] [--unif ] [--nes20 ] [--bin ]"); Console.WriteLine(" {0,-20}{1}", "--games", "- input plain text file with list of ROM files"); Console.WriteLine(" {0,-20}{1}", "--asm", "- output file for the loader"); Console.WriteLine(" {0,-20}{1}", "--nesasm", "- path to the nesasm compiler executable"); Console.WriteLine(" {0,-20}{1}", "--nesasm-args", "- additional command-line arguments for nesasm"); + Console.WriteLine(" {0,-20}{1}", "--sources", "- directory with loader source files, default is current directory"); Console.WriteLine(" {0,-20}{1}", "--report", "- output report file (human readable)"); Console.WriteLine(" {0,-20}{1}", "--nosort", "- disable automatic sort by name"); Console.WriteLine(" {0,-20}{1}", "--maxromsize", "- maximum size for final file (in megabytes)"); @@ -790,8 +796,8 @@ namespace com.clusterrr.Famicom.CoolGirl var process = new Process(); var cp866 = CodePagesEncodingProvider.Instance.GetEncoding(866) ?? Encoding.ASCII; process.StartInfo.FileName = optionNesAsm; - process.StartInfo.Arguments = $"\"menu.asm\" -r -o - " + optionNesAsmArgs; - process.StartInfo.WorkingDirectory = Path.GetDirectoryName(optionAsmFile); + process.StartInfo.Arguments = $"\"menu.asm\" -r -o - -C \"GAMES_DB={optionAsmFile}\" " + optionNesAsmArgs; + process.StartInfo.WorkingDirectory = optionSourcesDir; process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; process.StartInfo.UseShellExecute = false; process.StartInfo.CreateNoWindow = true; -- cgit v1.2.3