From 78f88ccee2e193b939ba665e471e936a2ab0ab95 Mon Sep 17 00:00:00 2001 From: octorock <79596758+octorock@users.noreply.github.com> Date: Tue, 22 Jun 2021 12:34:17 +0200 Subject: [PATCH] Exclude baseroms as dependencies in scaninc --- INSTALL.md | 12 ++++++++++++ data/data_08125104.s | 8 ++++++++ tools/scaninc/scaninc.cpp | 5 ++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 52053fd2..ca85d21c 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,5 +1,17 @@ +# Install First, you must put a The Legend of Zelda: The Minish Cap (U) ROM (with SHA1: `b4bd50e4131b027c334547b4524e2dbbd4227130`) in the root directory of the repository and name it `baserom.gba`. + +## Building other variants +To build other variants, you currently need a combination of different baseroms, depending on the variant. +| | USA | DEMO | JP | EU | +| - | :-: | :-: | :-: | :-: | +| baserom.gba | X | X | X | X | +| baserom_demo.gba | | X | | | +| baserom_jp.gba | | | X | X | +| baserom_eu.gba | | | | X | + + ## Prerequisites | Linux | macOS | Windows 10 (build 18917+) | Windows 10 (1709+) | Windows 8, 8.1, and 10 (1507, 1511, 1607, 1703) diff --git a/data/data_08125104.s b/data/data_08125104.s index 878a558d..59eb64fa 100644 --- a/data/data_08125104.s +++ b/data/data_08125104.s @@ -636,7 +636,11 @@ gUnk_08126798:: @ 08126798 .incbin "baserom.gba", 0x126B60, 0x000001C .endif .4byte gUnk_08125F10 +.ifdef EU .incbin "baserom_eu.gba", 0x1262B8, 0x0000004 +.else + .incbin "baserom.gba", 0x126B80, 0x0000004 +.endif .4byte gUnk_08125F38 .incbin "baserom.gba", 0x126B88, 0x000000C .4byte gUnk_08125F48 @@ -701,7 +705,11 @@ gUnk_08126798:: @ 08126798 .incbin "baserom.gba", 0x126CC0, 0x000001C .endif .4byte gUnk_081263E8 +.ifdef EU .incbin "baserom_eu.gba", 0x126418, 0x0000004 +.else + .incbin "baserom.gba", 0x126CE0, 0x0000004 +.endif .4byte gUnk_081262B8 .incbin "baserom.gba", 0x126CE8, 0x0000004 .4byte gUnk_081262D0 diff --git a/tools/scaninc/scaninc.cpp b/tools/scaninc/scaninc.cpp index b95cbd03..4c4a5cc9 100755 --- a/tools/scaninc/scaninc.cpp +++ b/tools/scaninc/scaninc.cpp @@ -93,7 +93,10 @@ int main(int argc, char **argv) includeDirs.push_back(file.GetSrcDir()); for (auto incbin : file.GetIncbins()) { - dependencies.insert(incbin); + // Don't include incbins starting with baserom, as they might not be necessary if another variant is being built. + if (incbin.rfind("baserom", 0) != 0) { + dependencies.insert(incbin); + } } for (auto include : file.GetIncludes()) {