pret / pokeemerald

Decompilation of Pokémon Emerald

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Game stops producing sound after declaring a static char array

MysticalDragon98 opened this issue · comments

After declaring a static char array in unlimited.h (A new file created by me) with the following code:

static char url[HTTP_MAX_URL_SIZE];

where HTTP_MAX_URL_SIZE = 512, the app stops producing sound. I haven't even used the variable, just declaring it causes the issue.

Expected behavior:

The app should work as before, including producing sound.

Actual behavior:

The app stops producing sound after the addition of the static char array.

Additional context:

  • I am not using the variable url, just declaring it in the header file.
  • It appears to be overlapping with the sound memory addresses, and i dont know how to make it use another memory space

This is not really an issue with the project. You probably just ran into a Stack Overflow. Keep in mind that the console has 2 regions of working memory "RAM", the internal one on the CPU which is only 32K, and the external RAM chip which is 256k.

Both are not really big, but you declared your array s.t. it will land in the internal region. Consider the following:

EWRAM_DATA static char url[HTTP_MAX_URL_SIZE] = {0};

As I said this is also not an issue with the project. If you want to discuss things like that you may want to join the pret Discord server (or a romhacking community)