mirror of
https://github.com/gbdev/rgbds.git
synced 2026-09-02 20:08:39 +00:00
Avoid overflow for very large ROMs (e.g. TPP1)
This commit is contained in:
+2
-2
@@ -529,11 +529,11 @@ static void writeMapSummary() {
|
|||||||
|
|
||||||
fprintf(
|
fprintf(
|
||||||
mapFile,
|
mapFile,
|
||||||
"\t%s: %" PRIu32 " byte%s used / %" PRIu32 " free",
|
"\t%s: %" PRIu32 " byte%s used / %zu free",
|
||||||
sectionTypeInfo[type].name.c_str(),
|
sectionTypeInfo[type].name.c_str(),
|
||||||
usedTotal,
|
usedTotal,
|
||||||
usedTotal == 1 ? "" : "s",
|
usedTotal == 1 ? "" : "s",
|
||||||
nbBanks * sectionTypeInfo[type].size - usedTotal
|
static_cast<size_t>(nbBanks) * sectionTypeInfo[type].size - usedTotal
|
||||||
);
|
);
|
||||||
if (sectionTypeInfo[type].firstBank != sectionTypeInfo[type].lastBank || nbBanks > 1) {
|
if (sectionTypeInfo[type].firstBank != sectionTypeInfo[type].lastBank || nbBanks > 1) {
|
||||||
fprintf(mapFile, " in %u bank%s", nbBanks, nbBanks == 1 ? "" : "s");
|
fprintf(mapFile, " in %u bank%s", nbBanks, nbBanks == 1 ? "" : "s");
|
||||||
|
|||||||
Reference in New Issue
Block a user