Update for PR
Readd sprite tracker to not reuse indices check for capacity when returning pool entries Update script for printing memory map
This commit is contained in:
@@ -4,7 +4,7 @@ set -euo pipefail
|
||||
|
||||
POOL_DEF_FILE='./include/pools.def'
|
||||
ELF_FILE="${1-./build/balatro-gba.elf}"
|
||||
READELF='/opt/devkitpro/devkitARM/bin/arm-none-eabi-readelf'
|
||||
READELF="${READELF-/opt/devkitpro/devkitARM/bin/arm-none-eabi-readelf}"
|
||||
TOTAL_BYTES=0
|
||||
|
||||
if [ ! -f "$ELF_FILE" ]; then
|
||||
@@ -14,6 +14,13 @@ if [ ! -f "$ELF_FILE" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -x "$READELF" ]; then
|
||||
echo "ERROR: \"$READELF\" is not an executable file."
|
||||
echo "You can override the file location for 'arm-none-eabi-readelf' with the READELF env variable."
|
||||
echo " e.g. $ READELF=\"/my/custom/location/arm-none-eabi-readelf\" $(basename $0) <file>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
print_line_break() {
|
||||
echo "--------------------------------------------------------------------"
|
||||
}
|
||||
@@ -41,12 +48,20 @@ for name in $(get_pool_names); do
|
||||
sed -E 's@ +@ @g; s@^ @@' | \
|
||||
tr -d '\n' \
|
||||
)"
|
||||
output_bm="$( \
|
||||
"$READELF" -sW "$ELF_FILE" | \
|
||||
grep -E "${name}_bitmap_w" | \
|
||||
grep OBJECT | \
|
||||
sed -E 's@ +@ @g; s@^ @@' | \
|
||||
tr -d '\n' \
|
||||
)"
|
||||
|
||||
|
||||
address="$(cut -d ' ' -f 2 <<< $output_pool)"
|
||||
pool_size="$(cut -d ' ' -f 3 <<< $output_pool)"
|
||||
func_size="$(cut -d ' ' -f 3 <<< $output_func)"
|
||||
bm_size=16 #always gonna be 16, 4 * sizeof(u32)
|
||||
bm_size="$(cut -d ' ' -f 3 <<< $output_bm)"
|
||||
#bm_size=16 #always gonna be 16, 4 * sizeof(u32)
|
||||
|
||||
TOTAL_BYTES=$(( TOTAL_BYTES + pool_size + func_size + bm_size ))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user