Skip to content

Instantly share code, notes, and snippets.

@willbritton
willbritton / map2csv.py
Last active February 25, 2025 14:26
Simple script for taking SDCC .map file output and compiling CSV summary of symbols and corresponding space in memory map
# Simple script for taking SDCC .map file output and compiling CSV summary of symbols and corresponding space in memory map
# Usage: reads .map file from standard input and outputs CSV format report
import fileinput
areas = {}
def get_area(name: str):
if not name in areas:
areas[name] = {
#include <stdlib.h>
#include "util.h"
inline void clear_screen(const char *with)
{
SMS_setNextTileatLoc(0);
for (int i = 0; i < 896; i++)
SMS_print(with);
}