The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > ROM Hacking > Tools, Tutorials & Resources
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

Tools, Tutorials & Resources Various tools to help you develop your hacks can be found here.
New threads in this forum are to be approved by a moderator before they are displayed.


Reply
 
Thread Tools
  #1    
Old July 2nd, 2011, 12:24 PM
ipatix's Avatar
ipatix
Music Hacking Freak
 
Join Date: May 2008
Location: Germany
Gender: Male
Nature: Relaxed
M4A build in assembler

I think everyone who already hacked music knows that the "main" tool Sappy is very buggy and some of them are really nasty.

So I thought about making my own tool and now I want to present it to you.
I think you also should know Sappy's button "Assemble song". My tool actually does exactly the same job than this function but it doesn't "destroy" your ROM and it has also compatiblity to 32MB ROMs.
*UPDATE* the tools now also deletes the old song!

This tool should work for all games that are using the M4A engine (also called sappy engine).
I already tried out Wario Land 4, Golden Sun, Kirby NID, and of course Pokemon.

So let's have a look to the GUI:


The steps how to insert a song:
1. Make sure the "MPlayDef.s" library is placed in the same folder than the program.
2. Selcect your mid2agb output (.s file) and your ROM.
3. Type in the track group. Huh, I think you even don't know what it is. Which values you have insert here depends on the game you are using and on the type of song. So if you're using Pokemon games insert "0" for normal song, "1" for a sound effect and "2" for a fanfare and "3" for sound map sound efect (like rain).
4. Type in the songpointer offset. The songpointer is an entry of the songlist and it is needed to change the songpointer that it'll point to your new song. The songpointer is calculated like this:
Code:
songpointer_offset = ( song_number * 0x8 ) + songlist_offset
I will post the songlist offsets of Pokemon games below.
5. Just type in an offset of free space (it has to be word aligned).
6. Specify your soundbank/voicegroup
7. Define the "delete byte". The tool will fill the area of the old song with this byte.
8. Than click on "build in this song" and you will finally have a new sequence build in the ROM.

Just note that there are ways to make the program crash or even the song you'll insert:
-The input file is not an mid2agb output or the song syntax is not correct.
-You don't have write access to the programs folder (it will store temporary files there).

Also note that I won't bring out any updates for this toll because it does its job and I'm working on a new uitility that will be a little bit more blind user firendly than this one and will also contain diffrent functions like a music player and such or maybe an instrument set editor.

You can donwload the program from the file attatchment.
It should work on any OS that supports .NET 3.5 ( I used VC# 2008)

So now here are the offset of the songlists:
BPRE: 0x4A32CC
BPGE: 0x4A2BA8
AXVE: 0x45548C
AXPE: 0x4554E8
BPEE: 0x6B49F0
BPRD: 0x4A18F0
AXVD: 0x463428
BPED: 0x6C5BDC

So I hope you'll enjoy the tool!

PS: Greetings from Germany
Attached Files
File Type: zip M4A build in Assembler.zip‎ (1.17 MB, 305 views) (Save to Dropbox)
__________________
I'm sorry for my bad English. I'm German...
Visit my YouTube channel (music hacking and other stuff): http://www.youtube.com/user/theipatix

Last edited by ipatix; August 10th, 2011 at 09:06 AM. Reason: Update
Reply With Quote
  #2    
Old July 2nd, 2011, 10:44 PM
Platinum Lucario's Avatar
Platinum Lucario
The Legendary Master of Light!
Community Supporter
 
Join Date: Jan 2008
Location: Warrnambool, Victoria, Australia.
Age: 21
Gender: Male
Nature: Calm
Great, excellent! I am so glad we've finally gotten a better music assembler than what Sappy has. Sappy is rather unstable and can crash easily (and crash with certain loop points while testing out the song) and can only support a few .gba ROMs. I'm also looking forward to seeing a sound testing function on it so that anyone can test out their new song that they've inserted and being able to play every single soundbank in the ROM. Sappy could not support every single soundbank and some of them got replaced with simple beeps while testing out a song.

I would also like to suggest having a function that can edit the soundbank possitions and offsets and if there isn't a tool where you can convert a .wav file to a soundbank, then there should be a function in this tool to do so, that way anyone can record and convert their .wav to a soundbank. ;)
__________________
[Platinum Lucario's Signature]
Researching the NDS ROMs...

sure does feel like a brand new adventure!

I'm really looking forward to learning how to understand what the hex values mean and how to create programs using Microsoft Visual Studio!

Always focus on the present, best thing to do! Never look back into the past and never worry about anything bad of the future!
Reply With Quote
  #3    
Old August 7th, 2011, 05:19 AM
ilovecrumpet
Unhatched Egg
 
Join Date: Aug 2011
I'm a noob, so few questions if you don't mind.

1) 1. Make sure the "MPlayDef.s" library is placed in the same folder than the program.

What is this? I don't understand / I don't have a MPlayDef.s library? Where or how do I create one?

2) 6. Specify your soundbank/voicegroup

What is this? Is there a list of these anywhere? Or a method of locating them?

Thanks. All I wanna do is change a Pokémon battle theme x__X How difficult does this need to be D: I tried Sappy but it hates me.
Reply With Quote
  #4    
Old August 7th, 2011, 11:56 AM
itari's Avatar
itari
Community Supporter
 
Join Date: Mar 2010
Location: 渦潮隠れの里
Age: 17
Gender: Female
Nature: Relaxed
Quote:
Originally Posted by ilovecrumpet View Post
I'm a noob, so few questions if you don't mind.

1) 1. Make sure the "MPlayDef.s" library is placed in the same folder than the program.

What is this? I don't understand / I don't have a MPlayDef.s library? Where or how do I create one?

2) 6. Specify your soundbank/voicegroup

What is this? Is there a list of these anywhere? Or a method of locating them?

Thanks. All I wanna do is change a Pokémon battle theme x__X How difficult does this need to be D: I tried Sappy but it hates me.
1. MPlayDef.s is an asm file containing info for every music command. It comes with the tool Mid2Agb.
2. There is a thread posted somewhere with all the voicegroups for FireRed, but the only way is to check through sappy.

EDIT: For those who don't get what track group really is, you could also think of it as a "priority" property. The lower the number, the less precedence it has. For example BG music is 0 so that sfx can play over top of it.
__________________

Last edited by itari; August 7th, 2011 at 12:20 PM.
Reply With Quote
  #5    
Old August 8th, 2011, 04:11 AM
ilovecrumpet
Unhatched Egg
 
Join Date: Aug 2011
Thanks so much, actually managed to get a song imported now.

One thing I can't figure out (my sappy doesn't work), could someone tell me the soundbank offset for the wild battle theme in pokemon ruby?

Appreciated.
Reply With Quote
  #6    
Old August 8th, 2011, 07:51 AM
WrathOfArceus's Avatar
WrathOfArceus
Arceus Tamer
 
Join Date: Jun 2011
Gender: Male
It Does not Work for me. When i open a Rom or S.file i get an annoying error
Reply With Quote
  #7    
Old August 8th, 2011, 08:03 AM
Full Metal's Avatar
Full Metal
C(++) Developer.
Community Supporter
 
Join Date: Jan 2008
Location: In my mind.
Age: 18
Gender: Male
Nature: Timid
Send a message via Windows Live Messenger to Full Metal
That's a pretty good indicator that you're doing something wrong.
You know what would be really helpful?
A screenshot, or even a description of what the error says.
...yup. Maybe then useful information can be given to you. (;
__________________

★ full metal.

I like to push it,
and push it,
until my luck is over.
Reply With Quote
  #8    
Old August 8th, 2011, 11:20 AM
ruup20's Avatar
ruup20
Gonna splash everybody!
 
Join Date: Jan 2011
Location: Undella Town
Gender: Male
Nature: Jolly
I have a problem. If I press "build in this song" it simply does nothing.
__________________

I really need a advanced scripter for my hack and a good storyline-guy,
Thank you.
Reply With Quote
  #9    
Old August 10th, 2011, 12:25 AM
ipatix's Avatar
ipatix
Music Hacking Freak
 
Join Date: May 2008
Location: Germany
Gender: Male
Nature: Relaxed
@ruup20:

Tell me exactly what you've done and can you upload your .s file?

@WrathOfArceus:

What kind of error message do you get?
Are all your offsets word aligned?

@ilovecrumpe:

You may tiy out the old Version of Sappy (2005), or the MIDI only version (1.6).
Sappy 2005: http://www.megaupload.com/?d=UYUJRP62
Sappy 1.6 (midi only): http://www.megaupload.com/?d=45LLIDH8
__________________
I'm sorry for my bad English. I'm German...
Visit my YouTube channel (music hacking and other stuff): http://www.youtube.com/user/theipatix
Reply With Quote
  #10    
Old August 10th, 2011, 03:36 AM
ruup20's Avatar
ruup20
Gonna splash everybody!
 
Join Date: Jan 2011
Location: Undella Town
Gender: Male
Nature: Jolly
I just did what I had to do and nothing worked.
Attached Files
File Type: rar Route202.rar‎ (1.2 KB, 13 views) (Save to Dropbox)
__________________

I really need a advanced scripter for my hack and a good storyline-guy,
Thank you.
Reply With Quote
  #11    
Old August 10th, 2011, 07:24 AM
Full Metal's Avatar
Full Metal
C(++) Developer.
Community Supporter
 
Join Date: Jan 2008
Location: In my mind.
Age: 18
Gender: Male
Nature: Timid
Send a message via Windows Live Messenger to Full Metal
Quote:
Originally Posted by ruup20 View Post
I just did what I had to do and nothing worked.
Then wouldn't it make sense to say you did not do what you had to do so therefor nothing worked the way you thought it ought? Hm?
Perhaps a screenshot would be nice to have, followed by step-by-step informations of what excatly you did.
__________________

★ full metal.

I like to push it,
and push it,
until my luck is over.
Reply With Quote
  #12    
Old August 10th, 2011, 07:38 AM
WrathOfArceus's Avatar
WrathOfArceus
Arceus Tamer
 
Join Date: Jun 2011
Gender: Male
My error says Unhandled Exception has occurred in your application
Reply With Quote
  #13    
Old August 10th, 2011, 07:56 AM
Full Metal's Avatar
Full Metal
C(++) Developer.
Community Supporter
 
Join Date: Jan 2008
Location: In my mind.
Age: 18
Gender: Male
Nature: Timid
Send a message via Windows Live Messenger to Full Metal
^that^ makes debugging so much easier, believe it or not.
All the writer needs to do is wrap his code in try/catch statements now, and then he can figure out where the error comes from.
__________________

★ full metal.

I like to push it,
and push it,
until my luck is over.
Reply With Quote
  #14    
Old August 10th, 2011, 08:53 AM
ruup20's Avatar
ruup20
Gonna splash everybody!
 
Join Date: Jan 2011
Location: Undella Town
Gender: Male
Nature: Jolly
okay now it just freeze... Or it just take much time to load.
Attached Images
File Type: png naamloos.PNG‎ (21.6 KB, 53 views) (Save to Dropbox)
__________________

I really need a advanced scripter for my hack and a good storyline-guy,
Thank you.
Reply With Quote
  #15    
Old August 10th, 2011, 09:07 AM
ipatix's Avatar
ipatix
Music Hacking Freak
 
Join Date: May 2008
Location: Germany
Gender: Male
Nature: Relaxed
@ruup20:

I'm sorry, the version I uploaded was out of date and didn't worked with .s with only 1 track.

I now uploaded a newer version!

@WrathOfArceus:
Can you give me your .s file or even tell me what kind of Unhandled Exception occurred (click on the details button).
__________________
I'm sorry for my bad English. I'm German...
Visit my YouTube channel (music hacking and other stuff): http://www.youtube.com/user/theipatix
Reply With Quote
  #16    
Old August 10th, 2011, 09:37 AM
Full Metal's Avatar
Full Metal
C(++) Developer.
Community Supporter
 
Join Date: Jan 2008
Location: In my mind.
Age: 18
Gender: Male
Nature: Timid
Send a message via Windows Live Messenger to Full Metal
@ipatix - what language is this written in?
__________________

★ full metal.

I like to push it,
and push it,
until my luck is over.
Reply With Quote
  #17    
Old August 10th, 2011, 10:08 AM
ruup20's Avatar
ruup20
Gonna splash everybody!
 
Join Date: Jan 2011
Location: Undella Town
Gender: Male
Nature: Jolly
And how do I put it in a town/route?
__________________

I really need a advanced scripter for my hack and a good storyline-guy,
Thank you.
Reply With Quote
  #18    
Old August 10th, 2011, 10:32 AM
Full Metal's Avatar
Full Metal
C(++) Developer.
Community Supporter
 
Join Date: Jan 2008
Location: In my mind.
Age: 18
Gender: Male
Nature: Timid
Send a message via Windows Live Messenger to Full Metal
...You insert it into the correct spot... x)
__________________

★ full metal.

I like to push it,
and push it,
until my luck is over.
Reply With Quote
  #19    
Old August 10th, 2011, 01:05 PM
ipatix's Avatar
ipatix
Music Hacking Freak
 
Join Date: May 2008
Location: Germany
Gender: Male
Nature: Relaxed
Quote:
Originally Posted by Full Metal View Post
@ipatix - what language is this written in?
Visual C# 2008 (.NET 3.5)
__________________
I'm sorry for my bad English. I'm German...
Visit my YouTube channel (music hacking and other stuff): http://www.youtube.com/user/theipatix
Reply With Quote
  #20    
Old August 10th, 2011, 01:06 PM
SK3's Avatar
SK3
Pokemon Hacking Company™ CEO
 
Join Date: Apr 2011
Location: Johto
Age: 19
Gender: Male
Nature: Quirky
Send a message via Windows Live Messenger to SK3
Okay, so I loaded my ROM, loaded my .s file, put in the Song Pointer, the track data, and the soundbank offset. When I clicked assemble, I got the Unhandled Exception error, but I pressed continue, and the log continued to work. But then it got stuck on "Getting lengths of tracks". What did I do wrong?
__________________

Pokemon
Daydream White version


Want to help out? Just PM or VM me!

Reply With Quote
  #21    
Old August 10th, 2011, 01:38 PM
Full Metal's Avatar
Full Metal
C(++) Developer.
Community Supporter
 
Join Date: Jan 2008
Location: In my mind.
Age: 18
Gender: Male
Nature: Timid
Send a message via Windows Live Messenger to Full Metal
Quote:
Originally Posted by ipatix View Post
Visual C# 2008 (.NET 3.5)
I see.
I was going to ask to see the source, and maybe debug it with/for you. Unfortunately, I'm not so sharp at...C# ( no pun intended. x) )
__________________

★ full metal.

I like to push it,
and push it,
until my luck is over.
Reply With Quote
  #22    
Old August 10th, 2011, 06:31 PM
WrathOfArceus's Avatar
WrathOfArceus
Arceus Tamer
 
Join Date: Jun 2011
Gender: Male
Details Of My Error

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.BadImageFormatException: Retrieving the COM class factory for component with CLSID {DC1C5A9C-E88A-4DDE-A5A1-60F82A20AEF7} failed due to the following error: 800700c1.
at System.Windows.Forms.OpenFileDialog.CreateVistaDialog()
at System.Windows.Forms.FileDialog.RunDialogVista(IntPtr hWndOwner)
at System.Windows.Forms.CommonDialog.ShowDialog(IWin32Window owner)
at WindowsFormsApplication1.Form1.button2_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4961 (win7RTMGDR.050727-4900)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
M4A build in Assembler
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/Owner/AppData/Local/Temp/Rar$EX83.752/M4A%20build%20in%20Assembler.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4961 (win7RTMGDR.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4957 (win7RTMGDR.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Reply With Quote
  #23    
Old August 11th, 2011, 12:02 AM
ipatix's Avatar
ipatix
Music Hacking Freak
 
Join Date: May 2008
Location: Germany
Gender: Male
Nature: Relaxed
Can you give me your .s file or the patch of your ROM?

That could help me!
__________________
I'm sorry for my bad English. I'm German...
Visit my YouTube channel (music hacking and other stuff): http://www.youtube.com/user/theipatix

Last edited by ipatix; August 11th, 2011 at 12:22 AM.
Reply With Quote
  #24    
Old August 11th, 2011, 12:08 AM
WrathOfArceus's Avatar
WrathOfArceus
Arceus Tamer
 
Join Date: Jun 2011
Gender: Male
there's the S. File i was trying to insert
Attached Files
File Type: rar GSC Wild battle johto.rar‎ (3.0 KB, 5 views) (Save to Dropbox)
Reply With Quote
  #25    
Old August 11th, 2011, 02:11 AM
ipatix's Avatar
ipatix
Music Hacking Freak
 
Join Date: May 2008
Location: Germany
Gender: Male
Nature: Relaxed
@WrathofArceus:
Did you overwrite a song that was damaged?
Because it seems that the program has crashed after getting the length of the old trackdata to remove them.

@Full Metal:
Okay you can get the source code, but I can't give it to you now because my other PC got a virus.
I will tell you when I can give you the source ;-)
__________________
I'm sorry for my bad English. I'm German...
Visit my YouTube channel (music hacking and other stuff): http://www.youtube.com/user/theipatix
Reply With Quote
Reply
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
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 05:49 PM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.