comparison tools/objlink.c @ 2557:23ca671ee1cd

Adjust block description cosmetics.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 27 Feb 2022 16:43:24 +0200
parents 12ea1ea93522
children 1bfa05ccc88d
comparison
equal deleted inserted replaced
2556:12ea1ea93522 2557:23ca671ee1cd
744 /* Print out an ASCII presentation of memory map 744 /* Print out an ASCII presentation of memory map
745 */ 745 */
746 void memPrintLine(FILE *f) 746 void memPrintLine(FILE *f)
747 { 747 {
748 fprintf(f, 748 fprintf(f,
749 " +------------------------------------------+\n"); 749 " +----------------------------------------------------+\n");
750 } 750 }
751 751
752 void memPrintEmpty(FILE *f, int n) 752 void memPrintEmpty(FILE *f, int n)
753 { 753 {
754 for (int i = 0; i < n; i++) 754 for (int i = 0; i < n; i++)
755 fprintf(f, 755 fprintf(f,
756 " | |\n"); 756 " | |\n");
757 } 757 }
758 758
759 void dmDescribeMemory(FILE *f) 759 void dmDescribeMemory(FILE *f)
760 { 760 {
761 DMMemBlock *prev = NULL; 761 DMMemBlock *prev = NULL;
779 kz = siz / (1024 * 2); 779 kz = siz / (1024 * 2);
780 780
781 if (kz > 1) memPrintEmpty(f, kz); 781 if (kz > 1) memPrintEmpty(f, kz);
782 782
783 snprintf(desc, sizeof(desc), "EMPTY (%d)", siz); 783 snprintf(desc, sizeof(desc), "EMPTY (%d)", siz);
784 fprintf(f, "$%.4x - $%.4x | %-40s |\n", prev->end + 1, curr->start - 1, desc); 784 fprintf(f, "$%.4x - $%.4x | %-50s |\n", prev->end + 1, curr->start - 1, desc);
785 785
786 if (kz > 1) memPrintEmpty(f, kz); 786 if (kz > 1) memPrintEmpty(f, kz);
787 memPrintLine(f); 787 memPrintLine(f);
788 } 788 }
789 prev = curr; 789 prev = curr;
801 801
802 siz = curr->end - curr->start + 1; 802 siz = curr->end - curr->start + 1;
803 kz = siz / (1024 * 2); 803 kz = siz / (1024 * 2);
804 804
805 if (kz > 1) memPrintEmpty(f, kz); 805 if (kz > 1) memPrintEmpty(f, kz);
806 snprintf(desc, sizeof(desc), "%s (%s, %d)", curr->name, s, siz); 806 snprintf(desc, sizeof(desc), "%.40s (%s, %d)", curr->name, s, siz);
807 fprintf(f, "$%.4x - $%.4x | %-40s |\n", curr->start, curr->end, desc); 807 fprintf(f, "$%.4x - $%.4x | %-50s |\n", curr->start, curr->end, desc);
808 if (kz > 1) memPrintEmpty(f, kz); 808 if (kz > 1) memPrintEmpty(f, kz);
809 memPrintLine(f); 809 memPrintLine(f);
810 810
811 } 811 }
812 } 812 }