mirror of
https://github.com/bradgrantham/apple2a.git
synced 2024-11-23 07:34:23 +00:00
AWK script to dump ROM size info.
This commit is contained in:
parent
1fb7e76f3f
commit
0254577c96
1
Makefile
1
Makefile
@ -19,6 +19,7 @@ run: $(ROM)
|
||||
|
||||
a.out: main.o interrupt.o vectors.o platform.o apple2rom.cfg $(LIB)
|
||||
$(CC65)/ld65 -C apple2rom.cfg -m main.map --dbgfile main.dbg interrupt.o vectors.o platform.o main.o $(LIB)
|
||||
awk -f rom_usage.awk < main.map
|
||||
|
||||
clean:
|
||||
rm -f *.o *.lst a.out platform.s main.s $(LIB) tmp.lib
|
||||
|
14
rom_usage.awk
Normal file
14
rom_usage.awk
Normal file
@ -0,0 +1,14 @@
|
||||
# Pipe main.map into this to get ROM size info.
|
||||
|
||||
/^CODE/ { code_start = ("0x" $2) + 0 }
|
||||
|
||||
/^RODATA/ { rodata_end = ("0x" $3) + 0 }
|
||||
|
||||
/^VECTORS/ { vectors_start = ("0x" $2) + 0 }
|
||||
|
||||
END {
|
||||
code = rodata_end - code_start + 1
|
||||
all = vectors_start - code_start
|
||||
printf "%d of %d ROM bytes (%d%%) used\n", code, all, code*100/all
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user