Male
Seen 6 Days Ago
Posted January 16th, 2021
1,321 posts
13.8 Years
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.

Sole developer of STARLIGHT LEGACY intended to be released on Steam.

Discussion: https://www.pokecommunity.com/showthread.php?t=432051
Discord: https://discord.gg/fTS5Q78
Twitter: https://twitter.com/jmatz1995

giradialkia

Age 27
Male
Ireland
Seen 1 Day Ago
Posted September 1st, 2020
1,555 posts
11.9 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).

I'm working on an album of Pokémon-inspired music. Check out the Soundcloud link if you're interested!


This is my Soundcloud | | This is my bandcamp

Flandre Scarlet

Free your mind.

Age 25
Male
Australia
Seen 3 Days Ago
Posted November 18th, 2017
356 posts
13.1 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.

giradialkia

Age 27
Male
Ireland
Seen 1 Day Ago
Posted September 1st, 2020
1,555 posts
11.9 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.

I'm working on an album of Pokémon-inspired music. Check out the Soundcloud link if you're interested!


This is my Soundcloud | | This is my bandcamp
Male
Seen 6 Days Ago
Posted January 16th, 2021
1,321 posts
13.8 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.
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.

Sole developer of STARLIGHT LEGACY intended to be released on Steam.

Discussion: https://www.pokecommunity.com/showthread.php?t=432051
Discord: https://discord.gg/fTS5Q78
Twitter: https://twitter.com/jmatz1995

giradialkia

Age 27
Male
Ireland
Seen 1 Day Ago
Posted September 1st, 2020
1,555 posts
11.9 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.

I'm working on an album of Pokémon-inspired music. Check out the Soundcloud link if you're interested!


This is my Soundcloud | | This is my bandcamp

Sierraffinity

Oh god the bees

Age 24
Female
Somewhere the rains of Africa can be blessed
Seen 3 Weeks Ago
Posted January 5th, 2021
1,067 posts
13.2 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.
Restarted and revamped.

Public alpha out now!
Male
Seen 6 Days Ago
Posted January 16th, 2021
1,321 posts
13.8 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.
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.

Sole developer of STARLIGHT LEGACY intended to be released on Steam.

Discussion: https://www.pokecommunity.com/showthread.php?t=432051
Discord: https://discord.gg/fTS5Q78
Twitter: https://twitter.com/jmatz1995

Sierraffinity

Oh god the bees

Age 24
Female
Somewhere the rains of Africa can be blessed
Seen 3 Weeks Ago
Posted January 5th, 2021
1,067 posts
13.2 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.
Restarted and revamped.

Public alpha out now!
Age 26
Male
Sweden
Seen January 11th, 2011
Posted July 22nd, 2010
6 posts
11.5 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)
Male
Seen 6 Days Ago
Posted January 16th, 2021
1,321 posts
13.8 Years
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.

Sole developer of STARLIGHT LEGACY intended to be released on Steam.

Discussion: https://www.pokecommunity.com/showthread.php?t=432051
Discord: https://discord.gg/fTS5Q78
Twitter: https://twitter.com/jmatz1995

linkandzelda

n00b desu ka?

Male
Hastings, England
Seen May 21st, 2018
Posted September 15th, 2016
776 posts
14.2 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

Male
England
Seen September 13th, 2011
Posted September 1st, 2011
120 posts
10.7 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?
Currently working on a new hack named Hollow.
Pokemon Sky SD Creator

linkandzelda

n00b desu ka?

Male
Hastings, England
Seen May 21st, 2018
Posted September 15th, 2016
776 posts
14.2 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

Male
England
Seen September 13th, 2011
Posted September 1st, 2011
120 posts
10.7 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.
Currently working on a new hack named Hollow.
Pokemon Sky SD Creator

linkandzelda

n00b desu ka?

Male
Hastings, England
Seen May 21st, 2018
Posted September 15th, 2016
776 posts
14.2 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 Light!

Age 28
Male
Warrnambool, Victoria, Australia.
Seen 3 Days Ago
Posted July 8th, 2020
1,604 posts
13.2 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.
[Platinum Lucario's Signature]
If you need to disable my signature, please give me advice on how to improve the CSS-DIV code. Thank you!
All credits for the avatar since 2008 goes to shorty-antics-27 (fanart account)! Thank you! ^^
Signature Status: Strikes: 1/3 | Infractions: 0/3
It's time to change the future...
to a positive direction!
Let's prevent things from getting bad!

I'm a ROM and ISO Researcher

Current Project: Researching Pokémon Mystery Dungeon Adventure Squad games (WiiWare)

colcolstyles

Yours truly

Male
The Bay Area
Seen May 18th, 2019
Posted August 13th, 2012
1,590 posts
12.8 Years
who would ever think that "00" was free space on the ROM?
Probably the people who hacked Ruby before Fire Red and discovered that the large blocks of '0x00's were unused space. :\

Brother of Vrai

linkandzelda

n00b desu ka?

Male
Hastings, England
Seen May 21st, 2018
Posted September 15th, 2016
776 posts
14.2 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.
Lu-ho made a simple mistake. R/S have free space from 0x6B0000 (or rather 00s. At least I think so) he just guessed Emerald was the same without actully checking it. Causing overwriting of the instruments. I'm not saying that 00 is free space, but i'm saying i think from my offset its like filler data. I did relevant tests to check if the game actully uses it (filled the whole lot with random data) and it had no effect on gameplay or music.
Age 32
Male
Reno, NV
Seen June 5th, 2019
Posted June 20th, 2018
22 posts
15.8 Years
Thanks for this topic, it has been very useful, but regarding the rom expansion, I'm still getting an error saying that there's no free space left whenever I try to compile a script with XSE, though I filled the expanded rom with FF bytes. How can I solve this?
Before everything else in the script, type in:

#freespace 0xFF