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

Array Indexing Issues under P3 #73

Open
alexankitty opened this issue Apr 15, 2024 · 0 comments
Open

Array Indexing Issues under P3 #73

alexankitty opened this issue Apr 15, 2024 · 0 comments

Comments

@alexankitty
Copy link

Sorry, I know you probably don't want to hear about another array indexing issue, but it would be super nice if this actually worked.
Here's the flow code in question

int starts[14] = {6,10,9,4,4,4,3,4,4,3,5,4,4,3};
int catCount = (GET_CNT(1) - 500) / 50;
int remainder = (GET_CNT(1) - 500) % 50;
int selectedSong = 0;
for(int x = 0; x < catCount; x++){
    selectedSong += starts[x];
}
selectedSong += remainder + sebec;
FUNCTION_011C(19, selectedSong);

When compiling, the compiler throws a return address corruption.
We can get the code working right by unraveling the array indexing into a switch case, but that's a very messy way of doing it.
We've tried making the array a constant, dropping the length, removing the += short hand, and have had no luck.
Anything we can do to get it working right?

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

No branches or pull requests

1 participant