• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • 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.

[Audio✓] Seamless Transition of Day/Night Music on Maps?

Hey all, I'm trying to make it so that songs on maps change based on day/night/etc. in Emerald. Now doing this is normally rather easy, if you don't mind the alternate song(s) restarting every time you enter another sub-map. For example, if I put a night-time theme in Littleroot Town, the song will restart from the beginning when entering a house (assuming that the same method was applied to both maps). Here's an example of a level-script that carries that side effect:
Code:
#freespace 0xFF
#dynamic 0x9C0B20

#org @start
comparefarbytetobyte 0x203C000 0x5
if 0x1 goto @evening
end

#org @evening
playsong2 0x15E
end
Does anyone here happen to know a specific way to put this feature in properly? As in, I go to another map within the same area and it doesn't interrupt the alternate song that is playing. It sort of ruins the ambience when this happens. Any help would be hugely appreciated, as I cannot seem to find any info on this topic by searching anywhere. The only solution I can think of at the moment is to have some sort of ASM routine change all instances of a certain song(s) to another when 0x203C000 is set to 05 (for example). Thing is, I'm clueless when it comes to ASM, and it probably doesn't even work the way I'm describing.
 
Last edited:
This is untested, but I was looking for this feature before and Skeli gave me a routine. I never used it.
Spoiler:
Insertion instructions found here: https://www.pokecommunity.com/threads/350814
Thanks a ton Petuuuhhh, this looks to be exactly what I was going for.

I see it is for FireRed based on the RAM Table offset, though I did find the Emerald offset at the link you provided (it's 0x086B49C0). The "normaltable" and "nighttable" offsets I should apparently change to 0x08XXXXXX, as it appears to be set up for an expanded ROM based on the 9s. Also the "0x9161E80" looks like it may be a leftover offset. I'm assuming it should be changed to 0x086B49F0, which according to Sappy is Emerald's song table? It might even be 0x086B54E0, based on the first index entry.

One last thing I noticed, the source didn't show how the new table is supposed to be structured, so it is unclear what parameters are needed. My guess is that it should be an exact copy of the normal table but with the 'night' songs switched into place of the normal ones. Do you know the proper structure by any chance?

EDIT: Ah, I found something that may also be useful here, but I'll have to test this later as I need sleep at the moment. Apparently the new song table may have to look like this: https://www.pokecommunity.com/posts/8081693/ Nevermind, found out that simply copying the original table works just fine.

EDIT 2: Alright, I can confirm that it is working. For anyone wondering how to do it, the songtable offset needed is exactly the one shown in Sappy, which is offset 0x6B49F0 in Emerald. What I did was copy the song table in a hex editor from that offset to 0x6B5B67 (the end of the Teachy TV song pointer). I pasted the table copy to free space, and changed the pointers to the 'day' songs in the table copy to the pointers that lead to the 'night' songs. Then I followed the insertion instructions for Emerald in the source that Petuuuhhh linked. However, do note that the time frames in the routine (the 8PM-12AM, etc) you may want to change to your liking by changing the byte value associated with each one.

Hopefully this helps anyone else trying to do the same thing.
Petuuuhhh, you and Skeli will now be added to the credits list upon the next release of CosmicEmerald.
 
Last edited:
Back
Top