Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)
You are not logged in.
I'm trying to keep the game I'm working on under 32KB so I can use the simplest possible cartridge for it. Right now, the compiler spits out a 32KB .gb ROM file no matter what, telling me that a portion of the ROM file is just blank data.
I don't know what my compiler will do if the game exceeds that. Will it jump to the next standard ROM file size? Or will it give me an error until I tell it to compile a larger ROM?
For now, I just need to know if there is a way to see how much of that 32KB is actually in use so I know how much more I can add to the game.
Offline
Ardis wrote:
I don't know what my compiler will do if the game exceeds that. Will it jump to the next standard ROM file size? Or will it give me an error until I tell it to compile a larger ROM?
You will get an error message until you tell the compiler to compile a larger ROM.
Ardis wrote:
For now, I just need to know if there is a way to see how much of that 32KB is actually in use so I know how much more I can add to the game.
Take a look here: http://gbdev.gg8.se/forums/viewtopic.php?pid=2470#p2470
Offline
Also, if you are using ZGB on Linux then this post has a shell script for generating a report of space used
https://gbdev.gg8.se/forums/viewtopic.p … 3585#p3585
If you are using GBDK directly, then you can look at the .map and .lst files. The .map file gives you listing of where the linker placed everything. The .lst files give you a per-source file listing along with a summary at the bottom- check the "Area Table".
Not a 100% sure this works, but here is a modified version of the script linked above for regular GBDK output (just changing .sym to .lst in the regex). Still requires datamash if you want the tabulated output.
#!/bin/bash # find all the data allocation rows in the linker symbol output # dump them into a csv -> datamash -> table output rm linker_summary.csv echo "File,Seg,Size" > linker_summary.csv; grep -R "flags" * | grep ".lst" | perl -pe 's/(.*)\.lst\:\s*\d+\s_([0-9A-Z_]*)\s*size\s*([0-9A-F]*)\s*flags.*/ /; print $1 . "," . $2 . "," . hex($3) . ","' >> linker_summary.csv datamash --headers --field-separator=, --no-strict --ignore-case --narm --sort --group 2 sum 3 < linker_summary.csv
Offline