The PokéCommunity Forums Fan Games ROM Hacking Research & Development
Research Restoring R/S/E item fanfares in FireRed

Research & Development Got a well-founded knack with ROM hacking? Love reverse-engineering the Pokémon games? Or perhaps you love your assembly language. This is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!

Thread Tools
Old December 15th, 2012 (12:40 PM).
Chaos Rush's Avatar
Chaos Rush Chaos Rush is offline
im sexy and i know it
Join Date: May 2007
Location: Taylor Swift
Gender: Male
Nature: Adamant
Posts: 1,296
In the 1st Generation Pokémon games (Red, Green, Blue, and Yellow), whenever you found an item, it plays a fanfare that is currently known as the level-up sound (in the Gen I games, it actually wasn't the level-up sound, but it became the official level-up sound in G/S/C and all later games).

Then in G/S/C and all later games (except FR/LG), there were new fanfares. The level-up sound from R/G/B/Y became the official "found-item" sound, while the found-item sound from R/G/B/Y became the level-up sound. And TM's had a completely new sound. Then in R/S/E, a new fanfare was introduced for berries, which was used again in D/P/Pt (and I think HG/SS with the berry pots, but I don't really remember. The Unova games don't have this sound)

In FireRed/LeafGreen, they made it so that it plays the level-up sound for all items to try and make it more like the Generation I games. However, all the fanfares from Ruby/Sapphire still exist in the FireRed ROM!

Here is a new item script, that is identical to the giveitem command in XSE. If you want to use R/S/E fanfares, use this script instead of the giveitem command:
#include stditems.rbh
#dynamic 0x800000 //Change this offset to whatever free space you feel like

#org @main
checkitemroom ITEM_POTION 0x1
bufferitem 0x1 ITEM_POTION
compare LASTRESULT 0x0
if 0x1 goto @Fail
pause 0xB
fanfare 0x102 //Change this value to change the fanfare that you want it to play
hidesprite 0xFFFF //Change this value to the OW number of the item in AdvanceMap
preparemsg @Msg3
additem ITEM_POTION 0x1
msgbox @Msg4 MSG_KEEPOPEN

#org @Fail
msgbox @Msg3 MSG_KEEPOPEN
msgbox @Msg2 MSG_KEEPOPEN

#org @Msg3
= [player] found one [buffer2]!

#org @Msg4
= [player] put the [buffer2] away in\nthe BAG's ITEMS POCKET.

#org @Msg2
= Too bad!\nThe BAG is full[.]
Make sure you change the FFFF in "hidesprite 0xFFFF"

Also, notice the part that says, "fanfare 0x102". Change this value to change the song:
0x100 = R/S/E Pokémon Center Healing
0x101 = Level-up
0x102 = R/S/E item sound
0x103 = R/S/E "You caught a Pokémon"
0x104 = R/S/E badge sound
0x105 = R/S/E TM sound
0x106 = R/S/E Berry sound

As I said earlier, all of the Ruby/Sapphire fanfares are already in the FireRed ROM, they're just never heard in-game. The values I posted above will play them, in all of their R/S/E glory.

Now I know that this takes up a lot more space than simply just the giveitem command, but I don't know how to modify the scripts that the command itself accesses, but I'm sure it's possible. Since the R/S/E fanfares are already in the FireRed ROM, it should be possible to change the scripts that the giveitem command accesses so that it plays the R/S/E fanfares instead of the level-up sound, but until those scripts are found, the script I posted above is identical to the giveitem command, except you get to choose which fanfare plays.

My projects:
Untitled Pokémon fangame (pictured above) | Final Fantasy II NES retranslation | Mother 1/EarthBound Beginnings Color Restoration for GBA
Non-Pokémon hacks I support:
Sonic Classic Heroes
Sonic 3 Complete
Reply With Quote

Relevant Advertising!

Old December 16th, 2012 (2:32 AM).
Jambo51's Avatar
Jambo51 Jambo51 is offline
Glory To Arstotzka
Join Date: Jun 2009
Gender: Male
Nature: Quiet
Posts: 732
Well, if FRLG are anything like Emerald in terms of how they select the fanfare to play, there will be code which checks what type of item it is (by checking what pocket in the bag it goes into) and selecting a sensible one based on that. (Reason I know this is that I actually added a new fanfare to Emerald).

However, it probably doesn't work like that given that it uses only one fanfare. I may try to add a system in the same style as Emerald that handles all of this in the background.

ETA: Emerald checks what fanfare to play and then calls a script that actually takes care of playing the fanfare, by the looks, FR acts the same way.
Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!
Reply With Quote
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -8. The time now is 11:28 AM.