I'm still (slowly) working on my SNES game project with PVSNESLib (so C code with tcc816 + Wlalink backend).
I know that this toolset has many quirks and limitations, but I've encountered a strange behavior that maybe some of you have dealed with:
Is there some kind of "limit" in the overall code size for the game? (at least for this toolset)
I'm starting to have a quite large game (about 2000 lines in C code, if you exclude comments and PVSNESlib components, in a single c file.). After adding a large function, the code randomly crashes the console. To be more specific, it seems to crash the SPC700, which crashes the console whenever it doesn't like the code or data you sent to it.
At first, I thought it was another case of the "no more than 32k of code in a single function" problem, that I've already encountered earlier in the project. So I again moved some code away from my "main" function, with various results: some time it still crashes, some time it work but the sound streaming functions have problems (sound is glitched).
However, when I comment out large chunk of code in the new functions I created (or in another function called by the main loop), it all goes back to normal.
I've tried to expand the total ROM size, to modify the bank of the sound data, etc. - nothing makes it work with all the code in .
My theory is that the total code is simply "too large" for tcc-816, and it can't process it for some reason, whether it's inside a function or not. And I guess that the code that is "left out" by the compiler, is unfortunately the "SPC driver" from the lib (SNESmod), making the SPC700 crash whenever I trigger a sound play.
Did anything similar ever happened to you?
If yes, is there some kind of workaround for this issue (splitting the code in several .c files? etc.)
Before posting here, I've also contacted Shiru, who has a lot of experience with this toolset. He thinks that there isn't any "total code limit", but that it's related to the lack of reliance of the tools (code can't stop working due to a misalignement of compiled code).
EDIT: this is issue is solved (look at the last post) - it was a bug when the code of the SNESmod lib isn't stored in bank 0.
I know that this toolset has many quirks and limitations, but I've encountered a strange behavior that maybe some of you have dealed with:
Is there some kind of "limit" in the overall code size for the game? (at least for this toolset)
I'm starting to have a quite large game (about 2000 lines in C code, if you exclude comments and PVSNESlib components, in a single c file.). After adding a large function, the code randomly crashes the console. To be more specific, it seems to crash the SPC700, which crashes the console whenever it doesn't like the code or data you sent to it.
At first, I thought it was another case of the "no more than 32k of code in a single function" problem, that I've already encountered earlier in the project. So I again moved some code away from my "main" function, with various results: some time it still crashes, some time it work but the sound streaming functions have problems (sound is glitched).
However, when I comment out large chunk of code in the new functions I created (or in another function called by the main loop), it all goes back to normal.
I've tried to expand the total ROM size, to modify the bank of the sound data, etc. - nothing makes it work with all the code in .
My theory is that the total code is simply "too large" for tcc-816, and it can't process it for some reason, whether it's inside a function or not. And I guess that the code that is "left out" by the compiler, is unfortunately the "SPC driver" from the lib (SNESmod), making the SPC700 crash whenever I trigger a sound play.
Did anything similar ever happened to you?
If yes, is there some kind of workaround for this issue (splitting the code in several .c files? etc.)
Before posting here, I've also contacted Shiru, who has a lot of experience with this toolset. He thinks that there isn't any "total code limit", but that it's related to the lack of reliance of the tools (code can't stop working due to a misalignement of compiled code).
EDIT: this is issue is solved (look at the last post) - it was a bug when the code of the SNESmod lib isn't stored in bank 0.