When building with -g MAP, a file called s2.map is generated (for S2 hacks). You open it in a text editor and search for the addresses mentioned in the error screen; the map file will give you the line in s2.asm corresponding to the address in question.

Why do people have so much trouble with odd address errors? The "fix" is simple - find every place you have byte data (actual bytes or strings or byte arrays), and then ALWAYS follow the last one with an "even" directive. PROBLEM SOLVED.

"But it's always an even number of bytes! I don't NEED to put an 'even' after it!!"

Why do people have so much trouble with odd address errors? The "fix" is simple - find every place you have byte data (actual bytes or strings or byte arrays), and then ALWAYS follow the last one with an "even" directive. PROBLEM SOLVED.

This is more-or-less what I have been doing myself. But I still get the (increasingly less frequent) address error for other causes -- for example, the case I mentioned where an object calling DisplaySprite first and then calling DeleteObject afterwards due to its logic. Interestingly, I find that this is usually an S1 object.

When building with -g MAP, a file called s2.map is generated (for S2 hacks). You open it in a text editor and search for the addresses mentioned in the error screen; the map file will give you the line in s2.asm corresponding to the address in question.

I put "build -g MAP", then triggered the error, but no s2.map (or s2built.map) was created.

Chilly Willy, on 18 February 2012 - 08:23 PM, said:

Why do people have so much trouble with odd address errors? The "fix" is simple - find every place you have byte data (actual bytes or strings or byte arrays), and then ALWAYS follow the last one with an "even" directive. PROBLEM SOLVED.

"But it's always an even number of bytes! I don't NEED to put an 'even' after it!!"

DO IT ANYWAY!!

I know you're meant to put it after all bytes like dc.b's and etc, but does that include all BINCLUDES and INCLUDES? Like:

Alright. I have added this to my hack, because I think it will be vital for me to have this in the future. But I have no address errors currently, what would be a simple way to test this? (IE: cause an address error on purpose)

Second question. There are a lot of align commands. Mainly "align 4" Then there's a few "align 100" and "align 200" and with Sonic and Tails, etc, "align $20000". Should these be replaced with even or should be left alone?