RPGHacker / asar

(Now) official repository of the SNES assembler Asar, originally created by Alcaro
Other
204 stars 44 forks source link

"check bankcross off" breaks "freedata" on fullsa1rom #289

Closed spooonsss closed 10 months ago

spooonsss commented 1 year ago

asar cb78f31f8

$ cat >sa1_freespace.asm  <<'EOF'
fullsa1rom

print pc

check bankcross off
pushpc
freedata
data:
print pc
db $12, $34, $56, $55, $55, $55, $55, $55, $55, $55, $55, $55, $55, $55, $55, $55, $55, $55, $55, $55, $55
print pc

pullpc

print pc

EOF
$ cp SMW.smc test.smc
$ dd if=/dev/zero of=test.smc oflag=append conv=notrunc bs=524288 count=15
15+0 records in
15+0 records out
7864320 bytes (7.9 MB, 7.5 MiB) copied, 0.0050462 s, 1.6 GB/s
$ asar  sa1_freespace.asm test.smc
FFFFFF
sa1_freespace.asm:7: warning: (Wfreespace_leaked): This freespace appears to be
leaked. [freedata]
009234
008014
FFFFFF
$ hexdump  -C test.smc |  grep "34 56 55"
00000200  34 56 55 55 55 55 55 55  55 55 55 55 55 55 55 55  |4VUUUUUUUUUUUUUU|

Removing check bankcross off produces reasonable results.