News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: New/Simple Music Hacking Method Discovered?  (Read 3516 times)

Woodman

  • Jr. Member
  • **
  • Posts: 20
    • View Profile
New/Simple Music Hacking Method Discovered?
« on: March 03, 2017, 12:32:02 am »
So I've been messing around trying to edit the music in MM2 using an assortment of guides and tools and I, being a the complete beginner that I am, try to find a simpler method than just changing random values in the .nsf and hoping for the best. Being familiar with Famitracker, I wondered if there was any way to import nsf files into the program, and sure enough some guy made a modified version which is located right here: http://famitracker.com/forum/posts.php?id=2284&sort=1 (editing is disabled on this version so you have to use the official version to edit).

So I loaded it up, messed around with the title theme a little bit, and exported the result as an nsf and loaded it and the original nsf into translhextion for a comparison. Immediately, I noticed that a large chunk of the substance of the original file was gone, replaced with random repeating digits. This was probably due to the fact that Famitracker can only open 1 "song" from an nsf file at one time, overwriting the space that the other songs occupied with garbage data.

Now I have tried scrolling through, trying to find bits that look like music, copying and pasting into the Hex editor in FCEUX, and nothing of note has happened besides game corruption, but I feel like I've barely scratched the surface. Either I'm just dumb and Famitracker has reformatted the nsf to where it's basically useless, or I have no idea what I'm doing or where I'm putting the code or what code I'm putting in so the desired result has still yet to be achieved. If you too are desperate for edited music in your game then I think it would be a good idea to test around with this (for science!). On the other had, if you have a lot of knowledge in this area and are ready to tell me that I'm way off, please do.

furrykef

  • Full Member
  • ***
  • Posts: 132
    • View Profile
Re: New/Simple Music Hacking Method Discovered?
« Reply #1 on: March 03, 2017, 12:51:05 am »
FamiTracker's music engine is completely incompatible with the engine used in MM2 or any other commercial game. Unless you want to replace the entire soundtrack (which is a huge task), editing music this way isn't going to be viable.

Bregalad

  • Hero Member
  • *****
  • Posts: 2751
    • View Profile
Re: New/Simple Music Hacking Method Discovered?
« Reply #2 on: March 03, 2017, 03:15:35 am »
FamiTracker's music engine is completely incompatible with the engine used in MM2 or any other commercial game.
Not only that, but it also eats up way too much ROM, RAM and CPU time to be viable for most NES games, so even if you were ready to replace the whole soundtrack it wouldn't be feasible.

Woodman

  • Jr. Member
  • **
  • Posts: 20
    • View Profile
Re: New/Simple Music Hacking Method Discovered?
« Reply #3 on: March 03, 2017, 08:41:52 am »
Ok, thats about the response I'd expect. I thought there might be some hope since I'm using the original file to do the music making, but yeah I guess nothing in romhacking is ever simple lol

dACE

  • Sr. Member
  • ****
  • Posts: 353
    • View Profile
Re: New/Simple Music Hacking Method Discovered?
« Reply #4 on: March 03, 2017, 01:27:24 pm »
...but yeah I guess nothing in romhacking is ever simple lol

Nope - this is a hard lesson learned for many that are new to hacking roms.

There are a lot of "I'm going to make a entire new Zelda, Mario, whatever game - pls help?" threads started. But when it dawns on them that this would require some serious comitment and that they have to devote most of their spare time to such a project - you never hear from them again.

You just have to ask yourself - how bad do you want your hack realized?

/dACE


FAST6191

  • Hero Member
  • *****
  • Posts: 3134
    • View Profile
Re: New/Simple Music Hacking Method Discovered?
« Reply #5 on: March 03, 2017, 03:51:48 pm »
There are plenty of simple things in ROM hacking, however it would be foolish to say any one area is simple -- I have games use plain text files (or ini style text files anyway) with no pointers or anything but I have also had games bury scripting engines within the binary.
Likewise I have had graphics only be only as hard as pixel editing, or editing within palette images, and... I am sure I don't have to describe a complex graphics hack.

If I were to want a hack that could be done with the GUI programs that already exist then many of those would also be doable with little more than a time commitment.

Whether whatever random game you have found could be hacked simply is a different matter. Usually the answer is no as well. As many seem to come to ROM hacking with a high level game edit in mind rather than for the joy of reverse engineering file formats it does often present a fair barrier to entry.

HertzDevil

  • Jr. Member
  • **
  • Posts: 8
  • 星の鼓動は愛
    • View Profile
    • GitHub
Re: New/Simple Music Hacking Method Discovered?
« Reply #6 on: March 04, 2017, 01:51:40 am »
So I loaded it up, messed around with the title theme a little bit, and exported the result as an nsf and loaded it and the original nsf into translhextion for a comparison. Immediately, I noticed that a large chunk of the substance of the original file was gone, replaced with random repeating digits. This was probably due to the fact that Famitracker can only open 1 "song" from an nsf file at one time, overwriting the space that the other songs occupied with garbage data.

Now I have tried scrolling through, trying to find bits that look like music, copying and pasting into the Hex editor in FCEUX, and nothing of note has happened besides game corruption, but I feel like I've barely scratched the surface. Either I'm just dumb and Famitracker has reformatted the nsf to where it's basically useless, or I have no idea what I'm doing or where I'm putting the code or what code I'm putting in so the desired result has still yet to be achieved.
This is full of dangerous assumptions. You are not scratching the surface any more than other methods of memory corruption can achieve.

The FamiTracker NSF Importer mod does not reconstruct any input NSF file. The moment you import an NSF file, its internal structure is already lost; the resulting FTM file only attempts to replicate the song down to every single register write. All that much of data in the re-exported NSF is used for these granular events, usually bigger than the whole original NSF. If you have ever seen a raw VGM file in a hex editor, this is more or less the same thing. It also never "[overwrites] the space that the other songs occupied"; you can manually merge multiple such FTMs into a single file, and still the result is the same. FamiTracker can write unused data, but never garbage data under normal usage.
Constructing Chiptune; Construing 8-Bit. Makes a generic MML compiler in Lua.