• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

How to prevent Emerald sound corruption

1,323
Posts
16
Years
  • Seen Dec 9, 2023
There's a problem that I've noticed with every single Emerald hack on PokeCommunity, including my own. It's when some notes in the BGM get corrupted so that they sound like they get replaced with 8-bit sounding beeeeeeeeps. Replacing/Inserting a new voicegroup does not fix this. Importing tracks from a clean Emerald rom does not fix this either.

What causes the sound corruption is when we repoint things to things that aren't actually free space. Even though Emerald supposedly uses 00 bytes as free space, I disagree with that. See all those FF bytes starting at 0xE3CF64? From there until the end of the rom, I think is Emerald's true free space. After all, all the other GBA games use FF bytes, so I think it's just a misconception that Emerald uses 00 bytes.

Unfortunately, once you get it, there is no way of fixing it. HOWEVER, if you plan on doing an Emerald hack, it's fully possible to prevent it. Here's what you need to do:

1. Open up your AdvanceMap folder
2. Open up the ini folder
3. Click on "AdvanceMap"
4. Scroll down to where it says "[Version:BPE]"
5. Change "SuchByte=$00" into "SuchByte=$FF"
6. Change "SuchBeginn=$6B0000" into "SuchBeginn=$E3CF64"

Now you can safely do whatever you want in Emerald on AdvanceMap, without worrying about the sound corruption. If you open up an Emerald rom in a hex editor and go to 0xE3CF64, you'll notice that from here on until the end of the rom is FF bytes, and unfortunately, there's not much space left. So I recommend expanding the rom to 32mb using XSE, and make sure you fill with FF bytes.

Other tips:
*When repointing something in unLZ, make sure you repoint it to an offset higher than 0xE3CF64

Credits:
*Me - obviously lol
*giradialkia - for helping me with some stuff
*HackMew - for making me feel stupid because I never realized that maybe most Emerald hackers suck at repointing and don't know what free space is

If you guys don't know what the sound corruption is, then I recommend trying out Pokemon CrystalShards. That hack is, hands down, the worst form of it I have ever seen (heard). It's pretty obvious in that hack.


EDIT:

For smart people that know what they're doing: Basically, to avoid sound corruption, make sure you don't insert anything that's before 0xE3CF64. Every piece of data you insert should be after 0xE3CF64.
 
Last edited:
1,770
Posts
15
Years
Lol, I knew it was only a matter of hours before you'd post one of these. But, it will be handy. There are more and more Emerald hacks nowadays, and they'll all be more enjoyable with proper sound. (though this probably means lots of people will have to start again, if they've already got corruption and... Absolutely do not want it).
 

Flandre Scarlet

Free your mind.
356
Posts
16
Years
Thank you so very much for writing this tutorial. I've been wondering why my sound has been corrupted! But, I have a question, if you do this tutorial while doing a ROM hack, will the sound become un-corrupted (o.o)? Or do I have to start again?

Again, thanks.
 
1,770
Posts
15
Years
Thanks for posting this! I was going to do an emerald hack and I can stop sound corruption now! ^_^

Thank you so very much for writing this tutorial. I've been wondering why my sound has been corrupted! But, I have a question, if you do this tutorial while doing a ROM hack, will the sound become un-corrupted (o.o)? Or do I have to start again?

Again, thanks.

I'm afraid you'll have to start again- there's no way to fix it once it's occured. Although, you can now prevent it from happening at all, so restarting... Although tedious, it's the way to go.
 
1,323
Posts
16
Years
  • Seen Dec 9, 2023
Thank you so very much for writing this tutorial. I've been wondering why my sound has been corrupted! But, I have a question, if you do this tutorial while doing a ROM hack, will the sound become un-corrupted (o.o)? Or do I have to start again?

Again, thanks.
As giradialkia mentioned, you're gonna have to restart your hack. What happens with the default AdvanceMap ini is that it repoints to around the 0x600000 area, where all the sound stuff is. If you try to fix it with out restarting, chances are, you're gonna end up corrupting all your maps and such.

So er... yeah. You have to restart. Good luck, since that's what I'm doing too.
 
1,770
Posts
15
Years
As giradialkia mentioned, you're gonna have to restart your hack. What happens with the default AdvanceMap ini is that it repoints to around the 0x600000 area, where all the sound stuff is. If you try to fix it with out restarting, chances are, you're gonna end up corrupting all your maps and such.

So er... yeah. You have to restart. Good luck, since that's what I'm doing too.

As do I. Other Emerald hackers probably should too, depending on how bad the corruption is (although even minimal sound corruption is annoying). There'd certainly be complaints about it, anyway.
I think this should be stickied. It's the one thing people really should know before starting an Emerald hack- that was like the only thing separating Emerald from the other ROMs that're normally hacked, pretty much, so.. Yeah. IMO.
 

Sierraffinity

Desperately trying to retire from ROM hacking
1,069
Posts
16
Years
You could probably make a backup of your sound-corrupted Emerald ROM, and then open it in a hex editor. Then, copy all of the bytes from an original Emerald ROM that were replaced in your hack (most of it was probably 00s, anyways) and save. Then, open your ROM in A-Map, see what's corrupted, and copy THAT data from your backup to your new ROM, and repoint. Voila.

It may be tedious (especially for long-ago started hacks), but it could be done.
 
1,323
Posts
16
Years
  • Seen Dec 9, 2023
You could probably make a backup of your sound-corrupted Emerald ROM, and then open it in a hex editor. Then, copy all of the bytes from an original Emerald ROM that were replaced in your hack (most of it was probably 00s, anyways) and save. Then, open your ROM in A-Map, see what's corrupted, and copy THAT data from your backup to your new ROM, and repoint. Voila.

It may be tedious (especially for long-ago started hacks), but it could be done.
Doing that will most likely corrupt all your maps and scripts, since that's what causes the corruption in the first place. AdvanceMap repoints data to where the sound is, and if you try to "fix" the sound then everything that was repointed there would just get messed up.
 

Sierraffinity

Desperately trying to retire from ROM hacking
1,069
Posts
16
Years
Doing that will most likely corrupt all your maps and scripts, since that's what causes the corruption in the first place. AdvanceMap repoints data to where the sound is, and if you try to "fix" the sound then everything that was repointed there would just get messed up.
That's why I said to find what got deleted after the fix, and repoint it to actual free space, suing the bytes from your old ROM.
 
6
Posts
14
Years
Just wants to thank so very much for the tutorial it sure helped me :) I made some progress in the hack but then i got the beeps I followed your tutorial and i downloaded an new version of Emerald and I remade all the maps that i lost and it just works excellent now thank you! , Thanks so much for your tutorial!

Also Sorry if i am reviving an old thread but this sure helped me alot! :D (Y)
 
1,323
Posts
16
Years
  • Seen Dec 9, 2023
Something else:
When scripting in XSE, you need to add "#freespace 0xFF" before the "#dynamic", or else it will write to the 00s.
Wow, even I didn't know that. Thanks! Cuz I made a patch for Emerald that blanks out most scripts just for free space, and I blanked it using 00 bytes just so XSE will work properly.
 
25
Posts
14
Years
  • Seen Jan 25, 2015
Man, I made a lot of Store, Starter, Trainer, Map, Event, etc. changes that took a long time without knowing this. I just can't start over.

It only has effected the battle sounds. I hope in the future there is a way to fix this. I never noticed It in my previous hack, only this one.
 

linkandzelda

Ex-rom hacker turned indie game developer
777
Posts
17
Years
I was doing some research and I belive that the bytes from 0x9C2000 onwards are safe to use even though they are 00s. The problem with advance map is that its set to search for free space from 0x6B0000 which is NOT free space.
 

Orinjmate

The Orinj of the Mate
120
Posts
13
Years
Is it obvious to tell if the sound glitch is there? Cause I have compiled a few scripts over offsets below 0x9C2000 but I can't tell the difference if it is there. (I tried the wild pokemon battle music). Also what other consequences can there be from compiling scripts on to offsets that aren't free space?
 

linkandzelda

Ex-rom hacker turned indie game developer
777
Posts
17
Years
Theres lots of consequences becuase:

1. the game uses that data for SOMETHING that we either know or dont know and..
2. the game needs all its data untact, unless we know 100% what it is and can remove/modify it.

For me, i didnt notice it happened as it was like 12 bytes that got overwrited. instrument data is mainly in that area and possibly anything else such as music data or map data and infact a lot more data probably.
 

Orinjmate

The Orinj of the Mate
120
Posts
13
Years
Theres lots of consequences becuase:

1. the game uses that data for SOMETHING that we either know or dont know and..
2. the game needs all its data untact, unless we know 100% what it is and can remove/modify it.

For me, i didnt notice it happened as it was like 12 bytes that got overwrited. instrument data is mainly in that area and possibly anything else such as music data or map data and infact a lot more data probably.
Okay so should I bother spending a couple of hours re-inserting everything or just leave it as currently there is no sound corruption. Also those offsets actually came out of A-map free space finder; only before i modified the ini to what you said earlier in the thread.
 

linkandzelda

Ex-rom hacker turned indie game developer
777
Posts
17
Years
I would personaly reccommmend, if you were using AM from its old search 0x6B0000 then ti will of found bad offsets in the past... so if you want to be 100% sure nothing is damaged then its probably the best to start over.. But its your call.

Link
 

Platinum Lucario

The Legendary Master of [color=#D8D48C]Light[/colo
1,607
Posts
16
Years
I just wonder to myself who would ever think that "00" was free space on the ROM (did LU-OH think that)? Because... I always knew... "FF" meant that it was free space... in other words... it's just a white area. lol

Example:
00 - blank (the null of the ROM data... as in it's just... black)

FF - nothing (whiteness)


Oh and by the way... thank you so much for the tutorial, I'm sure this will help me with my hacks... if I ever make a ROM Hack of Pokémon Emerald. :)

Because I will be creating a hack a pretty soon... once I get my new laptop back next week. It will be called "Pokémon: Dimentions of Time", which will indeed be a hack of Pokémon Emerald. I hope to learn more about hex editing... and of course... ASM editing sooner or later.
 
Back
Top