11 March 2016 - Forum Rules

Main Menu

NES Music hacking?

Started by marchegiano, November 02, 2021, 10:02:07 AM

Previous topic - Next topic


I just wanted to make sure there are no tools before I give up what I wanted to do.

I would like to change the music in Holy Diver on NES to Holy Diver the album. Well, you know what I mean, Dio sounding NES beeps and boops as close to the actual songs as I can get them.

I've found ways to rip music out of NES games and plenty of solutions for making the tracks themselves but nothing for swapping music.

So I assume it's a bit more in depth than finding the tool and using it. Probably well out of my league. Just wanted to make sure before I gave up on it.


Quote from: marchegiano on November 02, 2021, 10:02:07 AMI've found ways to rip music out of NES games
Can you be more precise about what exactly you were looking at?

QuoteSo I assume it's a bit more in depth than finding the tool and using it. Probably well out of my league.
Probably. That's why there aren't very many NES music hacks.

I would go into a little more detail but I'd rather not repeat things you already know.
This signature is an illusion and is a trap devisut by Satan. Go ahead dauntlessly! Make rapid progres!


It really depends on what game you're hacking.

If you would to edit the music yourself, I recommend starting by finding the where the notes are being processed in RAM. Then you should find where the notes are. You should also find commands that affect the song, like pitch and tempo. Take note of certain limitations like space available, and some games play music in RAM.

Sliver X

The "proper" way would be to set breakpoints on the APU registers ($4015 would probably be the logical choice to monitor as it enables and disables channels?) and do tracing in a debugger to find where the music data is, then reverse engineering how the game is using the APU: There is no driver for sound on the NES, each programmer had complete control of the hardware and most had different ideas of how to generate the music.

A cruder way would be to run FCEUX's Code/Data Logger utility when starting an area of a game where a song begins, then stopping it shortly thereafter. Through trial and error (Randomly changing the green highlighted bytes in FCEUX's Hex Editor, also called Corruption) you will eventually find the data. Then you have to reverse engineer the data format the game is using to generate the songs.

Even with this, you have two problems: If you're trying to put a song from something else into the game, you'll need to transcribe the music to whatever data format the music is stored in. If you're writing original songs, you should probably either play an instrument you can compose on or have a passing knowledge of music theory. Both require actual musical knowledge of some sort (I composed music for NES games on a guitar and bass, then translated them into the format needed).

It's not simple to pull off, but I always had a lot of fun doing it.