sonicretro / s1disasm

Sonic 1 Disassembly
335 stars 97 forks source link

"align" macro can perform unintended/unnecessary padding if data is already aligned #29

Closed ghost closed 3 years ago

ghost commented 4 years ago

With the way the macro is set up, let's say you do an "align 2" at an even address. Instead of ignoring it, it will pad an extra 2 bytes. Of course, the larger the alignment value, the larger the unnecessary padding (yes, I know with larger values, it ends up being a rarer occurrence, but still).

Using "(\1-(*%\1))%\1" should prevent this.