From 549be2092822c85f20410f20532ac613bde43e73 Mon Sep 17 00:00:00 2001 From: Aetias Date: Sun, 15 Oct 2023 16:58:41 +0200 Subject: [PATCH] Write ROM capacity in header --- tools/rom/build.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/rom/build.c b/tools/rom/build.c index 4bf7e410..4f13a146 100644 --- a/tools/rom/build.c +++ b/tools/rom/build.c @@ -577,7 +577,8 @@ int main(int argc, const char **argv) { return 1; } - size_t romEnd = 1 << (32 - __builtin_clz(address)); + header.capacity = 15 - __builtin_clz(address); + size_t romEnd = 1 << (17 + header.capacity); if (!Align(romEnd, fpRom, &address)) return 1; fseek(fpRom, 0, SEEK_SET);