rgbds icon indicating copy to clipboard operation
rgbds copied to clipboard

Two proposals for .map files

Open Rangi42 opened this issue 3 years ago • 11 comments

  1. Have a flag to omit outputting individual symbol names. This information is already available in the .sym file, and leaving it out would make it easier to see the section placements.
  2. Have a flag to output distinct chunks of slack space, instead of the total per bank. For example, compare this:
SRAM bank #0:
  SECTION: $a000-$a55b ($055c bytes) ["PokeDB bank 1B"]
  SECTION: $a55c-$a5c7 ($006c bytes) ["Link Battle Data"]
  SECTION: $a5c8-$a5e8 ($0021 bytes) ["SRAM Battle Tower"]
  SECTION: $a600-$abe1 ($05e2 bytes) ["SRAM Mail"]
  SECTION: $abe2-$abf0 ($000f bytes) ["SRAM Bank 0"]
  SECTION: $abf1-$b14c ($055c bytes) ["PokeDB bank 2B"]
  SECTION: $b200-$bf0f ($0d10 bytes) ["Backup Save"]
    SLACK: $01ba bytes

with this:

SRAM bank #0:
  SECTION: $a000-$a55b ($055c bytes) ["PokeDB bank 1B"]
  SECTION: $a55c-$a5c7 ($006c bytes) ["Link Battle Data"]
  SECTION: $a5c8-$a5e8 ($0021 bytes) ["SRAM Battle Tower"]
    SLACK: $0017 bytes
  SECTION: $a600-$abe1 ($05e2 bytes) ["SRAM Mail"]
  SECTION: $abe2-$abf0 ($000f bytes) ["SRAM Bank 0"]
  SECTION: $abf1-$b14c ($055c bytes) ["PokeDB bank 2B"]
    SLACK: $00b3 bytes
  SECTION: $b200-$bf0f ($0d10 bytes) ["Backup Save"]
    SLACK: $00f0 bytes

Rangi42 avatar Feb 28 '22 22:02 Rangi42

For slack vs. gaps, why not combine both?

SRAM bank #0:
  SECTION: $a000-$a55b ($055c bytes) ["PokeDB bank 1B"]
  SECTION: $a55c-$a5c7 ($006c bytes) ["Link Battle Data"]
  SECTION: $a5c8-$a5e8 ($0021 bytes) ["SRAM Battle Tower"]
    EMPTY: $a5e9-$a5ff ($0017 bytes)
  SECTION: $a600-$abe1 ($05e2 bytes) ["SRAM Mail"]
  SECTION: $abe2-$abf0 ($000f bytes) ["SRAM Bank 0"]
  SECTION: $abf1-$b14c ($055c bytes) ["PokeDB bank 2B"]
    EMPTY: $b14d-$b1ff ($00b3 bytes)
  SECTION: $b200-$bf0f ($0d10 bytes) ["Backup Save"]
    EMPTY: $b210-$bfff ($00f0 bytes)
    SLACK: $01ba bytes

aaaaaa123456789 avatar Mar 01 '22 03:03 aaaaaa123456789

Bonus: with that change we can redefine the request as a single option that describes what components to output in a map file (sections, symbols, empty space, slack totals, whatever else we can come up with) that defaults to sections + symbols + slack.

aaaaaa123456789 avatar Mar 01 '22 03:03 aaaaaa123456789

As long as the individual and total unused space lines start with different text, as you did with EMPTY and SLACK, I'd be okay with that too.

Rangi42 avatar Mar 01 '22 03:03 Rangi42

How would you get empty space at the end of a bank?

ISSOtm avatar Mar 01 '22 17:03 ISSOtm

The same way we get slack space to include space at the end of a bank, just not counting any prior chunks of empty space in-between sections.

Rangi42 avatar Mar 01 '22 17:03 Rangi42

No, I mean, if slack is unused space at the end of a bank, how do you get empty space at the end of a bank? Or is it supposed to stay a total, vs. EMPTY indicating the detail?

ISSOtm avatar Mar 01 '22 17:03 ISSOtm

Right now SLACK is reported as maxsize[type] - used. Conceivably, this would track an empty total as well as used, and report SLACK as maxsize[type] - used - empty. Then EMPTY would be reported and empty would be incremented each time it advances to a next section whose start address is ahead of the previous section's end address.

Rangi42 avatar Mar 01 '22 17:03 Rangi42

What is EMPTY, though?

ISSOtm avatar Mar 01 '22 17:03 ISSOtm

EMPTY is the portion of space currently reported as SLACK which exists between SECTIONs.

SECTION "A", ROM0[$0000]
  ds $2000
SECTION "B", ROM0[$2800]
  ds $1000

There are $1000 bytes of SLACK in ROM0, with $800 of them as EMPTY between "A" and "B", and $800 at the end of the bank.

ROM0 bank #0:
  SECTION: $0000-$1fff ($2000 bytes) ["A"]
    EMPTY: $2000-$27ff ($0800 bytes)
  SECTION: $2800-$37ff ($1000 bytes) ["B"]
    EMPTY: $3800-$3fff ($0800 bytes)
    SLACK: $1000 bytes

Rangi42 avatar Mar 01 '22 17:03 Rangi42

There isn't a difference between empty space between sections or at the end, so having EMPTY be a break-down of empty space while keeping SLACK as a total is both more consistent and imo more useful.

ISSOtm avatar Mar 01 '22 17:03 ISSOtm

There isn't a difference between empty space between sections or at the end, so having EMPTY be a break-down of empty space while keeping SLACK as a total is both more consistent and imo more useful.

I think we're all agreeing on this. :)

Rangi42 avatar Mar 01 '22 17:03 Rangi42