Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What do MF errors regarding "assert(abs(off) < 2048);" really mean? #23

Open
supercom32 opened this issue Jan 26, 2018 · 1 comment
Open
Labels

Comments

@supercom32
Copy link
Collaborator

supercom32 commented Jan 26, 2018

When working with a large method that has many calls to other methods (with large strings as their parameters - Ie. game dialog text), I noted that at some point I got the following error:

mf: MF.cpp:918: void Output::reloc10(unsigned int, unsigned int): Assertion `abs(off) < 2048' failed.

Regardless of where in the Sub I placed my new lines, it threw that error. When I broke my Sub down into smaller Subs, then it all worked just fine. Is this because I somehow ran out of memory (stack?) for this Sub and I need to break it up? I assume so, since I can't think of any other reason. (^_^);

EDIT: I guess what I really should be doing is declaring dialog as "#Constants" instead so that everything gets stored into ROM instead?

@supercom32
Copy link
Collaborator Author

Ok, a quick update! I was able to do a test, where all my dialog was declared as Constants instead of being passed "in-line". This still resulted in the same error as above so I assume Subs do have some kind of size limit.

If I get some spare time, I'll try and see if I can get a more simple test case to produce this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant