Procházet zdrojové kódy

Fix alignment in disassembler-generated .rom_size directive.

master
Ben Kurtovic před 8 roky
rodič
revize
c53de6f4c5
1 změnil soubory, kde provedl 9 přidání a 4 odebrání
  1. +9
    -4
      src/disassembler.c

+ 9
- 4
src/disassembler.c Zobrazit soubor

@@ -166,20 +166,25 @@ static char* size_to_string(char *output, size_t size)
static void disassemble_header(Disassembly *dis, const ROM *rom)
{
char buf[64];
const char *size, *product, *region;

DEBUG("Disassembling header")
size = size_to_string(buf, rom->size);
product = rom_product(rom);
region = rom_region(rom);

WRITE_LINE(dis, ".rom_size\t\"%s\"\t\t; $%zX bytes in %zu banks",
size_to_string(buf, rom->size), rom->size, NUM_BANKS(rom)) // TODO: fix alignment
WRITE_LINE(dis, ".rom_size\t\"%s\"%s\t; $%zX bytes in %zu banks",
size, strlen(size) < 6 ? "\t" : "", rom->size, NUM_BANKS(rom))
WRITE_LINE(dis, ".rom_header\t$%04X",
rom->header_location)
WRITE_LINE(dis, ".rom_checksum\t%s",
(rom->reported_checksum == rom->expected_checksum) ? "on" : "off")
WRITE_LINE(dis, ".rom_product\t%u\t\t; %s",
rom->product_code, rom_product(rom) ? rom_product(rom) : "(unknown)")
rom->product_code, product ? product : "(unknown)")
WRITE_LINE(dis, ".rom_version\t%u",
rom->version)
WRITE_LINE(dis, ".rom_region\t%u\t\t; %s",
rom->region_code, rom_region(rom) ? rom_region(rom) : "(unknown)")
rom->region_code, region ? region : "(unknown)")
WRITE_LINE(dis, ".rom_declsize\t$%X\t\t; %s",
rom->declared_size,
size_to_string(buf, size_code_to_bytes(rom->declared_size)))


Načítá se…
Zrušit
Uložit