A 1GB ROM does not have "more than 65536 banks"

This commit is contained in:
Rangi
2026-08-25 15:02:44 -04:00
parent a2c52caca2
commit eb2b7c1842
+2 -2
View File
@@ -251,9 +251,9 @@ static void
error("\"%s\" has more than 65536 banks", name); // LCOV_EXCL_LINE
};
static constexpr off_t NB_BANKS_LIMIT = 0x10000;
static_assert(NB_BANKS_LIMIT * BANK_SIZE <= SSIZE_MAX, "Max input file size too large for OS");
static_assert(NB_BANKS_LIMIT * BANK_SIZE < SSIZE_MAX, "Max input file size too large for OS");
if (input == output) {
if (fileSize >= NB_BANKS_LIMIT * BANK_SIZE) {
if (fileSize > NB_BANKS_LIMIT * BANK_SIZE) {
return errorTooLarge(); // LCOV_EXCL_LINE
}
// Compute number of banks and ROMX len from file size