mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Refactor how map file sections are printed
This makes size-0 sections print as "($0000 bytes)" instead of "(0 bytes)", which is more consistent.
This commit is contained in:
@@ -452,17 +452,10 @@ static void writeMapBank(SortedSections const §List, SectionType type, uint3
|
|||||||
|
|
||||||
prevEndAddr = sect->org + sect->size;
|
prevEndAddr = sect->org + sect->size;
|
||||||
|
|
||||||
|
fprintf(mapFile, "\tSECTION: $%04" PRIx16, sect->org);
|
||||||
if (sect->size != 0)
|
if (sect->size != 0)
|
||||||
fprintf(
|
fprintf(mapFile, "-$%04x", prevEndAddr - 1);
|
||||||
mapFile,
|
fprintf(mapFile, " ($%04" PRIx16 " byte%s) [\"", sect->size, sect->size == 1 ? "" : "s");
|
||||||
"\tSECTION: $%04" PRIx16 "-$%04x ($%04" PRIx16 " byte%s) [\"",
|
|
||||||
sect->org,
|
|
||||||
prevEndAddr - 1,
|
|
||||||
sect->size,
|
|
||||||
sect->size == 1 ? "" : "s"
|
|
||||||
);
|
|
||||||
else
|
|
||||||
fprintf(mapFile, "\tSECTION: $%04" PRIx16 " (0 bytes) [\"", sect->org);
|
|
||||||
printSectionName(sect->name, mapFile);
|
printSectionName(sect->name, mapFile);
|
||||||
fputs("\"]\n", mapFile);
|
fputs("\"]\n", mapFile);
|
||||||
|
|
||||||
|
|||||||
@@ -25,3 +25,5 @@ wLabel1:: ds 6
|
|||||||
SECTION "hram", HRAM
|
SECTION "hram", HRAM
|
||||||
hLabel:: ds 7
|
hLabel:: ds 7
|
||||||
.local::
|
.local::
|
||||||
|
|
||||||
|
SECTION "\n\r\t\"\\", ROM0[1]
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ ROM0 bank #0:
|
|||||||
SECTION: $0000-$0000 ($0001 byte) ["rom0"]
|
SECTION: $0000-$0000 ($0001 byte) ["rom0"]
|
||||||
$0000 = Label0
|
$0000 = Label0
|
||||||
$0001 = Label0.local
|
$0001 = Label0.local
|
||||||
|
SECTION: $0001 ($0000 bytes) ["\n\r\t\"\\"]
|
||||||
EMPTY: $0001-$3fff ($3fff bytes)
|
EMPTY: $0001-$3fff ($3fff bytes)
|
||||||
TOTAL EMPTY: $3fff bytes
|
TOTAL EMPTY: $3fff bytes
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user